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/DynamicHelloWorldExample/HelloWorldPublisher.cpp b/examples/cpp/dds/DynamicHelloWorldExample/HelloWorldPublisher.cpp index 9e2f1c2c728..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; @@ -47,33 +49,21 @@ bool HelloWorldPublisher::init() return false; } - eprosima::fastrtps::types::DynamicTypeBuilder* type; + DynamicType::_ref_type dyn_type; if (RETCODE_OK != - DomainParticipantFactory::get_instance()->get_dynamic_type_builder_from_xml_by_name("HelloWorld", type)) + 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"); @@ -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 419bb21e17b..f65d324a2cf 100644 --- a/examples/cpp/dds/DynamicHelloWorldExample/HelloWorldSubscriber.cpp +++ b/examples/cpp/dds/DynamicHelloWorldExample/HelloWorldSubscriber.cpp @@ -27,8 +27,8 @@ #include #include #include -#include -#include +#include +#include using namespace eprosima::fastdds::dds; @@ -114,16 +114,15 @@ 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) == 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); } } } @@ -133,7 +132,7 @@ 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) @@ -167,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 c0f1e54bec2..447d8685e9f 100644 --- a/examples/cpp/dds/DynamicHelloWorldExample/HelloWorldSubscriber.h +++ b/examples/cpp/dds/DynamicHelloWorldExample/HelloWorldSubscriber.h @@ -29,6 +29,8 @@ #include #include #include +#include +#include class HelloWorldSubscriber { @@ -59,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_; @@ -99,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/FlowControlExample/FlowControlExample.hpp b/examples/cpp/dds/FlowControlExample/FlowControlExample.hpp index 68bcb6de578..da43ccd5c38 100644 --- a/examples/cpp/dds/FlowControlExample/FlowControlExample.hpp +++ b/examples/cpp/dds/FlowControlExample/FlowControlExample.hpp @@ -79,9 +79,9 @@ class FlowControlExample eProsima_user_DllExport FlowControlExample( const FlowControlExample& x) { - m_message = x.m_message; + m_message = x.m_message; - m_wasFast = x.m_wasFast; + m_wasFast = x.m_wasFast; } @@ -104,9 +104,9 @@ class FlowControlExample const FlowControlExample& x) { - m_message = x.m_message; + m_message = x.m_message; - m_wasFast = x.m_wasFast; + m_wasFast = x.m_wasFast; return *this; } @@ -132,7 +132,7 @@ class FlowControlExample const FlowControlExample& x) const { return (m_message == x.m_message && - m_wasFast == x.m_wasFast); + m_wasFast == x.m_wasFast); } /*! @@ -183,7 +183,6 @@ class FlowControlExample return m_message; } - /*! * @brief This function sets a value in member wasFast * @param _wasFast New value for member wasFast @@ -212,11 +211,9 @@ class FlowControlExample return m_wasFast; } - - private: - std::array m_message{0}; + std::array m_message; char m_wasFast{0}; }; diff --git a/examples/cpp/dds/Keys/samplePubSubTypes.cxx b/examples/cpp/dds/Keys/samplePubSubTypes.cxx index cae143a08ca..87afe9441ca 100644 --- a/examples/cpp/dds/Keys/samplePubSubTypes.cxx +++ b/examples/cpp/dds/Keys/samplePubSubTypes.cxx @@ -36,10 +36,10 @@ samplePubSubType::samplePubSubType() setName("sample"); uint32_t type_size = #if FASTCDR_VERSION_MAJOR == 1 - static_cast(sample::getMaxCdrSerializedSize()); + static_cast(sample::getMaxCdrSerializedSize()); #else - sample_max_cdr_typesize; -#endif + sample_max_cdr_typesize; +#endif // if FASTCDR_VERSION_MAJOR == 1 type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = true; @@ -150,8 +150,8 @@ std::function samplePubSubType::getSerializedSizeProvider( 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*/; + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; } catch (eprosima::fastcdr::exception::Exception& /*exception*/) { @@ -189,7 +189,8 @@ bool samplePubSubType::getKey( sample_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, + eprosima::fastcdr::CdrVersion::XCDRv1); #if FASTCDR_VERSION_MAJOR == 1 p_type->serializeKey(ser); #else @@ -224,6 +225,5 @@ 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/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 cbeea0c1d2c..00000000000 --- a/examples/cpp/dds/TypeLookupService/TypeLookupPublisher.cpp +++ /dev/null @@ -1,236 +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 (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 (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.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.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 9a4e92c33ab..00000000000 --- a/examples/cpp/dds/TypeLookupService/TypeLookupSubscriber.cpp +++ /dev/null @@ -1,173 +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 - -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.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() != 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) == 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::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 e1e9b769ad4..00000000000 --- a/examples/cpp/dds/TypeLookupService/TypeLookupSubscriber.h +++ /dev/null @@ -1,108 +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; - - int n_matched; - - uint32_t n_samples; - - TypeLookupSubscriber* subscriber_; - - std::map topic_type_map_; - - } - 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/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/domain/DomainParticipantFactory.hpp b/include/fastdds/dds/domain/DomainParticipantFactory.hpp index 189acb2310f..77f482f1f94 100644 --- a/include/fastdds/dds/domain/DomainParticipantFactory.hpp +++ b/include/fastdds/dds/domain/DomainParticipantFactory.hpp @@ -24,12 +24,13 @@ #include #include +#include #include #include #include +#include #include #include -#include namespace eprosima { @@ -290,7 +291,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. @@ -301,7 +302,7 @@ 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. 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 be646bb86a4..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,7 +31,6 @@ #include #include #include -#include namespace eprosima { namespace fastrtps { diff --git a/include/fastdds/dds/publisher/Publisher.hpp b/include/fastdds/dds/publisher/Publisher.hpp index d9fd470ddff..3a9a6d71353 100644 --- a/include/fastdds/dds/publisher/Publisher.hpp +++ b/include/fastdds/dds/publisher/Publisher.hpp @@ -21,13 +21,13 @@ #define _FASTDDS_PUBLISHER_HPP_ #include +#include #include #include #include #include #include -#include namespace dds { namespace pub { diff --git a/include/fastdds/dds/subscriber/DataReader.hpp b/include/fastdds/dds/subscriber/DataReader.hpp index ea3c0a9593e..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,8 +43,6 @@ #include #include -#include - namespace dds { namespace sub { diff --git a/include/fastdds/dds/subscriber/Subscriber.hpp b/include/fastdds/dds/subscriber/Subscriber.hpp index f17d706609a..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,7 +29,6 @@ #include #include #include -#include namespace dds { namespace sub { diff --git a/include/fastdds/dds/topic/ContentFilteredTopic.hpp b/include/fastdds/dds/topic/ContentFilteredTopic.hpp index c925d59127c..bda635de270 100644 --- a/include/fastdds/dds/topic/ContentFilteredTopic.hpp +++ b/include/fastdds/dds/topic/ContentFilteredTopic.hpp @@ -19,9 +19,10 @@ #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 diff --git a/include/fastdds/dds/topic/IContentFilterFactory.hpp b/include/fastdds/dds/topic/IContentFilterFactory.hpp index 12ef9898808..b61219d4151 100644 --- a/include/fastdds/dds/topic/IContentFilterFactory.hpp +++ b/include/fastdds/dds/topic/IContentFilterFactory.hpp @@ -25,7 +25,6 @@ #include #include #include -#include namespace eprosima { namespace fastdds { @@ -37,7 +36,6 @@ namespace dds { struct IContentFilterFactory { 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 a9fa7ca91cb..c10e34f9793 100644 --- a/include/fastdds/dds/topic/Topic.hpp +++ b/include/fastdds/dds/topic/Topic.hpp @@ -21,6 +21,7 @@ #include #include +#include #include #include #include diff --git a/include/fastdds/dds/topic/TopicDataType.hpp b/include/fastdds/dds/topic/TopicDataType.hpp index 029b868f117..189f4aed613 100644 --- a/include/fastdds/dds/topic/TopicDataType.hpp +++ b/include/fastdds/dds/topic/TopicDataType.hpp @@ -119,6 +119,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; diff --git a/include/fastdds/dds/topic/TypeSupport.hpp b/include/fastdds/dds/topic/TypeSupport.hpp index c14ff946dff..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,11 +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 Base = std::shared_ptr; + using Base = std::shared_ptr; /** * @brief Constructor @@ -93,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) { } @@ -105,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 index e68a76446c9..3001d6120f4 100644 --- a/include/fastdds/dds/xtypes/common.hpp +++ b/include/fastdds/dds/xtypes/common.hpp @@ -20,6 +20,8 @@ #ifndef _FASTDDS_DDS_XTYPES_COMMON_HPP_ #define _FASTDDS_DDS_XTYPES_COMMON_HPP_ +#include + namespace eprosima { namespace fastdds { namespace dds { @@ -72,37 +74,37 @@ 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"; +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 diff --git a/include/fastdds/dds/xtypes/dynamic_types/AnnotationDescriptor.hpp b/include/fastdds/dds/xtypes/dynamic_types/AnnotationDescriptor.hpp index 0a6a90d8d85..5eaef141de7 100644 --- a/include/fastdds/dds/xtypes/dynamic_types/AnnotationDescriptor.hpp +++ b/include/fastdds/dds/xtypes/dynamic_types/AnnotationDescriptor.hpp @@ -29,6 +29,8 @@ 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. diff --git a/include/fastdds/dds/xtypes/dynamic_types/DynamicData.hpp b/include/fastdds/dds/xtypes/dynamic_types/DynamicData.hpp index 26ab328cc80..6aefb983224 100644 --- a/include/fastdds/dds/xtypes/dynamic_types/DynamicData.hpp +++ b/include/fastdds/dds/xtypes/dynamic_types/DynamicData.hpp @@ -21,14 +21,14 @@ #include #include #include -#include +#include #include namespace eprosima { namespace fastdds { namespace dds { -class FASTDDS_EXPORTED_API DynamicData : public std::enable_shared_from_this +class DynamicData : public std::enable_shared_from_this { public: @@ -38,17 +38,17 @@ class FASTDDS_EXPORTED_API DynamicData : public std::enable_shared_from_this::ref_type type() = 0; + 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. + * @retval RETCODE_BAD_PARAMETER when descriptor reference is nil or member identifier is not found. */ - virtual ReturnCode_t get_descriptor( - traits::ref_type value, + FASTDDS_EXPORTED_API virtual ReturnCode_t get_descriptor( + traits::ref_type& value, MemberId id) = 0; /*! @@ -57,12 +57,10 @@ class FASTDDS_EXPORTED_API DynamicData : public std::enable_shared_from_this::ref_type other) = 0; /*! @@ -75,7 +73,7 @@ class FASTDDS_EXPORTED_API DynamicData : public std::enable_shared_from_this::ref_type loan_value( + FASTDDS_EXPORTED_API virtual traits::ref_type loan_value( MemberId id) = 0; /*! @@ -160,7 +155,7 @@ class FASTDDS_EXPORTED_API DynamicData : public std::enable_shared_from_this::ref_type value) = 0; /*! @@ -168,7 +163,7 @@ class FASTDDS_EXPORTED_API DynamicData : public std::enable_shared_from_this::ref_type clone() = 0; + FASTDDS_EXPORTED_API virtual traits::ref_type clone() = 0; /*! * Retrieves an \b int32 value associated to an identifier. @@ -178,7 +173,7 @@ class FASTDDS_EXPORTED_API DynamicData : public std::enable_shared_from_this::ref_type value, + FASTDDS_EXPORTED_API virtual ReturnCode_t get_complex_value( + traits::ref_type& value, MemberId id) = 0; /*! @@ -597,9 +594,10 @@ class FASTDDS_EXPORTED_API DynamicData : public std::enable_shared_from_this::ref_type value) = 0; @@ -611,7 +609,7 @@ class FASTDDS_EXPORTED_API DynamicData : public std::enable_shared_from_this #include -#include #include namespace eprosima { namespace fastdds { namespace dds { -class FASTDDS_EXPORTED_API DynamicDataFactory : public std::enable_shared_from_this +class DynamicDataFactory : public std::enable_shared_from_this { public: @@ -37,15 +36,15 @@ class FASTDDS_EXPORTED_API DynamicDataFactory : public std::enable_shared_from_t * @remark This method is non thread-safe. * @return @ref DynamicDataFactory reference. */ - static traits::ref_type get_instance(); + FASTDDS_EXPORTED_API static traits::ref_type get_instance(); /*! * Resets the singleton reference. * @return @ref ReturnCode_t - * @retval RETCODE_OK is always returned. - * @todo Improve this documentation. + * @retval RETCODE_BAD_PARAMETER if singleton reference is currently nil. + * @retval RETCODE_OK otherwise. */ - static ReturnCode_t delete_instance(); + FASTDDS_EXPORTED_API static ReturnCode_t delete_instance(); /** * Creates a new @ref DynamicData reference based on the given @ref DynamicType reference. @@ -53,7 +52,7 @@ class FASTDDS_EXPORTED_API DynamicDataFactory : public std::enable_shared_from_t * @param[in] type @ref DynamicType reference associated. * @return new @ref DynamicData reference */ - virtual traits::ref_type create_data( + FASTDDS_EXPORTED_API virtual traits::ref_type create_data( traits::ref_type type) = 0; /** @@ -63,8 +62,13 @@ class FASTDDS_EXPORTED_API DynamicDataFactory : public std::enable_shared_from_t * @retval RETCODE_BAD_PARAMETER if reference is nil. * @retval RETCODE_OK is otherwise returned. */ - virtual ReturnCode_t delete_data( + FASTDDS_EXPORTED_API virtual ReturnCode_t delete_data( traits::ref_type data) = 0; + +protected: + + virtual ~DynamicDataFactory() = default; + }; } // namespace dds 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..26b1913e837 --- /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 index 547695c8b6b..9025efd7b68 100644 --- a/include/fastdds/dds/xtypes/dynamic_types/DynamicType.hpp +++ b/include/fastdds/dds/xtypes/dynamic_types/DynamicType.hpp @@ -29,7 +29,7 @@ namespace eprosima { namespace fastdds { namespace dds { -class FASTDDS_EXPORTED_API DynamicType : public std::enable_shared_from_this +class DynamicType : public std::enable_shared_from_this { public: @@ -42,30 +42,30 @@ class FASTDDS_EXPORTED_API DynamicType : public std::enable_shared_from_this::ref_type descriptor) = 0; + FASTDDS_EXPORTED_API virtual ReturnCode_t get_descriptor( + traits::ref_type& descriptor) = 0; /*! * Returns the fully qualified name of this type * @return Type name. */ - virtual ObjectName get_name() = 0; + FASTDDS_EXPORTED_API virtual ObjectName get_name() = 0; /*! * Returns the @ref TypeKind associated * @return @ref TypeKind */ - virtual TypeKind get_kind() = 0; + 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 exists. + * @retval RETCODE_BAD_PARAMETER when the member doesn't exist. */ - virtual ReturnCode_t get_member_by_name( - traits::ref_type member, + FASTDDS_EXPORTED_API virtual ReturnCode_t get_member_by_name( + traits::ref_type& member, const ObjectName& name) = 0; /*! @@ -74,7 +74,7 @@ class FASTDDS_EXPORTED_API DynamicType : public std::enable_shared_from_this::ref_type member, + FASTDDS_EXPORTED_API virtual ReturnCode_t get_member( + traits::ref_type& member, MemberId id) = 0; /*! @@ -95,14 +95,14 @@ class FASTDDS_EXPORTED_API DynamicType : public std::enable_shared_from_this::ref_type member, + 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. */ - virtual uint32_t get_annotation_count() = 0; + FASTDDS_EXPORTED_API virtual uint32_t get_annotation_count() = 0; /*! * Returns an applied annotation by index. @@ -130,15 +130,15 @@ class FASTDDS_EXPORTED_API DynamicType : public std::enable_shared_from_this::ref_type descriptor, + 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. */ - virtual uint32_t get_verbatim_text_count() = 0; + FASTDDS_EXPORTED_API virtual uint32_t get_verbatim_text_count() = 0; /*! * Returns an applied verbatim text by index. @@ -148,8 +148,8 @@ class FASTDDS_EXPORTED_API DynamicType : public std::enable_shared_from_this::ref_type descriptor, + FASTDDS_EXPORTED_API virtual ReturnCode_t get_verbatim_text( + traits::ref_type& descriptor, uint32_t idx) = 0; /** @@ -157,7 +157,7 @@ class FASTDDS_EXPORTED_API DynamicType : public std::enable_shared_from_this::ref_type other) = 0; protected: @@ -166,7 +166,7 @@ class FASTDDS_EXPORTED_API DynamicType : public std::enable_shared_from_this::ref_type _this (); + traits::ref_type _this(); private: diff --git a/include/fastdds/dds/xtypes/dynamic_types/DynamicTypeBuilder.hpp b/include/fastdds/dds/xtypes/dynamic_types/DynamicTypeBuilder.hpp index f568bdc3633..9ea32a56ecf 100644 --- a/include/fastdds/dds/xtypes/dynamic_types/DynamicTypeBuilder.hpp +++ b/include/fastdds/dds/xtypes/dynamic_types/DynamicTypeBuilder.hpp @@ -28,10 +28,12 @@ namespace eprosima { namespace fastdds { namespace dds { -class FASTDDS_EXPORTED_API DynamicTypeBuilder : public std::enable_shared_from_this +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 @@ -39,20 +41,20 @@ class FASTDDS_EXPORTED_API DynamicTypeBuilder : public std::enable_shared_from_t * @retval RETCODE_OK when the copy was successful. * @retval RETCODE_BAD_PARAMETER when descriptor reference is nil. */ - virtual ReturnCode_t get_descriptor( - traits::ref_type descriptor) = 0; + FASTDDS_EXPORTED_API virtual ReturnCode_t get_descriptor( + traits::ref_type& descriptor) = 0; /*! * Returns the fully qualified name of this type * @return Type name. */ - virtual ObjectName get_name() = 0; + FASTDDS_EXPORTED_API virtual ObjectName get_name() = 0; /*! * Returns the @ref TypeKind associated * @return @ref TypeKind */ - virtual TypeKind get_kind() = 0; + FASTDDS_EXPORTED_API virtual TypeKind get_kind() = 0; /*! * Returns a member looked for by name. @@ -62,8 +64,8 @@ class FASTDDS_EXPORTED_API DynamicTypeBuilder : public std::enable_shared_from_t * @retval RETCODE_OK when member was found. * @retval RETCODE_BAD_PARAMETER when member wasn't found. */ - virtual ReturnCode_t get_member_by_name( - traits::ref_type member, + FASTDDS_EXPORTED_API virtual ReturnCode_t get_member_by_name( + traits::ref_type& member, const ObjectName& name) = 0; /*! @@ -72,7 +74,7 @@ class FASTDDS_EXPORTED_API DynamicTypeBuilder : public std::enable_shared_from_t * @return @ref ReturnCode_t * @retval RETCODE_OK always. */ - virtual ReturnCode_t get_all_members_by_name( + FASTDDS_EXPORTED_API virtual ReturnCode_t get_all_members_by_name( DynamicTypeMembersByName& member) = 0; /*! * Returns a member looked for by @ref MemberId. @@ -82,8 +84,8 @@ class FASTDDS_EXPORTED_API DynamicTypeBuilder : public std::enable_shared_from_t * @retval RETCODE_OK when member was found. * @retval RETCODE_BAD_PARAMETER when member wasn't found. */ - virtual ReturnCode_t get_member( - traits::ref_type member, + FASTDDS_EXPORTED_API virtual ReturnCode_t get_member( + traits::ref_type& member, MemberId id) = 0; /*! @@ -92,14 +94,14 @@ class FASTDDS_EXPORTED_API DynamicTypeBuilder : public std::enable_shared_from_t * @return @ref ReturnCode_t * @retval RETCODE_OK always. */ - virtual ReturnCode_t get_all_members( + 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 */ - virtual uint32_t get_member_count() = 0; + FASTDDS_EXPORTED_API virtual uint32_t get_member_count() = 0; /*! * This operation returns the member that corresponds to the specified index. @@ -109,15 +111,15 @@ class FASTDDS_EXPORTED_API DynamicTypeBuilder : public std::enable_shared_from_t * @retval RETCODE_OK when member was found. * @retval RETCODE_BAD_PARAMETER when index is out-of-range. */ - virtual ReturnCode_t get_member_by_index( - traits::ref_type member, + 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 */ - virtual uint32_t get_annotation_count() = 0; + FASTDDS_EXPORTED_API virtual uint32_t get_annotation_count() = 0; /*! * This operation returns the annotation that corresponds to the specified index. @@ -127,8 +129,8 @@ class FASTDDS_EXPORTED_API DynamicTypeBuilder : public std::enable_shared_from_t * @retval RETCODE_OK when member was found. * @retval RETCODE_BAD_PARAMETER when reference is nil or index is out-of-range. */ - virtual ReturnCode_t get_annotation( - traits::ref_type descriptor, + FASTDDS_EXPORTED_API virtual ReturnCode_t get_annotation( + traits::ref_type& descriptor, uint32_t idx) = 0; /*! @@ -136,7 +138,7 @@ class FASTDDS_EXPORTED_API DynamicTypeBuilder : public std::enable_shared_from_t * @param[in] other @ref DynamicType reference to compare to. * @return \b bool `true` on equality */ - virtual bool equals( + FASTDDS_EXPORTED_API virtual bool equals( traits::ref_type other) = 0; /*! @@ -146,8 +148,9 @@ class FASTDDS_EXPORTED_API DynamicTypeBuilder : public std::enable_shared_from_t * @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. */ - virtual ReturnCode_t add_member( + FASTDDS_EXPORTED_API virtual ReturnCode_t add_member( traits::ref_type descriptor) = 0; /*! @@ -157,7 +160,7 @@ class FASTDDS_EXPORTED_API DynamicTypeBuilder : public std::enable_shared_from_t * @retval RETCODE_OK when the annotation was applied successful. * @retval RETCODE_BAD_PARAMETER when there is an inconsistency. */ - virtual ReturnCode_t apply_annotation( + FASTDDS_EXPORTED_API virtual ReturnCode_t apply_annotation( traits::ref_type descriptor) = 0; /*! @@ -167,7 +170,7 @@ class FASTDDS_EXPORTED_API DynamicTypeBuilder : public std::enable_shared_from_t * @retval RETCODE_OK when the annotation was applied successful. * @retval RETCODE_BAD_PARAMETER when there is an inconsistency. */ - virtual ReturnCode_t apply_annotation_to_member( + FASTDDS_EXPORTED_API virtual ReturnCode_t apply_annotation_to_member( MemberId member_id, traits::ref_type descriptor) = 0; @@ -175,7 +178,7 @@ class FASTDDS_EXPORTED_API DynamicTypeBuilder : public std::enable_shared_from_t * Create an immutable DynamicType object containing a snapshot of this builder's current state. * @return @ref DynamicType reference. */ - virtual traits::ref_type build() = 0; + FASTDDS_EXPORTED_API virtual traits::ref_type build() = 0; protected: @@ -183,7 +186,7 @@ class FASTDDS_EXPORTED_API DynamicTypeBuilder : public std::enable_shared_from_t virtual ~DynamicTypeBuilder() = default; - traits::ref_type _this (); + traits::ref_type _this(); private: diff --git a/include/fastdds/dds/xtypes/dynamic_types/DynamicTypeBuilderFactory.hpp b/include/fastdds/dds/xtypes/dynamic_types/DynamicTypeBuilderFactory.hpp index f579b1c2ed8..9a9e6d440b0 100644 --- a/include/fastdds/dds/xtypes/dynamic_types/DynamicTypeBuilderFactory.hpp +++ b/include/fastdds/dds/xtypes/dynamic_types/DynamicTypeBuilderFactory.hpp @@ -32,31 +32,33 @@ namespace xtypes { class TypeObject; } // namespace xtypes -class FASTDDS_EXPORTED_API DynamicTypeBuilderFactory : public std::enable_shared_from_this +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. */ - static traits::ref_type get_instance(); + FASTDDS_EXPORTED_API static traits::ref_type get_instance(); /*! * Resets the singleton reference. * @return @ref ReturnCode_t - * @retval RETCODE_OK is always returned. * @retval RETCODE_BAD_PARAMETER if singleton reference is currently nil. + * @retval RETCODE_OK otherwise. */ - static ReturnCode_t delete_instance(); + 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. */ - virtual traits::ref_type get_primitive_type( + FASTDDS_EXPORTED_API virtual traits::ref_type get_primitive_type( TypeKind kind) = 0; /*! @@ -64,7 +66,7 @@ class FASTDDS_EXPORTED_API DynamicTypeBuilderFactory : public std::enable_shared * @param[in] descriptor @ref TypeDescriptor to be copied. * @return New @ref DynamicTypeBuilder reference. Nil reference returned in error case. */ - virtual traits::ref_type create_type( + FASTDDS_EXPORTED_API virtual traits::ref_type create_type( traits::ref_type descriptor) = 0; /*! @@ -72,7 +74,7 @@ class FASTDDS_EXPORTED_API DynamicTypeBuilderFactory : public std::enable_shared * @param[in] type @ref DynamicType reference to be used. * @return New @ref DynamicTypeBuilder reference. Nil reference returned in error case. */ - virtual traits::ref_type create_type_copy( + FASTDDS_EXPORTED_API virtual traits::ref_type create_type_copy( traits::ref_type type) = 0; /*! @@ -81,7 +83,7 @@ class FASTDDS_EXPORTED_API DynamicTypeBuilderFactory : public std::enable_shared * @param[in] type_object @ref TypeObject instance to be used. * @return New @ref DynamicTypeBuilder reference. Nil reference returned in error case. */ - virtual traits::ref_type create_type_w_type_object( + FASTDDS_EXPORTED_API virtual traits::ref_type create_type_w_type_object( const xtypes::TypeObject& type_object) = 0; /*! @@ -90,7 +92,7 @@ class FASTDDS_EXPORTED_API DynamicTypeBuilderFactory : public std::enable_shared * 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. */ - virtual traits::ref_type create_string_type( + FASTDDS_EXPORTED_API virtual traits::ref_type create_string_type( uint32_t bound) = 0; /*! @@ -99,7 +101,7 @@ class FASTDDS_EXPORTED_API DynamicTypeBuilderFactory : public std::enable_shared * 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. */ - virtual traits::ref_type create_wstring_type( + FASTDDS_EXPORTED_API virtual traits::ref_type create_wstring_type( uint32_t bound) = 0; /*! @@ -109,7 +111,7 @@ class FASTDDS_EXPORTED_API DynamicTypeBuilderFactory : public std::enable_shared * 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. */ - virtual traits::ref_type create_sequence_type( + FASTDDS_EXPORTED_API virtual traits::ref_type create_sequence_type( traits::ref_type element_type, uint32_t bound) = 0; @@ -119,7 +121,7 @@ class FASTDDS_EXPORTED_API DynamicTypeBuilderFactory : public std::enable_shared * @param[in] bounds `uint32_t` representing the desired dimensions. * @return new @ref DynamicTypeBuilder reference. Nil reference returned in error case. */ - virtual traits::ref_type create_array_type( + FASTDDS_EXPORTED_API virtual traits::ref_type create_array_type( traits::ref_type element_type, const BoundSeq& bound) = 0; @@ -131,7 +133,7 @@ class FASTDDS_EXPORTED_API DynamicTypeBuilderFactory : public std::enable_shared * 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. */ - virtual traits::ref_type create_map_type( + 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; @@ -141,7 +143,7 @@ class FASTDDS_EXPORTED_API DynamicTypeBuilderFactory : public std::enable_shared * @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. */ - virtual traits::ref_type create_bitmask_type( + FASTDDS_EXPORTED_API virtual traits::ref_type create_bitmask_type( uint32_t bound) = 0; /*! @@ -153,7 +155,7 @@ class FASTDDS_EXPORTED_API DynamicTypeBuilderFactory : public std::enable_shared * documents. * @return new @ref DynamicTypeBuilder reference. Nil reference returned in error case. */ - virtual traits::ref_type create_type_w_uri( + 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; @@ -167,7 +169,7 @@ class FASTDDS_EXPORTED_API DynamicTypeBuilderFactory : public std::enable_shared * documents. * @return new @ref DynamicTypeBuilder reference. Nil reference returned in error case. */ - virtual traits::ref_type create_type_w_document( + 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; @@ -178,7 +180,7 @@ class FASTDDS_EXPORTED_API DynamicTypeBuilderFactory : public std::enable_shared * @return standard ReturnCode_t * @retval RETCODE_OK is always returned. */ - virtual ReturnCode_t delete_type( + FASTDDS_EXPORTED_API virtual ReturnCode_t delete_type( traits::ref_type type) = 0; protected: @@ -187,7 +189,7 @@ class FASTDDS_EXPORTED_API DynamicTypeBuilderFactory : public std::enable_shared virtual ~DynamicTypeBuilderFactory() = default; - traits::ref_type _this (); + traits::ref_type _this(); private: diff --git a/include/fastdds/dds/xtypes/dynamic_types/DynamicTypeMember.hpp b/include/fastdds/dds/xtypes/dynamic_types/DynamicTypeMember.hpp index 6cb0597a7e6..ef4f5118526 100644 --- a/include/fastdds/dds/xtypes/dynamic_types/DynamicTypeMember.hpp +++ b/include/fastdds/dds/xtypes/dynamic_types/DynamicTypeMember.hpp @@ -33,7 +33,7 @@ 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 FASTDDS_EXPORTED_API DynamicTypeMember : public std::enable_shared_from_this +class DynamicTypeMember : public std::enable_shared_from_this { public: @@ -46,14 +46,14 @@ class FASTDDS_EXPORTED_API DynamicTypeMember : public std::enable_shared_from_th * @retval RETCODE_OK when the copy was successful. * @retval RETCODE_BAD_PARAMETER when descriptor reference is nil. */ - virtual ReturnCode_t get_descriptor( - traits::ref_type descriptor) = 0; + 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. */ - virtual uint32_t get_annotation_count() = 0; + FASTDDS_EXPORTED_API virtual uint32_t get_annotation_count() = 0; /*! * Returns an applied annotation by index. @@ -63,15 +63,15 @@ class FASTDDS_EXPORTED_API DynamicTypeMember : public std::enable_shared_from_th * @retval RETCODE_OK when the copy was successful. * @retval RETCODE_BAD_PARAMETER when descriptor reference is nil or index is out-of-range. */ - virtual ReturnCode_t get_annotation( - traits::ref_type descriptor, + 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. */ - virtual uint32_t get_verbatim_text_count() = 0; + FASTDDS_EXPORTED_API virtual uint32_t get_verbatim_text_count() = 0; /*! * Returns an applied verbatim text by index. @@ -81,8 +81,8 @@ class FASTDDS_EXPORTED_API DynamicTypeMember : public std::enable_shared_from_th * @retval RETCODE_OK when the copy was successful. * @retval RETCODE_BAD_PARAMETER when descriptor reference is nil or index is out-of-range. */ - virtual ReturnCode_t get_verbatim_text( - traits::ref_type descriptor, + FASTDDS_EXPORTED_API virtual ReturnCode_t get_verbatim_text( + traits::ref_type& descriptor, uint32_t idx) = 0; /** @@ -90,20 +90,20 @@ class FASTDDS_EXPORTED_API DynamicTypeMember : public std::enable_shared_from_th * @param[in] other @DynamicTypeMember reference to compare to * @return \b bool `true` on equality */ - virtual bool equals( + 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 */ - virtual MemberId get_id() = 0; + FASTDDS_EXPORTED_API virtual MemberId get_id() = 0; /** * Returns the name of this member. * @return Member name. */ - virtual ObjectName get_name() = 0; + FASTDDS_EXPORTED_API virtual ObjectName get_name() = 0; protected: @@ -111,7 +111,7 @@ class FASTDDS_EXPORTED_API DynamicTypeMember : public std::enable_shared_from_th virtual ~DynamicTypeMember() = default; - traits::ref_type _this (); + traits::ref_type _this(); private: diff --git a/include/fastdds/dds/xtypes/dynamic_types/MemberDescriptor.hpp b/include/fastdds/dds/xtypes/dynamic_types/MemberDescriptor.hpp index 73e00617516..a39a03fceb8 100644 --- a/include/fastdds/dds/xtypes/dynamic_types/MemberDescriptor.hpp +++ b/include/fastdds/dds/xtypes/dynamic_types/MemberDescriptor.hpp @@ -33,6 +33,8 @@ class FASTDDS_EXPORTED_API MemberDescriptor { public: + using _ref_type = typename traits::ref_type; + /*! * Returns the name of this member. * @return Member's name. @@ -127,13 +129,13 @@ class FASTDDS_EXPORTED_API MemberDescriptor * Returns the order of definition of the member. * @return Order of definition. */ - virtual uint32_t index() const = 0; + virtual uint32_t& index() = 0; /*! * Returns the order of definition of the member. * @return Order of definition. */ - virtual uint32_t& index() = 0; + virtual uint32_t index() const = 0; /*! * Returns the labels the member belongs to. diff --git a/include/fastdds/dds/xtypes/dynamic_types/TypeDescriptor.hpp b/include/fastdds/dds/xtypes/dynamic_types/TypeDescriptor.hpp index dad1ce3d706..f5512402c26 100644 --- a/include/fastdds/dds/xtypes/dynamic_types/TypeDescriptor.hpp +++ b/include/fastdds/dds/xtypes/dynamic_types/TypeDescriptor.hpp @@ -32,6 +32,8 @@ class FASTDDS_EXPORTED_API TypeDescriptor { public: + using _ref_type = typename traits::ref_type; + /*! * Returns the @ref TypeKind associated. * @return standard @ref TypeKind. diff --git a/include/fastdds/dds/xtypes/dynamic_types/Types.hpp b/include/fastdds/dds/xtypes/dynamic_types/Types.hpp index dcbee6badb9..544fa49427a 100644 --- a/include/fastdds/dds/xtypes/dynamic_types/Types.hpp +++ b/include/fastdds/dds/xtypes/dynamic_types/Types.hpp @@ -28,6 +28,22 @@ 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<> @@ -65,5 +81,3 @@ struct traits : public object_traits } // namespace eprosima #endif // _FASTDDS_DDS_XTYPES_DYNAMIC_TYPES_TYPES_HPP_ - - diff --git a/include/fastdds/dds/xtypes/dynamic_types/detail/type_traits.hpp b/include/fastdds/dds/xtypes/dynamic_types/detail/type_traits.hpp index 969ce2fbca1..d3b4dbddd39 100644 --- a/include/fastdds/dds/xtypes/dynamic_types/detail/type_traits.hpp +++ b/include/fastdds/dds/xtypes/dynamic_types/detail/type_traits.hpp @@ -17,6 +17,8 @@ #include +#include + namespace eprosima { namespace fastdds { namespace dds { @@ -35,6 +37,8 @@ struct traits return std::dynamic_pointer_cast<_Tp>(obj); } + FASTDDS_EXPORTED_API static std::shared_ptr make_shared(); + }; template diff --git a/include/fastdds/statistics/dds/domain/DomainParticipant.hpp b/include/fastdds/statistics/dds/domain/DomainParticipant.hpp index 68a398b3df5..e5ab3a6f559 100644 --- a/include/fastdds/statistics/dds/domain/DomainParticipant.hpp +++ b/include/fastdds/statistics/dds/domain/DomainParticipant.hpp @@ -26,7 +26,6 @@ #include #include #include -#include namespace eprosima { namespace fastrtps { @@ -65,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 eprosima::fastdds::dds::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); @@ -80,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 eprosima::fastdds::dds::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); @@ -92,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 eprosima::fastdds::dds::ReturnCode_t disable_statistics_datawriter( + FASTDDS_EXPORTED_API fastdds::dds::ReturnCode_t disable_statistics_datawriter( const std::string& topic_name); /** diff --git a/include/fastrtps/types/AnnotationDescriptor.h b/include/fastrtps/types/AnnotationDescriptor.h deleted file mode 100644 index 929db685684..00000000000 --- a/include/fastrtps/types/AnnotationDescriptor.h +++ /dev/null @@ -1,86 +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 - -#include -#include - -namespace eprosima { -namespace fastrtps { -namespace types { - -using ReturnCode_t = eprosima::fastdds::dds::ReturnCode_t; - -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/DynamicData.h b/include/fastrtps/types/DynamicData.h deleted file mode 100644 index 3197a7400ec..00000000000 --- a/include/fastrtps/types/DynamicData.h +++ /dev/null @@ -1,795 +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 -#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; - -using ReturnCode_t = eprosima::fastdds::dds::ReturnCode_t; -using octet = eprosima::fastrtps::rtps::octet; - -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 eprosima::fastdds::dds::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) != eprosima::fastdds::dds::RETCODE_OK) - { - throw eprosima::fastdds::dds::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) != eprosima::fastdds::dds::RETCODE_OK) - { - throw eprosima::fastdds::dds::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) != eprosima::fastdds::dds::RETCODE_OK) - { - throw eprosima::fastdds::dds::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) != eprosima::fastdds::dds::RETCODE_OK) - { - throw eprosima::fastdds::dds::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) != eprosima::fastdds::dds::RETCODE_OK) - { - throw eprosima::fastdds::dds::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) != eprosima::fastdds::dds::RETCODE_OK) - { - throw eprosima::fastdds::dds::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) != eprosima::fastdds::dds::RETCODE_OK) - { - throw eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; - } - return value; - } - - FASTDDS_EXPORTED_API float get_float32_value( - MemberId id) const - { - float value; - if (get_float32_value(value, id) != eprosima::fastdds::dds::RETCODE_OK) - { - throw eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; - } - return value; - } - - FASTDDS_EXPORTED_API double get_float64_value( - MemberId id) const - { - double value; - if (get_float64_value(value, id) != eprosima::fastdds::dds::RETCODE_OK) - { - throw eprosima::fastdds::dds::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) != eprosima::fastdds::dds::RETCODE_OK) - { - throw eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; - } - return value; - } - - FASTDDS_EXPORTED_API char get_char8_value( - MemberId id) const - { - char value; - if (get_char8_value(value, id) != eprosima::fastdds::dds::RETCODE_OK) - { - throw eprosima::fastdds::dds::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) != eprosima::fastdds::dds::RETCODE_OK) - { - throw eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; - } - return value; - } - - FASTDDS_EXPORTED_API octet get_byte_value( - MemberId id) const - { - octet value; - if (get_byte_value(value, id) != eprosima::fastdds::dds::RETCODE_OK) - { - throw eprosima::fastdds::dds::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) != eprosima::fastdds::dds::RETCODE_OK) - { - throw eprosima::fastdds::dds::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) != eprosima::fastdds::dds::RETCODE_OK) - { - throw eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; - } - return value; - } - - FASTDDS_EXPORTED_API bool get_bool_value( - MemberId id) const - { - bool value; - if (get_bool_value(value, id) != eprosima::fastdds::dds::RETCODE_OK) - { - throw eprosima::fastdds::dds::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) != eprosima::fastdds::dds::RETCODE_OK) - { - throw eprosima::fastdds::dds::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) != eprosima::fastdds::dds::RETCODE_OK) - { - throw eprosima::fastdds::dds::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) != eprosima::fastdds::dds::RETCODE_OK) - { - throw eprosima::fastdds::dds::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) != eprosima::fastdds::dds::RETCODE_OK) - { - throw eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; - } - return value; - } - - FASTDDS_EXPORTED_API uint64_t get_union_label() const - { - uint64_t value; - if (get_union_label(value) != eprosima::fastdds::dds::RETCODE_OK) - { - throw eprosima::fastdds::dds::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 08f06eeacb3..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 f50059abf60..00000000000 --- a/include/fastrtps/types/DynamicDataPtr.h +++ /dev/null @@ -1,66 +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 - -#include -#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 d0da615a3e7..00000000000 --- a/include/fastrtps/types/DynamicPubSubType.h +++ /dev/null @@ -1,108 +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 { - -using ReturnCode_t = eprosima::fastdds::dds::ReturnCode_t; - -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 249caa885c7..00000000000 --- a/include/fastrtps/types/DynamicType.h +++ /dev/null @@ -1,187 +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 - -#include -#include -#include -#include - -namespace eprosima { - -namespace fastdds { -namespace dds { -class DomainParticipantImpl; -} // namespace dds -} // namespace fastdds - -namespace fastrtps { -namespace types { - -using ReturnCode_t = eprosima::fastdds::dds::ReturnCode_t; - -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 b6512e3fc69..00000000000 --- a/include/fastrtps/types/DynamicTypeBuilder.h +++ /dev/null @@ -1,187 +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 -#include -#include - -namespace eprosima { -namespace fastrtps { -namespace types { - -class AnnotationDescriptor; -class TypeDescriptor; -class MemberDescriptor; -class DynamicType; -class DynamicTypeMember; - -using MemberId = eprosima::fastdds::dds::xtypes::MemberId; -using TypeKind = eprosima::fastdds::dds::xtypes::TypeKind; -using ReturnCode_t = eprosima::fastdds::dds::ReturnCode_t; - -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 085ab335bea..00000000000 --- a/include/fastrtps/types/DynamicTypeBuilderFactory.h +++ /dev/null @@ -1,322 +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 -#include - -//#define DISABLE_DYNAMIC_MEMORY_CHECK - -namespace eprosima { -namespace fastrtps { -namespace types { - -using AnnotationParameterValue = eprosima::fastdds::dds::xtypes::AnnotationParameterValue; -using AppliedAnnotationSeq = eprosima::fastdds::dds::xtypes::AppliedAnnotationSeq; -using ReturnCode_t = eprosima::fastdds::dds::ReturnCode_t; -using TypeIdentifier = eprosima::fastdds::dds::xtypes::TypeIdentifier; -using TypeObject = eprosima::fastdds::dds::xtypes::TypeObject; - -class AnnotationDescriptor; -class DynamicTypeBuilder; -class TypeDescriptor; -class MemberDescriptor; -class DynamicType; -class DynamicType_ptr; - -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 347c51fd204..00000000000 --- a/include/fastrtps/types/DynamicTypeBuilderPtr.h +++ /dev/null @@ -1,69 +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 - -#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 aa605072baf..00000000000 --- a/include/fastrtps/types/DynamicTypeMember.h +++ /dev/null @@ -1,104 +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 { - -using ReturnCode_t = eprosima::fastdds::dds::ReturnCode_t; - -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 9aeb83c4364..00000000000 --- a/include/fastrtps/types/DynamicTypePtr.h +++ /dev/null @@ -1,79 +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 - -#include -#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 58d69e39953..00000000000 --- a/include/fastrtps/types/MemberDescriptor.h +++ /dev/null @@ -1,226 +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 - -#include -#include -#include - -namespace eprosima { -namespace fastrtps { -namespace types { - -using ReturnCode_t = eprosima::fastdds::dds::ReturnCode_t; - -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 1a85381ab83..00000000000 --- a/include/fastrtps/types/TypeDescriptor.h +++ /dev/null @@ -1,169 +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 -#include -#include -#include - -class MemberDescriptor; -class DynamicType; - -namespace eprosima { -namespace fastrtps { -namespace types { - -using ReturnCode_t = eprosima::fastdds::dds::ReturnCode_t; - -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/TypesBase.h b/include/fastrtps/types/TypesBase.h deleted file mode 100644 index 9fd2da3bc05..00000000000 --- a/include/fastrtps/types/TypesBase.h +++ /dev/null @@ -1,96 +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 - -namespace eprosima { -namespace fastrtps { -namespace types { - -//! A special value indicating an unlimited quantity -constexpr uint32_t BOUND_UNLIMITED = 0; - -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_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"; - -typedef eprosima::fastrtps::rtps::octet TypeKind; - -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; - -} // 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/src/cpp/CMakeLists.txt b/src/cpp/CMakeLists.txt index 5221ee30b02..49f37f7d362 100644 --- a/src/cpp/CMakeLists.txt +++ b/src/cpp/CMakeLists.txt @@ -14,8 +14,10 @@ include(CheckCXXSourceCompiles) -# Set source files +add_subdirectory(fastdds/log) +add_subdirectory(fastdds/xtypes) +# Set source files if(WIN32) file(GLOB_RECURSE ALL_HEADERS @@ -31,25 +33,12 @@ endif(WIN32) file(GLOB DDSSQLFILTER_SOURCES fastdds/topic/DDSSQLFilter/*.cpp) + set(${PROJECT_NAME}_source_files ${ALL_HEADERS} ${DDSSQLFILTER_SOURCES} - dynamic-types/AnnotationDescriptor.cpp - dynamic-types/DynamicData.cpp - dynamic-types/DynamicDataFactory.cpp - dynamic-types/DynamicDataHelper.cpp - dynamic-types/DynamicDataPtr.cpp - dynamic-types/DynamicPubSubType.cpp - dynamic-types/DynamicType.cpp - dynamic-types/DynamicTypeBuilder.cpp - dynamic-types/DynamicTypeBuilderFactory.cpp - dynamic-types/DynamicTypeBuilderPtr.cpp - dynamic-types/DynamicTypeMember.cpp - dynamic-types/DynamicTypePtr.cpp - dynamic-types/MemberDescriptor.cpp - dynamic-types/TypeDescriptor.cpp fastdds/builtin/type_lookup_service/detail/rpc_typesPubSubTypes.cxx fastdds/builtin/type_lookup_service/detail/TypeLookupTypesPubSubTypes.cxx fastdds/builtin/type_lookup_service/TypeLookupManager.cpp @@ -471,13 +460,21 @@ else() endif() # Link library to external libraries. -target_link_libraries(${PROJECT_NAME} ${PRIVACY} fastcdr foonathan_memory +target_link_libraries(${PROJECT_NAME} + ${PRIVACY} + fastcdr + foonathan_memory ${CMAKE_THREAD_LIBS_INIT} ${CMAKE_DL_LIBS} ${TINYXML2_LIBRARY} $<$:OpenSSL::SSL$OpenSSL::Crypto$<$:$crypt32.lib>> $<$:iphlpapi$Shlwapi> ${THIRDPARTY_BOOST_LINK_LIBS} - PRIVATE eProsima_atomic + + PRIVATE + eProsima_atomic + fastdds::log + fastdds::xtypes::dynamic-types::impl + fastdds::xtypes::type-representation ) if(MSVC OR MSVC_IDE) diff --git a/src/cpp/dynamic-types/AnnotationDescriptor.cpp b/src/cpp/dynamic-types/AnnotationDescriptor.cpp deleted file mode 100644 index 23623225cf8..00000000000 --- a/src/cpp/dynamic-types/AnnotationDescriptor.cpp +++ /dev/null @@ -1,154 +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. - -#include -#include -#include -#include - -namespace eprosima { -namespace fastrtps { -namespace types { - -AnnotationDescriptor::AnnotationDescriptor() - : type_(nullptr) -{ -} - -AnnotationDescriptor::~AnnotationDescriptor() -{ - type_ = nullptr; -} - -AnnotationDescriptor::AnnotationDescriptor( - const AnnotationDescriptor* descriptor) -{ - copy_from(descriptor); -} - -AnnotationDescriptor::AnnotationDescriptor( - DynamicType_ptr pType) -{ - type_ = pType; -} - -ReturnCode_t AnnotationDescriptor::copy_from( - const AnnotationDescriptor* descriptor) -{ - if (descriptor != nullptr) - { - try - { - type_ = descriptor->type_; - value_ = descriptor->value_; - } - catch (std::exception& /*e*/) - { - return eprosima::fastdds::dds::RETCODE_ERROR; - } - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error copying AnnotationDescriptor, invalid input descriptor"); - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; - } - return eprosima::fastdds::dds::RETCODE_OK; -} - -bool AnnotationDescriptor::equals( - const AnnotationDescriptor* other) const -{ - if (other != nullptr && (type_ == other->type_ || (type_ != nullptr && type_->equals(other->type_.get())))) - { - if (value_.size() != other->value_.size()) - { - return false; - } - - for (auto it = value_.begin(); it != value_.end(); ++it) - { - auto it2 = other->value_.find(it->first); - if (it2 == other->value_.end() || it2->second != it->second) - { - return false; - } - } - } - return true; -} - -bool AnnotationDescriptor::key_annotation() const -{ - auto it = value_.find(ANNOTATION_KEY_ID); - if (it == value_.end()) - { - it = value_.find(ANNOTATION_EPKEY_ID); // Legacy "@Key" - } - return (it != value_.end() && it->second == CONST_TRUE); -} - -ReturnCode_t AnnotationDescriptor::get_value( - std::string& value) -{ - return get_value(value, "value"); -} - -ReturnCode_t AnnotationDescriptor::get_value( - std::string& value, - const std::string& key) -{ - auto it = value_.find(key); - if (it != value_.end()) - { - value = it->second; - return eprosima::fastdds::dds::RETCODE_OK; - } - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; -} - -ReturnCode_t AnnotationDescriptor::get_all_value( - std::map& value) const -{ - value = value_; - return eprosima::fastdds::dds::RETCODE_OK; -} - -bool AnnotationDescriptor::is_consistent() const -{ - if (type_ == nullptr || type_->get_kind() != eprosima::fastdds::dds::xtypes::TK_ANNOTATION) - { - return false; - } - - //TODO: Check consistency of value_ - return true; -} - -void AnnotationDescriptor::set_type( - DynamicType_ptr pType) -{ - type_ = pType; -} - -ReturnCode_t AnnotationDescriptor::set_value( - const std::string& key, - const std::string& value) -{ - value_[key] = value; - return eprosima::fastdds::dds::RETCODE_OK; -} - -} // namespace types -} // namespace fastrtps -} // namespace eprosima diff --git a/src/cpp/dynamic-types/DynamicData.cpp b/src/cpp/dynamic-types/DynamicData.cpp deleted file mode 100644 index 46199f2afbd..00000000000 --- a/src/cpp/dynamic-types/DynamicData.cpp +++ /dev/null @@ -1,6991 +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. -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -namespace eprosima { -namespace fastrtps { -namespace types { - -template -bool map_compare( - Map const& left, - Map const& right) -{ - auto pred = [](decltype(*left.begin()) a, decltype(a) b) - { - return a.first == b.first && a.second == b.second; - }; - - return left.size() == right.size() && std::equal(left.begin(), left.end(), right.begin(), pred); -} - -template <> -bool map_compare( - const std::map& left, - const std::map& right) -{ - auto pred = [](decltype(*left.begin()) a, decltype(a) b) - { - return a.first == b.first && a.second->equals(b.second); - }; - - return left.size() == right.size() && std::equal(left.begin(), left.end(), right.begin(), pred); -} - -DynamicData::DynamicData() - : type_(nullptr) -#ifdef DYNAMIC_TYPES_CHECKING - , int32_value_(0) - , uint32_value_(0) - , int16_value_(0) - , uint16_value_(0) - , int64_value_(0) - , uint64_value_(0) - , float32_value_(0.0f) - , float64_value_(0.0) - , float128_value_(0.0) - , char8_value_(0) - , char16_value_(0) - , byte_value_(0) - , bool_value_(false) -#endif // ifdef DYNAMIC_TYPES_CHECKING - , key_element_(false) - , default_array_value_(nullptr) - , union_label_(UINT64_MAX) - , union_id_(MEMBER_ID_INVALID) - , union_discriminator_(nullptr) -{ -} - -DynamicData::DynamicData( - DynamicType_ptr pType) - : type_(pType) -#ifdef DYNAMIC_TYPES_CHECKING - , int32_value_(0) - , uint32_value_(0) - , int16_value_(0) - , uint16_value_(0) - , int64_value_(0) - , uint64_value_(0) - , float32_value_(0.0f) - , float64_value_(0.0) - , float128_value_(0.0) - , char8_value_(0) - , char16_value_(0) - , byte_value_(0) - , bool_value_(false) -#endif // ifdef DYNAMIC_TYPES_CHECKING - , key_element_(false) - , default_array_value_(nullptr) - , union_label_(UINT64_MAX) - , union_id_(MEMBER_ID_INVALID) - , union_discriminator_(nullptr) -{ - create_members(type_); -} - -DynamicData::DynamicData( - const DynamicData* pData) - : type_(pData->type_) -#ifdef DYNAMIC_TYPES_CHECKING - , int32_value_(pData->int32_value_) - , uint32_value_(pData->uint32_value_) - , int16_value_(pData->int16_value_) - , uint16_value_(pData->uint16_value_) - , int64_value_(pData->int64_value_) - , uint64_value_(pData->uint64_value_) - , float32_value_(pData->float32_value_) - , float64_value_(pData->float64_value_) - , float128_value_(pData->float128_value_) - , char8_value_(pData->char8_value_) - , char16_value_(pData->char16_value_) - , byte_value_(pData->byte_value_) - , bool_value_(pData->bool_value_) - , string_value_(pData->string_value_) - , wstring_value_(pData->wstring_value_) -#endif // ifdef DYNAMIC_TYPES_CHECKING - , key_element_(pData->key_element_) - , default_array_value_(pData->default_array_value_) - , union_label_(pData->union_label_) - , union_id_(pData->union_id_) - , union_discriminator_(pData->union_discriminator_) -{ - create_members(pData); -} - -DynamicData::~DynamicData() -{ - clean(); -} - -void DynamicData::create_members( - const DynamicData* pData) -{ - for (auto it = pData->descriptors_.begin(); it != pData->descriptors_.end(); ++it) - { - descriptors_.insert(std::make_pair(it->first, new MemberDescriptor(it->second))); - } - -#ifdef DYNAMIC_TYPES_CHECKING - for (auto it = pData->complex_values_.begin(); it != pData->complex_values_.end(); ++it) - { - complex_values_.insert(std::make_pair(it->first, DynamicDataFactory::get_instance()->create_copy(it->second))); - } -#else - if (type_->is_complex_kind()) - { - for (auto it = pData->values_.begin(); it != pData->values_.end(); ++it) - { - values_.insert(std::make_pair(it->first, - DynamicDataFactory::get_instance()->create_copy((DynamicData*)it->second))); - } - } - else if (pData->descriptors_.size() > 0) - { - for (auto it = pData->descriptors_.begin(); it != pData->descriptors_.end(); ++it) - { - values_.insert(std::make_pair(it->first, pData->clone_value(it->first, it->second->get_kind()))); - } - } - else - { - values_.insert(std::make_pair(MEMBER_ID_INVALID, pData->clone_value(MEMBER_ID_INVALID, pData->get_kind()))); - } -#endif // ifdef DYNAMIC_TYPES_CHECKING -} - -void DynamicData::create_members( - DynamicType_ptr pType) -{ - std::map members; - if (pType->get_all_members(members) == eprosima::fastdds::dds::RETCODE_OK) - { - if (pType->is_complex_kind()) - { - // Bitmasks and enums register their members but only manages one value. - if (pType->get_kind() == eprosima::fastdds::dds::xtypes::TK_BITMASK || - pType->get_kind() == eprosima::fastdds::dds::xtypes::TK_ENUM) - { - add_value(pType->get_kind(), MEMBER_ID_INVALID); - } - - for (auto it = members.begin(); it != members.end(); ++it) - { - MemberDescriptor* newDescriptor = new MemberDescriptor(); - if (it->second->get_descriptor(newDescriptor) == eprosima::fastdds::dds::RETCODE_OK) - { - descriptors_.insert(std::make_pair(it->first, newDescriptor)); - if (pType->get_kind() != eprosima::fastdds::dds::xtypes::TK_BITMASK && - pType->get_kind() != eprosima::fastdds::dds::xtypes::TK_ENUM) - { - DynamicData* data = DynamicDataFactory::get_instance()->create_data(newDescriptor->type_); - if (newDescriptor->type_->get_kind() != eprosima::fastdds::dds::xtypes::TK_BITSET && - newDescriptor->type_->get_kind() != eprosima::fastdds::dds::xtypes::TK_STRUCTURE && - newDescriptor->type_->get_kind() != eprosima::fastdds::dds::xtypes::TK_UNION && - newDescriptor->type_->get_kind() != eprosima::fastdds::dds::xtypes::TK_SEQUENCE && - newDescriptor->type_->get_kind() != eprosima::fastdds::dds::xtypes::TK_ARRAY && - newDescriptor->type_->get_kind() != eprosima::fastdds::dds::xtypes::TK_MAP) - { - std::string def_value = newDescriptor->annotation_get_default(); - if (!def_value.empty()) - { - data->set_value(def_value); - } - } -#ifdef DYNAMIC_TYPES_CHECKING - complex_values_.insert(std::make_pair(it->first, data)); -#else - values_.insert(std::make_pair(it->first, data)); -#endif // ifdef DYNAMIC_TYPES_CHECKING - } - } - else - { - delete newDescriptor; - } - } - - // Set the default value for unions. - if (pType->get_kind() == eprosima::fastdds::dds::xtypes::TK_UNION) - { - bool defaultValue = false; - // Search the default value. - for (auto it = descriptors_.begin(); it != descriptors_.end(); ++it) - { - if (it->second->is_default_union_value()) - { - set_union_id(it->first); - defaultValue = true; - break; - } - } - - // If there isn't a default value... set the first element of the union - if (!defaultValue && descriptors_.size() > 0) - { - set_union_id(descriptors_.begin()->first); - } - } - } - else - { - add_value(pType->get_kind(), MEMBER_ID_INVALID); - } - } -} - -ReturnCode_t DynamicData::get_descriptor( - MemberDescriptor& value, - MemberId id) -{ - auto it = descriptors_.find(id); - if (it != descriptors_.end()) - { - value.copy_from(it->second); - return eprosima::fastdds::dds::RETCODE_OK; - } - else - { - EPROSIMA_LOG_WARNING(DYN_TYPES, "Error getting MemberDescriptor. MemberId not found."); - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; - } -} - -ReturnCode_t DynamicData::set_descriptor( - MemberId id, - const MemberDescriptor* value) -{ - if (descriptors_.find(id) == descriptors_.end()) - { - descriptors_.insert(std::make_pair(id, new MemberDescriptor(value))); - return eprosima::fastdds::dds::RETCODE_OK; - } - else - { - EPROSIMA_LOG_WARNING(DYN_TYPES, "Error setting MemberDescriptor. MemberId found."); - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; - } -} - -bool DynamicData::equals( - const DynamicData* other) const -{ - if (other != nullptr) - { - if (other == this) - { - return true; - } - else if (get_item_count() == other->get_item_count() && type_->equals(other->type_.get()) && - descriptors_.size() == other->descriptors_.size()) - { - for (auto it = descriptors_.begin(); it != descriptors_.end(); ++it) - { - auto otherDescIt = other->descriptors_.find(it->first); - if (otherDescIt == other->descriptors_.end() || !it->second->equals(otherDescIt->second)) - { - return false; - } - } - - // Optimization for unions, only check the selected element. - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_UNION) - { - if (union_id_ != other->union_id_) - { - return false; - } - else if (union_id_ != MEMBER_ID_INVALID) - { -#ifdef DYNAMIC_TYPES_CHECKING - auto it = complex_values_.find(union_id_); - auto otherIt = other->complex_values_.find(union_id_); -#else - auto it = values_.find(union_id_); - auto otherIt = other->values_.find(union_id_); -#endif // ifdef DYNAMIC_TYPES_CHECKING - if (!((DynamicData*)it->second)->equals((DynamicData*)otherIt->second)) - { - return false; - } - } - } - else - { -#ifdef DYNAMIC_TYPES_CHECKING - bool bFail = false; - bFail = int32_value_ != other->int32_value_; - bFail = bFail || uint32_value_ != other->uint32_value_; - bFail = bFail || int16_value_ != other->int16_value_; - bFail = bFail || uint16_value_ != other->uint16_value_; - bFail = bFail || int64_value_ != other->int64_value_; - bFail = bFail || uint64_value_ != other->uint64_value_; - bFail = bFail || float32_value_ != other->float32_value_; - bFail = bFail || float64_value_ != other->float64_value_; - bFail = bFail || float128_value_ != other->float128_value_; - bFail = bFail || char8_value_ != other->char8_value_; - bFail = bFail || char16_value_ != other->char16_value_; - bFail = bFail || byte_value_ != other->byte_value_; - bFail = bFail || bool_value_ != other->bool_value_; - bFail = bFail || string_value_ != other->string_value_; - bFail = bFail || wstring_value_ != other->wstring_value_; - bFail = bFail || !map_compare(complex_values_, other->complex_values_); - /*if (int32_value_ != other->int32_value_ || uint32_value_ != other->uint32_value_ || - int16_value_ != other->int16_value_ || uint16_value_ != other->uint16_value_ || - int64_value_ != other->int64_value_ || uint64_value_ != other->uint64_value_ || - float32_value_ != other->float32_value_ || float64_value_ != other->float64_value_ || - float128_value_ != other->float128_value_ || char8_value_ != other->char8_value_ || - char16_value_ != other->char16_value_ || byte_value_ != other->byte_value_ || - bool_value_ != other->bool_value_ || string_value_ != other->string_value_ || - wstring_value_ != other->wstring_value_ || - !map_compare(complex_values_, other->complex_values_)) - */ - if (bFail) - { - return false; - } -#else - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_ENUM) - { - if (!compare_values(eprosima::fastdds::dds::xtypes::TK_UINT32, values_.begin()->second, - other->values_.begin()->second)) - { - return false; - } - } - else if (get_kind() == eprosima::fastdds::dds::xtypes::TK_BITMASK) - { - TypeKind bitmask_kind = eprosima::fastdds::dds::xtypes::TK_BYTE; - size_t type_size = type_->get_size(); - switch (type_size) - { - case 1: bitmask_kind = eprosima::fastdds::dds::xtypes::TK_BYTE; break; - case 2: bitmask_kind = eprosima::fastdds::dds::xtypes::TK_UINT16; break; - case 4: bitmask_kind = eprosima::fastdds::dds::xtypes::TK_UINT32; break; - case 8: bitmask_kind = eprosima::fastdds::dds::xtypes::TK_UINT64; break; - } - if (!compare_values(bitmask_kind, values_.begin()->second, other->values_.begin()->second)) - { - return false; - } - } - else if (type_->is_complex_kind()) - { - for (auto it = descriptors_.begin(); it != descriptors_.end(); ++it) - { - auto currentIt = values_.find(it->first); - auto otherIt = other->values_.find(it->first); - if (!((DynamicData*)currentIt->second)->equals(((DynamicData*)otherIt->second))) - { - return false; - } - } - } - else if (descriptors_.size() > 0) - { - for (auto it = descriptors_.begin(); it != descriptors_.end(); ++it) - { - auto currentIt = values_.find(it->first); - auto otherIt = other->values_.find(it->first); - if (!compare_values(it->second->get_kind(), currentIt->second, otherIt->second)) - { - return false; - } - } - } - else - { - if (!compare_values(get_kind(), values_.begin()->second, other->values_.begin()->second)) - { - return false; - } - } -#endif // ifdef DYNAMIC_TYPES_CHECKING - } - return true; - } - } - return false; -} - -MemberId DynamicData::get_member_id_by_name( - const std::string& name) const -{ - for (auto it = descriptors_.begin(); it != descriptors_.end(); ++it) - { - if (it->second->get_name() == name) - { - return it->first; - } - } - return MEMBER_ID_INVALID; -} - -MemberId DynamicData::get_member_id_at_index( - uint32_t index) const -{ - for (auto it = descriptors_.begin(); it != descriptors_.end(); ++it) - { - if (it->second->get_index() == index) - { - return it->first; - } - } - return MEMBER_ID_INVALID; -} - -TypeKind DynamicData::get_kind() const -{ - return type_->get_kind(); -} - -uint32_t DynamicData::get_item_count() const -{ - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_MAP) - { -#ifdef DYNAMIC_TYPES_CHECKING - return static_cast(complex_values_.size() / 2); -#else - return static_cast(values_.size() / 2); -#endif // ifdef DYNAMIC_TYPES_CHECKING - } - else if (get_kind() == eprosima::fastdds::dds::xtypes::TK_ARRAY) - { - return type_->get_total_bounds(); - } - else - { -#ifdef DYNAMIC_TYPES_CHECKING - return static_cast(complex_values_.size()); -#else - return static_cast(values_.size()); -#endif // ifdef DYNAMIC_TYPES_CHECKING - } -} - -std::string DynamicData::get_name() -{ - return type_->get_name(); -} - -void DynamicData::add_value( - TypeKind kind, - MemberId id) -{ - switch (kind) - { - default: - break; - case eprosima::fastdds::dds::xtypes::TK_INT32: - { -#ifndef DYNAMIC_TYPES_CHECKING - values_.insert(std::make_pair(id, new int32_t())); -#endif // ifndef DYNAMIC_TYPES_CHECKING - } - break; - case eprosima::fastdds::dds::xtypes::TK_UINT32: - { -#ifndef DYNAMIC_TYPES_CHECKING - values_.insert(std::make_pair(id, new uint32_t())); -#endif // ifndef DYNAMIC_TYPES_CHECKING - } - break; - case eprosima::fastdds::dds::xtypes::TK_INT16: - { -#ifndef DYNAMIC_TYPES_CHECKING - values_.insert(std::make_pair(id, new int16_t())); -#endif // ifndef DYNAMIC_TYPES_CHECKING - } - break; - case eprosima::fastdds::dds::xtypes::TK_UINT16: - { -#ifndef DYNAMIC_TYPES_CHECKING - values_.insert(std::make_pair(id, new uint16_t())); -#endif // ifndef DYNAMIC_TYPES_CHECKING - } - break; - case eprosima::fastdds::dds::xtypes::TK_INT64: - { -#ifndef DYNAMIC_TYPES_CHECKING - values_.insert(std::make_pair(id, new int64_t())); -#endif // ifndef DYNAMIC_TYPES_CHECKING - } - break; - case eprosima::fastdds::dds::xtypes::TK_UINT64: - { -#ifndef DYNAMIC_TYPES_CHECKING - values_.insert(std::make_pair(id, new uint64_t())); -#endif // ifndef DYNAMIC_TYPES_CHECKING - } - break; - case eprosima::fastdds::dds::xtypes::TK_FLOAT32: - { -#ifndef DYNAMIC_TYPES_CHECKING - values_.insert(std::make_pair(id, new float())); -#endif // ifndef DYNAMIC_TYPES_CHECKING - } - break; - case eprosima::fastdds::dds::xtypes::TK_FLOAT64: - { -#ifndef DYNAMIC_TYPES_CHECKING - values_.insert(std::make_pair(id, new double())); -#endif // ifndef DYNAMIC_TYPES_CHECKING - } - break; - case eprosima::fastdds::dds::xtypes::TK_FLOAT128: - { -#ifndef DYNAMIC_TYPES_CHECKING - values_.insert(std::make_pair(id, new long double())); -#endif // ifndef DYNAMIC_TYPES_CHECKING - } - break; - case eprosima::fastdds::dds::xtypes::TK_CHAR8: - { -#ifndef DYNAMIC_TYPES_CHECKING - values_.insert(std::make_pair(id, new char())); -#endif // ifndef DYNAMIC_TYPES_CHECKING - } - break; - case eprosima::fastdds::dds::xtypes::TK_CHAR16: - { -#ifndef DYNAMIC_TYPES_CHECKING - values_.insert(std::make_pair(id, new wchar_t())); -#endif // ifndef DYNAMIC_TYPES_CHECKING - } - break; - case eprosima::fastdds::dds::xtypes::TK_BOOLEAN: - { -#ifndef DYNAMIC_TYPES_CHECKING - values_.insert(std::make_pair(id, new bool())); -#endif // ifndef DYNAMIC_TYPES_CHECKING - } - break; - case eprosima::fastdds::dds::xtypes::TK_BYTE: - { -#ifndef DYNAMIC_TYPES_CHECKING - values_.insert(std::make_pair(id, new octet())); -#endif // ifndef DYNAMIC_TYPES_CHECKING - } - break; - case eprosima::fastdds::dds::xtypes::TK_STRING8: - { -#ifndef DYNAMIC_TYPES_CHECKING - values_.insert(std::make_pair(id, new std::string())); -#endif // ifndef DYNAMIC_TYPES_CHECKING - } - break; - case eprosima::fastdds::dds::xtypes::TK_STRING16: - { -#ifndef DYNAMIC_TYPES_CHECKING - values_.insert(std::make_pair(id, new std::wstring())); -#endif // ifndef DYNAMIC_TYPES_CHECKING - } - break; - case eprosima::fastdds::dds::xtypes::TK_ENUM: - { -#ifndef DYNAMIC_TYPES_CHECKING - values_.insert(std::make_pair(id, new uint32_t())); -#endif // ifndef DYNAMIC_TYPES_CHECKING - } - break; - case eprosima::fastdds::dds::xtypes::TK_BITMASK: - { -#ifndef DYNAMIC_TYPES_CHECKING - values_.insert(std::make_pair(id, new uint64_t())); -#endif // ifndef DYNAMIC_TYPES_CHECKING - } - } - set_default_value(id); -} - -void DynamicData::clean() -{ - if (default_array_value_ != nullptr) - { - DynamicDataFactory::get_instance()->delete_data(default_array_value_); - default_array_value_ = nullptr; - } - - if (union_discriminator_ != nullptr) - { - DynamicDataFactory::get_instance()->delete_data(union_discriminator_); - union_discriminator_ = nullptr; - } - - clean_members(); - - type_ = nullptr; - - for (auto it = descriptors_.begin(); it != descriptors_.end(); ++it) - { - delete it->second; - } - descriptors_.clear(); -} - -ReturnCode_t DynamicData::clear_all_values() -{ - if (type_->is_complex_kind()) - { - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_SEQUENCE || - get_kind() == eprosima::fastdds::dds::xtypes::TK_MAP || - get_kind() == eprosima::fastdds::dds::xtypes::TK_ARRAY) - { - return clear_data(); - } - else - { - for (auto it = descriptors_.begin(); it != descriptors_.end(); ++it) - { -#ifdef DYNAMIC_TYPES_CHECKING - auto itValue = complex_values_.find(it->first); - if (itValue != complex_values_.end()) - { - itValue->second->clear_all_values(); - } -#else - auto itValue = values_.find(it->first); - if (itValue != values_.end()) - { - ((DynamicData*)itValue->second)->clear_all_values(); - } -#endif // ifdef DYNAMIC_TYPES_CHECKING - } - } - } - else - { - set_default_value(MEMBER_ID_INVALID); - } - return eprosima::fastdds::dds::RETCODE_OK; -} - -void DynamicData::clean_members() -{ -#ifdef DYNAMIC_TYPES_CHECKING - for (auto it = complex_values_.begin(); it != complex_values_.end(); ++it) - { - DynamicDataFactory::get_instance()->delete_data(it->second); - } - complex_values_.clear(); -#else - if (type_->has_children()) - { - for (auto it = values_.begin(); it != values_.end(); ++it) - { - DynamicDataFactory::get_instance()->delete_data((DynamicData*)it->second); - } - } - else - { - switch (get_kind()) - { - default: - break; - case eprosima::fastdds::dds::xtypes::TK_INT32: - { -#ifndef DYNAMIC_TYPES_CHECKING - auto it = values_.begin(); - delete ((int32_t*)it->second); -#endif // ifndef DYNAMIC_TYPES_CHECKING - break; - } - case eprosima::fastdds::dds::xtypes::TK_UINT32: - { -#ifndef DYNAMIC_TYPES_CHECKING - auto it = values_.begin(); - delete ((uint32_t*)it->second); -#endif // ifndef DYNAMIC_TYPES_CHECKING - break; - } - case eprosima::fastdds::dds::xtypes::TK_INT16: - { -#ifndef DYNAMIC_TYPES_CHECKING - auto it = values_.begin(); - delete ((int16_t*)it->second); -#endif // ifndef DYNAMIC_TYPES_CHECKING - break; - } - case eprosima::fastdds::dds::xtypes::TK_UINT16: - { -#ifndef DYNAMIC_TYPES_CHECKING - auto it = values_.begin(); - delete ((uint16_t*)it->second); -#endif // ifndef DYNAMIC_TYPES_CHECKING - break; - } - case eprosima::fastdds::dds::xtypes::TK_INT64: - { -#ifndef DYNAMIC_TYPES_CHECKING - auto it = values_.begin(); - delete ((int64_t*)it->second); -#endif // ifndef DYNAMIC_TYPES_CHECKING - break; - } - case eprosima::fastdds::dds::xtypes::TK_UINT64: - { -#ifndef DYNAMIC_TYPES_CHECKING - auto it = values_.begin(); - delete ((uint64_t*)it->second); -#endif // ifndef DYNAMIC_TYPES_CHECKING - break; - } - case eprosima::fastdds::dds::xtypes::TK_FLOAT32: - { -#ifndef DYNAMIC_TYPES_CHECKING - auto it = values_.begin(); - delete ((float*)it->second); -#endif // ifndef DYNAMIC_TYPES_CHECKING - break; - } - case eprosima::fastdds::dds::xtypes::TK_FLOAT64: - { -#ifndef DYNAMIC_TYPES_CHECKING - auto it = values_.begin(); - delete ((double*)it->second); -#endif // ifndef DYNAMIC_TYPES_CHECKING - break; - } - case eprosima::fastdds::dds::xtypes::TK_FLOAT128: - { -#ifndef DYNAMIC_TYPES_CHECKING - auto it = values_.begin(); - delete ((long double*)it->second); -#endif // ifndef DYNAMIC_TYPES_CHECKING - break; - } - case eprosima::fastdds::dds::xtypes::TK_CHAR8: - { -#ifndef DYNAMIC_TYPES_CHECKING - auto it = values_.begin(); - delete ((char*)it->second); -#endif // ifndef DYNAMIC_TYPES_CHECKING - break; - } - case eprosima::fastdds::dds::xtypes::TK_CHAR16: - { -#ifndef DYNAMIC_TYPES_CHECKING - auto it = values_.begin(); - delete ((wchar_t*)it->second); -#endif // ifndef DYNAMIC_TYPES_CHECKING - break; - } - case eprosima::fastdds::dds::xtypes::TK_BOOLEAN: - { -#ifndef DYNAMIC_TYPES_CHECKING - auto it = values_.begin(); - delete ((bool*)it->second); -#endif // ifndef DYNAMIC_TYPES_CHECKING - break; - } - case eprosima::fastdds::dds::xtypes::TK_BYTE: - { -#ifndef DYNAMIC_TYPES_CHECKING - auto it = values_.begin(); - delete ((octet*)it->second); -#endif // ifndef DYNAMIC_TYPES_CHECKING - break; - } - case eprosima::fastdds::dds::xtypes::TK_STRING8: - { -#ifndef DYNAMIC_TYPES_CHECKING - auto it = values_.begin(); - delete ((std::string*)it->second); -#endif // ifndef DYNAMIC_TYPES_CHECKING - break; - } - case eprosima::fastdds::dds::xtypes::TK_STRING16: - { -#ifndef DYNAMIC_TYPES_CHECKING - auto it = values_.begin(); - delete ((std::wstring*)it->second); -#endif // ifndef DYNAMIC_TYPES_CHECKING - break; - } - case eprosima::fastdds::dds::xtypes::TK_ENUM: - { -#ifndef DYNAMIC_TYPES_CHECKING - auto it = values_.begin(); - delete ((uint32_t*)it->second); -#endif // ifndef DYNAMIC_TYPES_CHECKING - break; - } - case eprosima::fastdds::dds::xtypes::TK_BITMASK: - { -#ifndef DYNAMIC_TYPES_CHECKING - auto it = values_.begin(); - delete ((uint64_t*)it->second); -#endif // ifndef DYNAMIC_TYPES_CHECKING - break; - } - case eprosima::fastdds::dds::xtypes::TK_UNION: - case eprosima::fastdds::dds::xtypes::TK_STRUCTURE: - case eprosima::fastdds::dds::xtypes::TK_ARRAY: - case eprosima::fastdds::dds::xtypes::TK_SEQUENCE: - case eprosima::fastdds::dds::xtypes::TK_MAP: - case eprosima::fastdds::dds::xtypes::TK_ALIAS: - case eprosima::fastdds::dds::xtypes::TK_BITSET: - { - break; - } - } - } - values_.clear(); -#endif // ifdef DYNAMIC_TYPES_CHECKING -} - -ReturnCode_t DynamicData::clear_nonkey_values() -{ - if (type_->is_complex_kind()) - { - for (auto it = descriptors_.begin(); it != descriptors_.end(); ++it) - { -#ifdef DYNAMIC_TYPES_CHECKING - auto itValue = complex_values_.find(it->first); - if (itValue != complex_values_.end()) - { - itValue->second->clear_nonkey_values(); - } -#else - auto itValue = values_.find(it->first); - if (itValue != values_.end()) - { - ((DynamicData*)itValue->second)->clear_nonkey_values(); - } -#endif // ifdef DYNAMIC_TYPES_CHECKING - } - } - else - { - if (!key_element_) - { - set_default_value(MEMBER_ID_INVALID); - } - } - return eprosima::fastdds::dds::RETCODE_OK; -} - -ReturnCode_t DynamicData::clear_value( - MemberId id) -{ - auto it = descriptors_.find(id); - if (it != descriptors_.end()) - { - if (type_->is_complex_kind()) - { -#ifdef DYNAMIC_TYPES_CHECKING - auto itValue = complex_values_.find(it->first); - if (itValue != complex_values_.end()) - { - itValue->second->clear_all_values(); - } -#else - auto itValue = values_.find(it->first); - if (itValue != values_.end()) - { - ((DynamicData*)itValue->second)->clear_all_values(); - } -#endif // ifdef DYNAMIC_TYPES_CHECKING - } - else - { - set_default_value(id); - } - } - else - { - set_default_value(id); - } - return eprosima::fastdds::dds::RETCODE_OK; -} - -void* DynamicData::clone_value( - MemberId id, - TypeKind kind) const -{ - switch (kind) - { - default: - break; - case eprosima::fastdds::dds::xtypes::TK_INT32: - { - int32_t* newInt32 = new int32_t(); - get_int32_value(*newInt32, id); - return newInt32; - } - break; - case eprosima::fastdds::dds::xtypes::TK_UINT32: - { - uint32_t* newUInt32 = new uint32_t(); - get_uint32_value(*newUInt32, id); - return newUInt32; - } - break; - case eprosima::fastdds::dds::xtypes::TK_INT16: - { - int16_t* newInt16 = new int16_t(); - get_int16_value(*newInt16, id); - return newInt16; - } - break; - case eprosima::fastdds::dds::xtypes::TK_UINT16: - { - uint16_t* newUInt16 = new uint16_t(); - get_uint16_value(*newUInt16, id); - return newUInt16; - } - break; - case eprosima::fastdds::dds::xtypes::TK_INT64: - { - int64_t* newInt64 = new int64_t(); - get_int64_value(*newInt64, id); - return newInt64; - } - break; - case eprosima::fastdds::dds::xtypes::TK_UINT64: - { - uint64_t* newUInt64 = new uint64_t(); - get_uint64_value(*newUInt64, id); - return newUInt64; - } - break; - case eprosima::fastdds::dds::xtypes::TK_FLOAT32: - { - float* newFloat32 = new float(); - get_float32_value(*newFloat32, id); - return newFloat32; - } - break; - case eprosima::fastdds::dds::xtypes::TK_FLOAT64: - { - double* newFloat64 = new double(); - get_float64_value(*newFloat64, id); - return newFloat64; - } - break; - case eprosima::fastdds::dds::xtypes::TK_FLOAT128: - { - long double* newFloat128 = new long double(); - get_float128_value(*newFloat128, id); - return newFloat128; - } - break; - case eprosima::fastdds::dds::xtypes::TK_CHAR8: - { - char* newChar8 = new char(); - get_char8_value(*newChar8, id); - return newChar8; - } - break; - case eprosima::fastdds::dds::xtypes::TK_CHAR16: - { - wchar_t* newChar16 = new wchar_t(); - get_char16_value(*newChar16, id); - return newChar16; - } - break; - case eprosima::fastdds::dds::xtypes::TK_BOOLEAN: - { - bool* newBool = new bool(); - get_bool_value(*newBool, id); - return newBool; - } - break; - case eprosima::fastdds::dds::xtypes::TK_BYTE: - { - octet* newByte = new octet(); - get_byte_value(*newByte, id); - return newByte; - } - break; - case eprosima::fastdds::dds::xtypes::TK_STRING8: - { - std::string* newString = new std::string(); - get_string_value(*newString, id); - return newString; - } - break; - case eprosima::fastdds::dds::xtypes::TK_STRING16: - { - std::wstring* newString = new std::wstring(); - get_wstring_value(*newString, id); - return newString; - } - break; - case eprosima::fastdds::dds::xtypes::TK_ENUM: - { - uint32_t* newUInt32 = new uint32_t(); - get_enum_value(*newUInt32, id); - return newUInt32; - } - break; - case eprosima::fastdds::dds::xtypes::TK_BITMASK: - { - uint64_t* newBitset = new uint64_t(); - get_uint64_value(*newBitset, id); - return newBitset; - } - } - return nullptr; -} - -bool DynamicData::compare_values( - TypeKind kind, - void* left, - void* right) const -{ - switch (kind) - { - default: - break; - case eprosima::fastdds::dds::xtypes::TK_INT32: { - return *((int32_t*)left) == *((int32_t*)right); - } - case eprosima::fastdds::dds::xtypes::TK_UINT32: { - return *((uint32_t*)left) == *((uint32_t*)right); - } - case eprosima::fastdds::dds::xtypes::TK_INT16: { - return *((int16_t*)left) == *((int16_t*)right); - } - case eprosima::fastdds::dds::xtypes::TK_UINT16: { - return *((uint16_t*)left) == *((uint16_t*)right); - } - case eprosima::fastdds::dds::xtypes::TK_INT64: { - return *((int64_t*)left) == *((int64_t*)right); - } - case eprosima::fastdds::dds::xtypes::TK_UINT64: { - return *((uint64_t*)left) == *((uint64_t*)right); - } - case eprosima::fastdds::dds::xtypes::TK_FLOAT32: { - return *((float*)left) == *((float*)right); - } - case eprosima::fastdds::dds::xtypes::TK_FLOAT64: { - return *((double*)left) == *((double*)right); - } - case eprosima::fastdds::dds::xtypes::TK_FLOAT128: { - return *((long double*)left) == *((long double*)right); - } - case eprosima::fastdds::dds::xtypes::TK_CHAR8: { - return *((char*)left) == *((char*)right); - } - case eprosima::fastdds::dds::xtypes::TK_CHAR16: { - return *((wchar_t*)left) == *((wchar_t*)right); - } - case eprosima::fastdds::dds::xtypes::TK_BOOLEAN: { - return *((bool*)left) == *((bool*)right); - } - case eprosima::fastdds::dds::xtypes::TK_BYTE: { - return *((octet*)left) == *((octet*)right); - } - case eprosima::fastdds::dds::xtypes::TK_STRING8: { - return *((std::string*)left) == *((std::string*)right); - } - case eprosima::fastdds::dds::xtypes::TK_STRING16: { - return *((std::wstring*)left) == *((std::wstring*)right); - } - case eprosima::fastdds::dds::xtypes::TK_ENUM: { - return *((uint32_t*)left) == *((uint32_t*)right); - } - } - return false; -} - -void DynamicData::get_value( - std::string& sOutValue, - MemberId id /*= MEMBER_ID_INVALID*/) const -{ - switch (type_->kind_) - { - default: - break; - case eprosima::fastdds::dds::xtypes::TK_INT32: - { - int32_t value(0); - get_int32_value(value, id); - sOutValue = std::to_string(value); - } - break; - case eprosima::fastdds::dds::xtypes::TK_UINT32: - { - uint32_t value(0); - get_uint32_value(value, id); - sOutValue = std::to_string(value); - } - break; - case eprosima::fastdds::dds::xtypes::TK_INT16: - { - int16_t value(0); - get_int16_value(value, id); - sOutValue = std::to_string(value); - } - break; - case eprosima::fastdds::dds::xtypes::TK_UINT16: - { - uint16_t value(0); - get_uint16_value(value, id); - sOutValue = std::to_string(value); - } - break; - case eprosima::fastdds::dds::xtypes::TK_INT64: - { - int64_t value(0); - get_int64_value(value, id); - sOutValue = std::to_string(value); - } - break; - case eprosima::fastdds::dds::xtypes::TK_UINT64: - { - uint64_t value(0); - get_uint64_value(value, id); - sOutValue = std::to_string(value); - } - break; - case eprosima::fastdds::dds::xtypes::TK_FLOAT32: - { - float value(0.0f); - get_float32_value(value, id); - sOutValue = std::to_string(value); - } - break; - case eprosima::fastdds::dds::xtypes::TK_FLOAT64: - { - double value(0.0f); - get_float64_value(value, id); - sOutValue = std::to_string(value); - } - break; - case eprosima::fastdds::dds::xtypes::TK_FLOAT128: - { - long double value(0.0f); - get_float128_value(value, id); - sOutValue = std::to_string(value); - } - break; - case eprosima::fastdds::dds::xtypes::TK_CHAR8: - { - char value = 0; - get_char8_value(value, id); - sOutValue = value; - } - break; - case eprosima::fastdds::dds::xtypes::TK_CHAR16: - { - wchar_t value(0); - get_char16_value(value, id); - std::wstring temp = L""; - temp += value; - sOutValue = wstring_to_bytes(temp); - } - break; - case eprosima::fastdds::dds::xtypes::TK_BOOLEAN: - { - bool value(false); - get_bool_value(value, id); - sOutValue = std::to_string(value ? 1 : 0); - } - break; - case eprosima::fastdds::dds::xtypes::TK_BYTE: - { - uint8_t value(0); - get_byte_value(value, id); - sOutValue = std::to_string(value); - } - break; - case eprosima::fastdds::dds::xtypes::TK_STRING8: - { - sOutValue = get_string_value(id); - } - break; - case eprosima::fastdds::dds::xtypes::TK_STRING16: - { - std::wstring value; - get_wstring_value(value, id); - sOutValue = wstring_to_bytes(value); - } - break; - case eprosima::fastdds::dds::xtypes::TK_ENUM: - { - uint32_t value; - get_enum_value(value, id); - sOutValue = std::to_string(value); - } - break; - case eprosima::fastdds::dds::xtypes::TK_BITMASK: - { - uint64_t value(0); - get_uint64_value(value, id); - sOutValue = std::to_string(value); - } - break; - case eprosima::fastdds::dds::xtypes::TK_ARRAY: - case eprosima::fastdds::dds::xtypes::TK_SEQUENCE: - case eprosima::fastdds::dds::xtypes::TK_BITSET: - case eprosima::fastdds::dds::xtypes::TK_MAP: - { - // THESE TYPES DON'T MANAGE VALUES - } - break; - } -} - -void DynamicData::set_value( - const std::string& sValue, - MemberId id /*= MEMBER_ID_INVALID*/) -{ - switch (type_->kind_) - { - default: - break; - case eprosima::fastdds::dds::xtypes::TK_INT32: - { - int32_t value(0); - try - { - value = stoi(sValue); - } - catch (...) - { - } - set_int32_value(value, id); - } - break; - case eprosima::fastdds::dds::xtypes::TK_UINT32: - { - uint32_t value(0); - try - { - value = stoul(sValue); - } - catch (...) - { - } - set_uint32_value(value, id); - } - break; - case eprosima::fastdds::dds::xtypes::TK_INT16: - { - int16_t value(0); - try - { - value = static_cast(stoi(sValue)); - } - catch (...) - { - } - set_int16_value(value, id); - } - break; - case eprosima::fastdds::dds::xtypes::TK_UINT16: - { - uint16_t value(0); - try - { - value = static_cast(stoul(sValue)); - } - catch (...) - { - } - set_uint16_value(value, id); - } - break; - case eprosima::fastdds::dds::xtypes::TK_INT64: - { - int64_t value(0); - try - { - value = stoll(sValue); - } - catch (...) - { - } - set_int64_value(value, id); - } - break; - case eprosima::fastdds::dds::xtypes::TK_UINT64: - { - uint64_t value(0); - try - { - value = stoul(sValue); - } - catch (...) - { - } - set_uint64_value(value, id); - } - break; - case eprosima::fastdds::dds::xtypes::TK_FLOAT32: - { - float value(0.0f); - try - { - value = stof(sValue); - } - catch (...) - { - } - set_float32_value(value, id); - } - break; - case eprosima::fastdds::dds::xtypes::TK_FLOAT64: - { - double value(0.0f); - try - { - value = stod(sValue); - } - catch (...) - { - } - set_float64_value(value, id); - } - break; - case eprosima::fastdds::dds::xtypes::TK_FLOAT128: - { - long double value(0.0f); - try - { - value = stold(sValue); - } - catch (...) - { - } - set_float128_value(value, id); - } - break; - case eprosima::fastdds::dds::xtypes::TK_CHAR8: - { - if (sValue.length() >= 1) - { - set_char8_value(sValue[0], id); - } - } - break; - case eprosima::fastdds::dds::xtypes::TK_CHAR16: - { - wchar_t value(0); - try - { - std::wstring temp = std::wstring(sValue.begin(), sValue.end()); - value = temp[0]; - } - catch (...) - { - } - - set_char16_value(value, id); - } - break; - case eprosima::fastdds::dds::xtypes::TK_BOOLEAN: - { - int value(0); - try - { - value = stoi(sValue); - } - catch (...) - { - } - set_bool_value(value == 1 ? true : false, id); - } - break; - case eprosima::fastdds::dds::xtypes::TK_BYTE: - { - if (sValue.length() >= 1) - { - uint8_t value(0); - try - { - value = static_cast(stoul(sValue)); - } - catch (...) - { - } - set_byte_value(value, id); - } - } - break; - case eprosima::fastdds::dds::xtypes::TK_STRING8: - { - set_string_value(sValue, id); - } - break; - case eprosima::fastdds::dds::xtypes::TK_STRING16: - { - set_wstring_value(std::wstring(sValue.begin(), sValue.end()), id); - } - break; - case eprosima::fastdds::dds::xtypes::TK_ENUM: - { - uint32_t value(0); - try - { - value = stoul(sValue); - } - catch (...) - { - } - set_enum_value(value, id); - } - break; - case eprosima::fastdds::dds::xtypes::TK_BITMASK: - { - uint64_t value(0); - try - { - value = stoul(sValue); - } - catch (...) - { - } - set_uint64_value(value, id); - } - break; - case eprosima::fastdds::dds::xtypes::TK_ARRAY: - case eprosima::fastdds::dds::xtypes::TK_SEQUENCE: - case eprosima::fastdds::dds::xtypes::TK_BITSET: - case eprosima::fastdds::dds::xtypes::TK_MAP: - { - // THESE TYPES DON'T MANAGE VALUES - } - break; - } -} - -void DynamicData::set_default_value( - MemberId id) -{ - std::string defaultValue = ""; - auto it = descriptors_.find(id); - if (it != descriptors_.end()) - { - defaultValue = it->second->get_default_value(); - } - - switch (type_->kind_) - { - default: - break; - case eprosima::fastdds::dds::xtypes::TK_INT32: - { - int32_t value(0); - try - { - value = stoi(defaultValue); - } - catch (...) - { - } - set_int32_value(value, id); - } - break; - case eprosima::fastdds::dds::xtypes::TK_UINT32: - { - uint32_t value(0); - try - { - value = stoul(defaultValue); - } - catch (...) - { - } - set_uint32_value(value, id); - } - break; - case eprosima::fastdds::dds::xtypes::TK_INT16: - { - int16_t value(0); - try - { - value = static_cast(stoi(defaultValue)); - } - catch (...) - { - } - set_int16_value(value, id); - } - break; - case eprosima::fastdds::dds::xtypes::TK_UINT16: - { - uint16_t value(0); - try - { - value = static_cast(stoul(defaultValue)); - } - catch (...) - { - } - set_uint16_value(value, id); - } - break; - case eprosima::fastdds::dds::xtypes::TK_INT64: - { - int64_t value(0); - try - { - value = stoll(defaultValue); - } - catch (...) - { - } - set_int64_value(value, id); - } - break; - case eprosima::fastdds::dds::xtypes::TK_UINT64: - { - uint64_t value(0); - try - { - value = stoul(defaultValue); - } - catch (...) - { - } - set_uint64_value(value, id); - } - break; - case eprosima::fastdds::dds::xtypes::TK_FLOAT32: - { - float value(0.0f); - try - { - value = stof(defaultValue); - } - catch (...) - { - } - set_float32_value(value, id); - } - break; - case eprosima::fastdds::dds::xtypes::TK_FLOAT64: - { - double value(0.0f); - try - { - value = stod(defaultValue); - } - catch (...) - { - } - set_float64_value(value, id); - } - break; - case eprosima::fastdds::dds::xtypes::TK_FLOAT128: - { - long double value(0.0f); - try - { - value = stold(defaultValue); - } - catch (...) - { - } - set_float128_value(value, id); - } - break; - case eprosima::fastdds::dds::xtypes::TK_CHAR8: - { - if (defaultValue.length() >= 1) - { - set_char8_value(defaultValue[0], id); - } - } - break; - case eprosima::fastdds::dds::xtypes::TK_CHAR16: - { - wchar_t value(0); - try - { - std::wstring temp = std::wstring(defaultValue.begin(), defaultValue.end()); - value = temp[0]; - } - catch (...) - { - } - - set_char16_value(value, id); - } - break; - case eprosima::fastdds::dds::xtypes::TK_BOOLEAN: - { - int value(0); - try - { - value = stoi(defaultValue); - } - catch (...) - { - } - set_bool_value(value == 1 ? true : false, id); - } - break; - case eprosima::fastdds::dds::xtypes::TK_BYTE: - { - if (defaultValue.length() >= 1) - { - uint8_t value(0); - try - { - value = static_cast(stoul(defaultValue)); - } - catch (...) - { - } - set_byte_value(value, id); - } - } - break; - case eprosima::fastdds::dds::xtypes::TK_STRING8: - { - set_string_value(defaultValue, id); - } - break; - case eprosima::fastdds::dds::xtypes::TK_STRING16: - { - set_wstring_value(std::wstring(defaultValue.begin(), defaultValue.end()), id); - } - break; - case eprosima::fastdds::dds::xtypes::TK_ENUM: - { - uint32_t value(0); - try - { - value = stoul(defaultValue); - } - catch (...) - { - } - set_enum_value(value, id); - } - break; - case eprosima::fastdds::dds::xtypes::TK_BITMASK: - { - uint64_t value(0); - try - { - value = stoul(defaultValue); - } - catch (...) - { - } - set_uint64_value(value, id); - } - break; - case eprosima::fastdds::dds::xtypes::TK_ARRAY: - case eprosima::fastdds::dds::xtypes::TK_SEQUENCE: - case eprosima::fastdds::dds::xtypes::TK_BITSET: - case eprosima::fastdds::dds::xtypes::TK_MAP: - { -#ifdef DYNAMIC_TYPES_CHECKING - auto itValue = complex_values_.find(id); - if (itValue != complex_values_.end()) - { - if (!itValue->second->key_element_) - { - itValue->second->set_default_value(MEMBER_ID_INVALID); - } - } -#else - auto itValue = values_.find(id); - if (itValue != values_.end()) - { - if (!((DynamicData*)itValue->second)->key_element_) - { - ((DynamicData*)itValue->second)->set_default_value(MEMBER_ID_INVALID); - } - } -#endif // ifdef DYNAMIC_TYPES_CHECKING - } - break; - } -} - -DynamicData* DynamicData::loan_value( - MemberId id) -{ - if (id != MEMBER_ID_INVALID) - { - if (std::find(loaned_values_.begin(), loaned_values_.end(), id) == loaned_values_.end()) - { -#ifdef DYNAMIC_TYPES_CHECKING - auto it = complex_values_.find(id); - if (it != complex_values_.end()) - { - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_MAP && it->second->key_element_) - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error loaning Value. Key values can't be loaned."); - return nullptr; - } - else - { - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_UNION && union_id_ != id) - { - set_union_id(id); - } - loaned_values_.push_back(id); - return it->second; - } - } - else if (get_kind() == eprosima::fastdds::dds::xtypes::TK_ARRAY) - { - if (insert_array_data(id) == eprosima::fastdds::dds::RETCODE_OK) - { - loaned_values_.push_back(id); - return complex_values_.at(id); - } - } -#else - auto it = values_.find(id); - if (it != values_.end()) - { - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_MAP && ((DynamicData*)it->second)->key_element_) - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error loaning Value. Key values can't be loaned."); - return nullptr; - } - else - { - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_UNION && union_id_ != id) - { - set_union_id(id); - } - loaned_values_.push_back(id); - return (DynamicData*)it->second; - } - } - else if (get_kind() == eprosima::fastdds::dds::xtypes::TK_ARRAY) - { - if (insert_array_data(id) == eprosima::fastdds::dds::RETCODE_OK) - { - loaned_values_.push_back(id); - return (DynamicData*)values_.at(id); - } - } - -#endif // ifdef DYNAMIC_TYPES_CHECKING - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error loaning Value. MemberId not found."); - } - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error loaning Value. The value has been loaned previously."); - } - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error loaning Value. Invalid MemberId."); - } - return nullptr; -} - -ReturnCode_t DynamicData::return_loaned_value( - const DynamicData* value) -{ - for (auto loanIt = loaned_values_.begin(); loanIt != loaned_values_.end(); ++loanIt) - { -#ifdef DYNAMIC_TYPES_CHECKING - auto it = complex_values_.find(*loanIt); - if (it != complex_values_.end() && it->second == value) - { - loaned_values_.erase(loanIt); - return eprosima::fastdds::dds::RETCODE_OK; - } -#else - auto it = values_.find(*loanIt); - if (it != values_.end() && it->second == value) - { - loaned_values_.erase(loanIt); - return eprosima::fastdds::dds::RETCODE_OK; - } -#endif // ifdef DYNAMIC_TYPES_CHECKING - } - - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error returning loaned Value. The value hasn't been loaned."); - return eprosima::fastdds::dds::RETCODE_PRECONDITION_NOT_MET; -} - -ReturnCode_t DynamicData::get_int32_value( - int32_t& value, - MemberId id) const -{ -#ifdef DYNAMIC_TYPES_CHECKING - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_INT32 && id == MEMBER_ID_INVALID) - { - value = int32_value_; - return eprosima::fastdds::dds::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - auto it = complex_values_.find(id); - if (it != complex_values_.end()) - { - if (get_kind() != eprosima::fastdds::dds::xtypes::TK_UNION || id == union_id_) - { - return it->second->get_int32_value(value, MEMBER_ID_INVALID); - } - } - else if (get_kind() == eprosima::fastdds::dds::xtypes::TK_ARRAY) - { - return default_array_value_->get_int32_value(value, MEMBER_ID_INVALID); - } - } - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; -#else - auto it = values_.find(id); - if (it != values_.end()) - { - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_INT32 && id == MEMBER_ID_INVALID) - { - value = *((int32_t*)it->second); - return eprosima::fastdds::dds::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - if (get_kind() != eprosima::fastdds::dds::xtypes::TK_UNION || id == union_id_) - { - return ((DynamicData*)it->second)->get_int32_value(value, MEMBER_ID_INVALID); - } - } - } - else if (get_kind() == eprosima::fastdds::dds::xtypes::TK_ARRAY && id != MEMBER_ID_INVALID) - { - return default_array_value_->get_int32_value(value, MEMBER_ID_INVALID); - } - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; -#endif // ifdef DYNAMIC_TYPES_CHECKING -} - -ReturnCode_t DynamicData::set_int32_value( - int32_t value, - MemberId id) -{ -#ifdef DYNAMIC_TYPES_CHECKING - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_INT32 && id == MEMBER_ID_INVALID) - { - int32_value_ = value; - return eprosima::fastdds::dds::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - auto it = complex_values_.find(id); - if (it != complex_values_.end()) - { - DynamicData* data = it->second; - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_BITSET && - data->type_->get_descriptor()->annotation_get_bit_bound()) - { - uint16_t bit_bound = data->type_->get_descriptor()->annotation_get_bit_bound(); - int32_t mask = 0x00; - for (uint16_t i = 0; i < bit_bound; ++i) - { - mask = mask << 1; - mask += 1; - } - value &= mask; - } - ReturnCode_t result = it->second->set_int32_value(value, MEMBER_ID_INVALID); - if (result == eprosima::fastdds::dds::RETCODE_OK && get_kind() == eprosima::fastdds::dds::xtypes::TK_UNION) - { - set_union_id(id); - } - return result; - } - else if (get_kind() == eprosima::fastdds::dds::xtypes::TK_ARRAY) - { - ReturnCode_t insertResult = insert_array_data(id); - if (insertResult == eprosima::fastdds::dds::RETCODE_OK) - { - return set_int32_value(value, id); - } - return insertResult; - } - } - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; -#else - auto it = values_.find(id); - if (it != values_.end()) - { - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_INT32 && id == MEMBER_ID_INVALID) - { - *((int32_t*)it->second) = value; - return eprosima::fastdds::dds::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - auto itDescriptor = descriptors_.find(id); - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_BITSET) - { - if (itDescriptor == descriptors_.end()) - { - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; - } - uint16_t bit_bound = ((MemberDescriptor*)itDescriptor->second)->annotation_get_bit_bound(); - int32_t mask = 0x00; - for (uint16_t i = 0; i < bit_bound; ++i) - { - mask = mask << 1; - mask += 1; - } - value &= mask; - } - ReturnCode_t result = ((DynamicData*)it->second)->set_int32_value(value, MEMBER_ID_INVALID); - if (result == eprosima::fastdds::dds::RETCODE_OK && get_kind() == eprosima::fastdds::dds::xtypes::TK_UNION) - { - set_union_id(id); - } - return result; - } - } - else if (get_kind() == eprosima::fastdds::dds::xtypes::TK_ARRAY && id != MEMBER_ID_INVALID) - { - ReturnCode_t insertResult = insert_array_data(id); - if (insertResult == eprosima::fastdds::dds::RETCODE_OK) - { - return set_int32_value(value, id); - } - return insertResult; - } - - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; -#endif // ifdef DYNAMIC_TYPES_CHECKING -} - -ReturnCode_t DynamicData::get_uint32_value( - uint32_t& value, - MemberId id) const -{ -#ifdef DYNAMIC_TYPES_CHECKING - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_UINT32 && id == MEMBER_ID_INVALID) - { - value = uint32_value_; - return eprosima::fastdds::dds::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - auto it = complex_values_.find(id); - if (it != complex_values_.end()) - { - if (get_kind() != eprosima::fastdds::dds::xtypes::TK_UNION || id == union_id_) - { - return it->second->get_uint32_value(value, MEMBER_ID_INVALID); - } - } - else if (get_kind() == eprosima::fastdds::dds::xtypes::TK_ARRAY) - { - return default_array_value_->get_uint32_value(value, MEMBER_ID_INVALID); - } - } - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; -#else - auto it = values_.find(id); - if (it != values_.end()) - { - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_UINT32 && id == MEMBER_ID_INVALID) - { - value = *((uint32_t*)it->second); - return eprosima::fastdds::dds::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - if (get_kind() != eprosima::fastdds::dds::xtypes::TK_UNION || id == union_id_) - { - return ((DynamicData*)it->second)->get_uint32_value(value, MEMBER_ID_INVALID); - } - } - } - else if (get_kind() == eprosima::fastdds::dds::xtypes::TK_ARRAY && id != MEMBER_ID_INVALID) - { - return default_array_value_->get_uint32_value(value, MEMBER_ID_INVALID); - } - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; -#endif // ifdef DYNAMIC_TYPES_CHECKING -} - -ReturnCode_t DynamicData::set_uint32_value( - uint32_t value, - MemberId id) -{ -#ifdef DYNAMIC_TYPES_CHECKING - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_UINT32 && id == MEMBER_ID_INVALID) - { - uint32_value_ = value; - return eprosima::fastdds::dds::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - auto it = complex_values_.find(id); - if (it != complex_values_.end()) - { - DynamicData* data = it->second; - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_BITSET && - data->type_->get_descriptor()->annotation_is_bit_bound()) - { - uint16_t bit_bound = data->type_->get_descriptor()->annotation_get_bit_bound(); - uint32_t mask = 0x00; - for (uint16_t i = 0; i < bit_bound; ++i) - { - mask = mask << 1; - mask += 1; - } - value &= mask; - } - ReturnCode_t result = it->second->set_uint32_value(value, MEMBER_ID_INVALID); - if (result == eprosima::fastdds::dds::RETCODE_OK && get_kind() == eprosima::fastdds::dds::xtypes::TK_UNION) - { - set_union_id(id); - } - return result; - } - else if (get_kind() == eprosima::fastdds::dds::xtypes::TK_ARRAY) - { - ReturnCode_t insertResult = insert_array_data(id); - if (insertResult == eprosima::fastdds::dds::RETCODE_OK) - { - return set_uint32_value(value, id); - } - return insertResult; - } - } - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; -#else - auto it = values_.find(id); - if (it != values_.end()) - { - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_UINT32 && id == MEMBER_ID_INVALID) - { - *((uint32_t*)it->second) = value; - return eprosima::fastdds::dds::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - auto itDescriptor = descriptors_.find(id); - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_BITSET) - { - if (itDescriptor == descriptors_.end()) - { - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; - } - uint16_t bit_bound = ((MemberDescriptor*)itDescriptor->second)->annotation_get_bit_bound(); - uint32_t mask = 0x00; - for (uint16_t i = 0; i < bit_bound; ++i) - { - mask = mask << 1; - mask += 1; - } - value &= mask; - } - ReturnCode_t result = ((DynamicData*)it->second)->set_uint32_value(value, MEMBER_ID_INVALID); - if (result == eprosima::fastdds::dds::RETCODE_OK && get_kind() == eprosima::fastdds::dds::xtypes::TK_UNION) - { - set_union_id(id); - } - return result; - } - } - else if (get_kind() == eprosima::fastdds::dds::xtypes::TK_ARRAY && id != MEMBER_ID_INVALID) - { - ReturnCode_t insertResult = insert_array_data(id); - if (insertResult == eprosima::fastdds::dds::RETCODE_OK) - { - return set_uint32_value(value, id); - } - return insertResult; - } - - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; -#endif // ifdef DYNAMIC_TYPES_CHECKING -} - -ReturnCode_t DynamicData::get_int16_value( - int16_t& value, - MemberId id) const -{ -#ifdef DYNAMIC_TYPES_CHECKING - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_INT16 && id == MEMBER_ID_INVALID) - { - value = int16_value_; - return eprosima::fastdds::dds::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - auto it = complex_values_.find(id); - if (it != complex_values_.end()) - { - if (get_kind() != eprosima::fastdds::dds::xtypes::TK_UNION || id == union_id_) - { - return it->second->get_int16_value(value, MEMBER_ID_INVALID); - } - } - else if (get_kind() == eprosima::fastdds::dds::xtypes::TK_ARRAY) - { - return default_array_value_->get_int16_value(value, MEMBER_ID_INVALID); - } - } - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; -#else - auto it = values_.find(id); - if (it != values_.end()) - { - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_INT16 && id == MEMBER_ID_INVALID) - { - value = *((int16_t*)it->second); - return eprosima::fastdds::dds::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - if (get_kind() != eprosima::fastdds::dds::xtypes::TK_UNION || id == union_id_) - { - return ((DynamicData*)it->second)->get_int16_value(value, MEMBER_ID_INVALID); - } - } - } - else if (get_kind() == eprosima::fastdds::dds::xtypes::TK_ARRAY && id != MEMBER_ID_INVALID) - { - return default_array_value_->get_int16_value(value, MEMBER_ID_INVALID); - } - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; -#endif // ifdef DYNAMIC_TYPES_CHECKING -} - -ReturnCode_t DynamicData::set_int16_value( - int16_t value, - MemberId id) -{ -#ifdef DYNAMIC_TYPES_CHECKING - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_INT16 && id == MEMBER_ID_INVALID) - { - int16_value_ = value; - return eprosima::fastdds::dds::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - auto it = complex_values_.find(id); - if (it != complex_values_.end()) - { - DynamicData* data = it->second; - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_BITSET && - data->type_->get_descriptor()->annotation_is_bit_bound()) - { - uint16_t bit_bound = data->type_->get_descriptor()->annotation_get_bit_bound(); - int16_t mask = 0x00; - for (uint16_t i = 0; i < bit_bound; ++i) - { - mask = mask << 1; - mask += 1; - } - value &= mask; - } - ReturnCode_t result = it->second->set_int16_value(value, MEMBER_ID_INVALID); - if (result == eprosima::fastdds::dds::RETCODE_OK && get_kind() == eprosima::fastdds::dds::xtypes::TK_UNION) - { - set_union_id(id); - } - return result; - } - else if (get_kind() == eprosima::fastdds::dds::xtypes::TK_ARRAY) - { - ReturnCode_t insertResult = insert_array_data(id); - if (insertResult == eprosima::fastdds::dds::RETCODE_OK) - { - return set_int16_value(value, id); - } - return insertResult; - } - } - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; -#else - auto it = values_.find(id); - if (it != values_.end()) - { - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_INT16 && id == MEMBER_ID_INVALID) - { - *((int16_t*)it->second) = value; - return eprosima::fastdds::dds::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - auto itDescriptor = descriptors_.find(id); - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_BITSET) - { - if (itDescriptor == descriptors_.end()) - { - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; - } - uint16_t bit_bound = ((MemberDescriptor*)itDescriptor->second)->annotation_get_bit_bound(); - int16_t mask = 0x00; - for (uint16_t i = 0; i < bit_bound; ++i) - { - mask = mask << 1; - mask += 1; - } - value &= mask; - } - ReturnCode_t result = ((DynamicData*)it->second)->set_int16_value(value, MEMBER_ID_INVALID); - if (result == eprosima::fastdds::dds::RETCODE_OK && get_kind() == eprosima::fastdds::dds::xtypes::TK_UNION) - { - set_union_id(id); - } - return result; - } - } - else if (get_kind() == eprosima::fastdds::dds::xtypes::TK_ARRAY && id != MEMBER_ID_INVALID) - { - ReturnCode_t insertResult = insert_array_data(id); - if (insertResult == eprosima::fastdds::dds::RETCODE_OK) - { - return set_int16_value(value, id); - } - return insertResult; - } - - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; -#endif // ifdef DYNAMIC_TYPES_CHECKING -} - -ReturnCode_t DynamicData::get_uint16_value( - uint16_t& value, - MemberId id) const -{ -#ifdef DYNAMIC_TYPES_CHECKING - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_UINT16 && id == MEMBER_ID_INVALID) - { - value = uint16_value_; - return eprosima::fastdds::dds::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - auto it = complex_values_.find(id); - if (it != complex_values_.end()) - { - if (get_kind() != eprosima::fastdds::dds::xtypes::TK_UNION || id == union_id_) - { - return it->second->get_uint16_value(value, MEMBER_ID_INVALID); - } - } - else if (get_kind() == eprosima::fastdds::dds::xtypes::TK_ARRAY) - { - return default_array_value_->get_uint16_value(value, MEMBER_ID_INVALID); - } - } - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; -#else - auto it = values_.find(id); - if (it != values_.end()) - { - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_UINT16 && id == MEMBER_ID_INVALID) - { - value = *((uint16_t*)it->second); - return eprosima::fastdds::dds::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - if (get_kind() != eprosima::fastdds::dds::xtypes::TK_UNION || id == union_id_) - { - return ((DynamicData*)it->second)->get_uint16_value(value, MEMBER_ID_INVALID); - } - } - } - else if (get_kind() == eprosima::fastdds::dds::xtypes::TK_ARRAY && id != MEMBER_ID_INVALID) - { - return default_array_value_->get_uint16_value(value, MEMBER_ID_INVALID); - } - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; -#endif // ifdef DYNAMIC_TYPES_CHECKING -} - -ReturnCode_t DynamicData::set_uint16_value( - uint16_t value, - MemberId id) -{ -#ifdef DYNAMIC_TYPES_CHECKING - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_UINT16 && id == MEMBER_ID_INVALID) - { - uint16_value_ = value; - return eprosima::fastdds::dds::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - auto it = complex_values_.find(id); - if (it != complex_values_.end()) - { - DynamicData* data = it->second; - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_BITSET && - data->type_->get_descriptor()->annotation_is_bit_bound()) - { - uint16_t bit_bound = data->type_->get_descriptor()->annotation_get_bit_bound(); - uint16_t mask = 0x00; - for (uint16_t i = 0; i < bit_bound; ++i) - { - mask = mask << 1; - mask += 1; - } - value &= mask; - } - ReturnCode_t result = it->second->set_uint16_value(value, MEMBER_ID_INVALID); - if (result == eprosima::fastdds::dds::RETCODE_OK && get_kind() == eprosima::fastdds::dds::xtypes::TK_UNION) - { - set_union_id(id); - } - return result; - } - else if (get_kind() == eprosima::fastdds::dds::xtypes::TK_ARRAY) - { - ReturnCode_t insertResult = insert_array_data(id); - if (insertResult == eprosima::fastdds::dds::RETCODE_OK) - { - return set_uint16_value(value, id); - } - return insertResult; - } - } - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; -#else - auto it = values_.find(id); - if (it != values_.end()) - { - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_UINT16 && id == MEMBER_ID_INVALID) - { - *((uint16_t*)it->second) = value; - return eprosima::fastdds::dds::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - auto itDescriptor = descriptors_.find(id); - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_BITSET) - { - if (itDescriptor == descriptors_.end()) - { - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; - } - uint16_t bit_bound = ((MemberDescriptor*)itDescriptor->second)->annotation_get_bit_bound(); - uint16_t mask = 0x00; - for (uint16_t i = 0; i < bit_bound; ++i) - { - mask = mask << 1; - mask += 1; - } - value &= mask; - } - ReturnCode_t result = ((DynamicData*)it->second)->set_uint16_value(value, MEMBER_ID_INVALID); - if (result == eprosima::fastdds::dds::RETCODE_OK && get_kind() == eprosima::fastdds::dds::xtypes::TK_UNION) - { - set_union_id(id); - } - return result; - } - } - else if (get_kind() == eprosima::fastdds::dds::xtypes::TK_ARRAY && id != MEMBER_ID_INVALID) - { - ReturnCode_t insertResult = insert_array_data(id); - if (insertResult == eprosima::fastdds::dds::RETCODE_OK) - { - return set_uint16_value(value, id); - } - return insertResult; - } - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; -#endif // ifdef DYNAMIC_TYPES_CHECKING -} - -ReturnCode_t DynamicData::get_int64_value( - int64_t& value, - MemberId id) const -{ -#ifdef DYNAMIC_TYPES_CHECKING - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_INT64 && id == MEMBER_ID_INVALID) - { - value = int64_value_; - return eprosima::fastdds::dds::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - auto it = complex_values_.find(id); - if (it != complex_values_.end()) - { - if (get_kind() != eprosima::fastdds::dds::xtypes::TK_UNION || id == union_id_) - { - return it->second->get_int64_value(value, MEMBER_ID_INVALID); - } - } - else if (get_kind() == eprosima::fastdds::dds::xtypes::TK_ARRAY) - { - return default_array_value_->get_int64_value(value, MEMBER_ID_INVALID); - } - } - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; -#else - auto it = values_.find(id); - if (it != values_.end()) - { - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_INT64 && id == MEMBER_ID_INVALID) - { - value = *((int64_t*)it->second); - return eprosima::fastdds::dds::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - if (get_kind() != eprosima::fastdds::dds::xtypes::TK_UNION || id == union_id_) - { - return ((DynamicData*)it->second)->get_int64_value(value, MEMBER_ID_INVALID); - } - } - } - else if (get_kind() == eprosima::fastdds::dds::xtypes::TK_ARRAY && id != MEMBER_ID_INVALID) - { - return default_array_value_->get_int64_value(value, MEMBER_ID_INVALID); - } - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; -#endif // ifdef DYNAMIC_TYPES_CHECKING -} - -ReturnCode_t DynamicData::set_int64_value( - int64_t value, - MemberId id) -{ -#ifdef DYNAMIC_TYPES_CHECKING - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_INT64 && id == MEMBER_ID_INVALID) - { - int64_value_ = value; - return eprosima::fastdds::dds::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - auto it = complex_values_.find(id); - if (it != complex_values_.end()) - { - DynamicData* data = it->second; - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_BITSET && - data->type_->get_descriptor()->annotation_is_bit_bound()) - { - uint16_t bit_bound = data->type_->get_descriptor()->annotation_get_bit_bound(); - int64_t mask = 0x00; - for (uint16_t i = 0; i < bit_bound; ++i) - { - mask = mask << 1; - mask += 1; - } - value &= mask; - } - ReturnCode_t result = it->second->set_int64_value(value, MEMBER_ID_INVALID); - if (result == eprosima::fastdds::dds::RETCODE_OK && get_kind() == eprosima::fastdds::dds::xtypes::TK_UNION) - { - set_union_id(id); - } - return result; - } - else if (get_kind() == eprosima::fastdds::dds::xtypes::TK_ARRAY) - { - ReturnCode_t insertResult = insert_array_data(id); - if (insertResult == eprosima::fastdds::dds::RETCODE_OK) - { - return set_int64_value(value, id); - } - return insertResult; - } - } - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; -#else - auto it = values_.find(id); - if (it != values_.end()) - { - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_INT64 && id == MEMBER_ID_INVALID) - { - *((int64_t*)it->second) = value; - return eprosima::fastdds::dds::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - auto itDescriptor = descriptors_.find(id); - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_BITSET) - { - if (itDescriptor == descriptors_.end()) - { - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; - } - uint16_t bit_bound = ((MemberDescriptor*)itDescriptor->second)->annotation_get_bit_bound(); - int64_t mask = 0x00; - for (uint16_t i = 0; i < bit_bound; ++i) - { - mask = mask << 1; - mask += 1; - } - value &= mask; - } - ReturnCode_t result = ((DynamicData*)it->second)->set_int64_value(value, MEMBER_ID_INVALID); - if (result == eprosima::fastdds::dds::RETCODE_OK && get_kind() == eprosima::fastdds::dds::xtypes::TK_UNION) - { - set_union_id(id); - } - return result; - } - } - else if (get_kind() == eprosima::fastdds::dds::xtypes::TK_ARRAY && id != MEMBER_ID_INVALID) - { - ReturnCode_t insertResult = insert_array_data(id); - if (insertResult == eprosima::fastdds::dds::RETCODE_OK) - { - return set_int64_value(value, id); - } - return insertResult; - } - - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; -#endif // ifdef DYNAMIC_TYPES_CHECKING -} - -ReturnCode_t DynamicData::get_uint64_value( - uint64_t& value, - MemberId id) const -{ -#ifdef DYNAMIC_TYPES_CHECKING - if ((get_kind() == eprosima::fastdds::dds::xtypes::TK_UINT64 || - get_kind() == eprosima::fastdds::dds::xtypes::TK_BITMASK) && id == MEMBER_ID_INVALID) - { - value = uint64_value_; - return eprosima::fastdds::dds::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - auto it = complex_values_.find(id); - if (it != complex_values_.end()) - { - if (get_kind() != eprosima::fastdds::dds::xtypes::TK_UNION || id == union_id_) - { - return it->second->get_uint64_value(value, MEMBER_ID_INVALID); - } - } - else if (get_kind() == eprosima::fastdds::dds::xtypes::TK_ARRAY) - { - return default_array_value_->get_uint64_value(value, MEMBER_ID_INVALID); - } - } - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; -#else - auto it = values_.find(id); - if (it != values_.end()) - { - if ((get_kind() == eprosima::fastdds::dds::xtypes::TK_UINT64 || - get_kind() == eprosima::fastdds::dds::xtypes::TK_BITMASK) && id == MEMBER_ID_INVALID) - { - value = *((uint64_t*)it->second); - return eprosima::fastdds::dds::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - if (get_kind() != eprosima::fastdds::dds::xtypes::TK_UNION || id == union_id_) - { - return ((DynamicData*)it->second)->get_uint64_value(value, MEMBER_ID_INVALID); - } - } - } - else if (get_kind() == eprosima::fastdds::dds::xtypes::TK_ARRAY && id != MEMBER_ID_INVALID) - { - return default_array_value_->get_uint64_value(value, MEMBER_ID_INVALID); - } - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; -#endif // ifdef DYNAMIC_TYPES_CHECKING -} - -ReturnCode_t DynamicData::set_uint64_value( - uint64_t value, - MemberId id) -{ -#ifdef DYNAMIC_TYPES_CHECKING - if ((get_kind() == eprosima::fastdds::dds::xtypes::TK_UINT64 || - get_kind() == eprosima::fastdds::dds::xtypes::TK_BITMASK) && id == MEMBER_ID_INVALID) - { - uint64_value_ = value; - return eprosima::fastdds::dds::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - auto it = complex_values_.find(id); - if (it != complex_values_.end()) - { - DynamicData* data = it->second; - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_BITSET && - data->type_->get_descriptor()->annotation_is_bit_bound()) - { - uint16_t bit_bound = data->type_->get_descriptor()->annotation_get_bit_bound(); - uint64_t mask = 0x00; - for (uint16_t i = 0; i < bit_bound; ++i) - { - mask = mask << 1; - mask += 1; - } - value &= mask; - } - ReturnCode_t result = it->second->set_uint64_value(value, MEMBER_ID_INVALID); - if (result == eprosima::fastdds::dds::RETCODE_OK && get_kind() == eprosima::fastdds::dds::xtypes::TK_UNION) - { - set_union_id(id); - } - return result; - } - else if (get_kind() == eprosima::fastdds::dds::xtypes::TK_ARRAY) - { - ReturnCode_t insertResult = insert_array_data(id); - if (insertResult == eprosima::fastdds::dds::RETCODE_OK) - { - return set_uint64_value(value, id); - } - return insertResult; - } - } - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; -#else - auto it = values_.find(id); - if (it != values_.end()) - { - if ((get_kind() == eprosima::fastdds::dds::xtypes::TK_UINT64 || - get_kind() == eprosima::fastdds::dds::xtypes::TK_BITMASK) && id == MEMBER_ID_INVALID) - { - *((uint64_t*)it->second) = value; - return eprosima::fastdds::dds::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - auto itDescriptor = descriptors_.find(id); - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_BITSET) - { - if (itDescriptor == descriptors_.end()) - { - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; - } - uint16_t bit_bound = ((MemberDescriptor*)itDescriptor->second)->annotation_get_bit_bound(); - uint64_t mask = 0x00; - for (uint16_t i = 0; i < bit_bound; ++i) - { - mask = mask << 1; - mask += 1; - } - value &= mask; - } - ReturnCode_t result = ((DynamicData*)it->second)->set_uint64_value(value, MEMBER_ID_INVALID); - if (result == eprosima::fastdds::dds::RETCODE_OK && get_kind() == eprosima::fastdds::dds::xtypes::TK_UNION) - { - set_union_id(id); - } - return result; - } - } - else if (get_kind() == eprosima::fastdds::dds::xtypes::TK_ARRAY && id != MEMBER_ID_INVALID) - { - ReturnCode_t insertResult = insert_array_data(id); - if (insertResult == eprosima::fastdds::dds::RETCODE_OK) - { - return set_uint64_value(value, id); - } - return insertResult; - } - - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; -#endif // ifdef DYNAMIC_TYPES_CHECKING -} - -ReturnCode_t DynamicData::get_float32_value( - float& value, - MemberId id) const -{ -#ifdef DYNAMIC_TYPES_CHECKING - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_FLOAT32 && id == MEMBER_ID_INVALID) - { - value = float32_value_; - return eprosima::fastdds::dds::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - auto it = complex_values_.find(id); - if (it != complex_values_.end()) - { - if (get_kind() != eprosima::fastdds::dds::xtypes::TK_UNION || id == union_id_) - { - return it->second->get_float32_value(value, MEMBER_ID_INVALID); - } - } - else if (get_kind() == eprosima::fastdds::dds::xtypes::TK_ARRAY) - { - return default_array_value_->get_float32_value(value, MEMBER_ID_INVALID); - } - } - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; -#else - auto it = values_.find(id); - if (it != values_.end()) - { - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_FLOAT32 && id == MEMBER_ID_INVALID) - { - value = *((float*)it->second); - return eprosima::fastdds::dds::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - if (get_kind() != eprosima::fastdds::dds::xtypes::TK_UNION || id == union_id_) - { - return ((DynamicData*)it->second)->get_float32_value(value, MEMBER_ID_INVALID); - } - } - } - else if (get_kind() == eprosima::fastdds::dds::xtypes::TK_ARRAY && id != MEMBER_ID_INVALID) - { - return default_array_value_->get_float32_value(value, MEMBER_ID_INVALID); - } - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; -#endif // ifdef DYNAMIC_TYPES_CHECKING -} - -ReturnCode_t DynamicData::set_float32_value( - float value, - MemberId id) -{ -#ifdef DYNAMIC_TYPES_CHECKING - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_FLOAT32 && id == MEMBER_ID_INVALID) - { - float32_value_ = value; - return eprosima::fastdds::dds::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - auto it = complex_values_.find(id); - if (it != complex_values_.end()) - { - ReturnCode_t result = it->second->set_float32_value(value, MEMBER_ID_INVALID); - if (result == eprosima::fastdds::dds::RETCODE_OK && get_kind() == eprosima::fastdds::dds::xtypes::TK_UNION) - { - set_union_id(id); - } - return result; - } - else if (get_kind() == eprosima::fastdds::dds::xtypes::TK_ARRAY) - { - ReturnCode_t insertResult = insert_array_data(id); - if (insertResult == eprosima::fastdds::dds::RETCODE_OK) - { - return set_float32_value(value, id); - } - return insertResult; - } - } - - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; -#else - auto it = values_.find(id); - if (it != values_.end()) - { - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_FLOAT32 && id == MEMBER_ID_INVALID) - { - *((float*)it->second) = value; - return eprosima::fastdds::dds::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - ReturnCode_t result = ((DynamicData*)it->second)->set_float32_value(value, MEMBER_ID_INVALID); - if (result == eprosima::fastdds::dds::RETCODE_OK && get_kind() == eprosima::fastdds::dds::xtypes::TK_UNION) - { - set_union_id(id); - } - return result; - } - } - else if (get_kind() == eprosima::fastdds::dds::xtypes::TK_ARRAY && id != MEMBER_ID_INVALID) - { - ReturnCode_t insertResult = insert_array_data(id); - if (insertResult == eprosima::fastdds::dds::RETCODE_OK) - { - return set_float32_value(value, id); - } - return insertResult; - } - - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; -#endif // ifdef DYNAMIC_TYPES_CHECKING -} - -ReturnCode_t DynamicData::get_float64_value( - double& value, - MemberId id) const -{ -#ifdef DYNAMIC_TYPES_CHECKING - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_FLOAT64 && id == MEMBER_ID_INVALID) - { - value = float64_value_; - return eprosima::fastdds::dds::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - auto it = complex_values_.find(id); - if (it != complex_values_.end()) - { - if (get_kind() != eprosima::fastdds::dds::xtypes::TK_UNION || id == union_id_) - { - return it->second->get_float64_value(value, MEMBER_ID_INVALID); - } - } - else if (get_kind() == eprosima::fastdds::dds::xtypes::TK_ARRAY) - { - return default_array_value_->get_float64_value(value, MEMBER_ID_INVALID); - } - } - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; -#else - auto it = values_.find(id); - if (it != values_.end()) - { - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_FLOAT64 && id == MEMBER_ID_INVALID) - { - value = *((double*)it->second); - return eprosima::fastdds::dds::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - if (get_kind() != eprosima::fastdds::dds::xtypes::TK_UNION || id == union_id_) - { - return ((DynamicData*)it->second)->get_float64_value(value, MEMBER_ID_INVALID); - } - } - } - else if (get_kind() == eprosima::fastdds::dds::xtypes::TK_ARRAY && id != MEMBER_ID_INVALID) - { - return default_array_value_->get_float64_value(value, MEMBER_ID_INVALID); - } - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; -#endif // ifdef DYNAMIC_TYPES_CHECKING -} - -ReturnCode_t DynamicData::set_float64_value( - double value, - MemberId id) -{ -#ifdef DYNAMIC_TYPES_CHECKING - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_FLOAT64 && id == MEMBER_ID_INVALID) - { - float64_value_ = value; - return eprosima::fastdds::dds::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - auto it = complex_values_.find(id); - if (it != complex_values_.end()) - { - ReturnCode_t result = it->second->set_float64_value(value, MEMBER_ID_INVALID); - if (result == eprosima::fastdds::dds::RETCODE_OK && get_kind() == eprosima::fastdds::dds::xtypes::TK_UNION) - { - set_union_id(id); - } - return result; - } - else if (get_kind() == eprosima::fastdds::dds::xtypes::TK_ARRAY) - { - ReturnCode_t insertResult = insert_array_data(id); - if (insertResult == eprosima::fastdds::dds::RETCODE_OK) - { - return set_float64_value(value, id); - } - return insertResult; - } - } - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; -#else - auto it = values_.find(id); - if (it != values_.end()) - { - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_FLOAT64 && id == MEMBER_ID_INVALID) - { - *((double*)it->second) = value; - return eprosima::fastdds::dds::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - ReturnCode_t result = ((DynamicData*)it->second)->set_float64_value(value, MEMBER_ID_INVALID); - if (result == eprosima::fastdds::dds::RETCODE_OK && get_kind() == eprosima::fastdds::dds::xtypes::TK_UNION) - { - set_union_id(id); - } - return result; - } - } - else if (get_kind() == eprosima::fastdds::dds::xtypes::TK_ARRAY && id != MEMBER_ID_INVALID) - { - ReturnCode_t insertResult = insert_array_data(id); - if (insertResult == eprosima::fastdds::dds::RETCODE_OK) - { - return set_float64_value(value, id); - } - return insertResult; - } - - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; -#endif // ifdef DYNAMIC_TYPES_CHECKING -} - -ReturnCode_t DynamicData::get_float128_value( - long double& value, - MemberId id) const -{ -#ifdef DYNAMIC_TYPES_CHECKING - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_FLOAT128 && id == MEMBER_ID_INVALID) - { - value = float128_value_; - return eprosima::fastdds::dds::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - auto it = complex_values_.find(id); - if (it != complex_values_.end()) - { - if (get_kind() != eprosima::fastdds::dds::xtypes::TK_UNION || id == union_id_) - { - return it->second->get_float128_value(value, MEMBER_ID_INVALID); - } - } - else if (get_kind() == eprosima::fastdds::dds::xtypes::TK_ARRAY) - { - return default_array_value_->get_float128_value(value, MEMBER_ID_INVALID); - } - } - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; -#else - auto it = values_.find(id); - if (it != values_.end()) - { - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_FLOAT128 && id == MEMBER_ID_INVALID) - { - value = *((long double*)it->second); - return eprosima::fastdds::dds::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - if (get_kind() != eprosima::fastdds::dds::xtypes::TK_UNION || id == union_id_) - { - return ((DynamicData*)it->second)->get_float128_value(value, MEMBER_ID_INVALID); - } - } - } - else if (get_kind() == eprosima::fastdds::dds::xtypes::TK_ARRAY && id != MEMBER_ID_INVALID) - { - return default_array_value_->get_float128_value(value, MEMBER_ID_INVALID); - } - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; -#endif // ifdef DYNAMIC_TYPES_CHECKING -} - -ReturnCode_t DynamicData::set_float128_value( - long double value, - MemberId id) -{ -#ifdef DYNAMIC_TYPES_CHECKING - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_FLOAT128 && id == MEMBER_ID_INVALID) - { - float128_value_ = value; - return eprosima::fastdds::dds::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - auto it = complex_values_.find(id); - if (it != complex_values_.end()) - { - ReturnCode_t result = it->second->set_float128_value(value, MEMBER_ID_INVALID); - if (result == eprosima::fastdds::dds::RETCODE_OK && get_kind() == eprosima::fastdds::dds::xtypes::TK_UNION) - { - set_union_id(id); - } - return result; - } - else if (get_kind() == eprosima::fastdds::dds::xtypes::TK_ARRAY) - { - ReturnCode_t insertResult = insert_array_data(id); - if (insertResult == eprosima::fastdds::dds::RETCODE_OK) - { - return set_float128_value(value, id); - } - return insertResult; - } - } - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; -#else - auto it = values_.find(id); - if (it != values_.end()) - { - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_FLOAT128 && id == MEMBER_ID_INVALID) - { - *((long double*)it->second) = value; - return eprosima::fastdds::dds::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - ReturnCode_t result = ((DynamicData*)it->second)->set_float128_value(value, MEMBER_ID_INVALID); - if (result == eprosima::fastdds::dds::RETCODE_OK && get_kind() == eprosima::fastdds::dds::xtypes::TK_UNION) - { - set_union_id(id); - } - return result; - } - } - else if (get_kind() == eprosima::fastdds::dds::xtypes::TK_ARRAY && id != MEMBER_ID_INVALID) - { - ReturnCode_t insertResult = insert_array_data(id); - if (insertResult == eprosima::fastdds::dds::RETCODE_OK) - { - return set_float128_value(value, id); - } - return insertResult; - } - - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; -#endif // ifdef DYNAMIC_TYPES_CHECKING -} - -ReturnCode_t DynamicData::get_char8_value( - char& value, - MemberId id) const -{ -#ifdef DYNAMIC_TYPES_CHECKING - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_CHAR8 && id == MEMBER_ID_INVALID) - { - value = char8_value_; - return eprosima::fastdds::dds::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - auto it = complex_values_.find(id); - if (it != complex_values_.end()) - { - if (get_kind() != eprosima::fastdds::dds::xtypes::TK_UNION || id == union_id_) - { - return it->second->get_char8_value(value, MEMBER_ID_INVALID); - } - } - else if (get_kind() == eprosima::fastdds::dds::xtypes::TK_ARRAY) - { - return default_array_value_->get_char8_value(value, MEMBER_ID_INVALID); - } - } - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; -#else - auto it = values_.find(id); - if (it != values_.end()) - { - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_CHAR8 && id == MEMBER_ID_INVALID) - { - value = *((char*)it->second); - return eprosima::fastdds::dds::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - if (get_kind() != eprosima::fastdds::dds::xtypes::TK_UNION || id == union_id_) - { - return ((DynamicData*)it->second)->get_char8_value(value, MEMBER_ID_INVALID); - } - } - } - else if (get_kind() == eprosima::fastdds::dds::xtypes::TK_ARRAY && id != MEMBER_ID_INVALID) - { - return default_array_value_->get_char8_value(value, MEMBER_ID_INVALID); - } - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; -#endif // ifdef DYNAMIC_TYPES_CHECKING -} - -ReturnCode_t DynamicData::set_char8_value( - char value, - MemberId id) -{ -#ifdef DYNAMIC_TYPES_CHECKING - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_CHAR8 && id == MEMBER_ID_INVALID) - { - char8_value_ = value; - return eprosima::fastdds::dds::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - auto it = complex_values_.find(id); - if (it != complex_values_.end()) - { - ReturnCode_t result = it->second->set_char8_value(value, MEMBER_ID_INVALID); - if (result == eprosima::fastdds::dds::RETCODE_OK && get_kind() == eprosima::fastdds::dds::xtypes::TK_UNION) - { - set_union_id(id); - } - return result; - } - else if (get_kind() == eprosima::fastdds::dds::xtypes::TK_ARRAY) - { - ReturnCode_t insertResult = insert_array_data(id); - if (insertResult == eprosima::fastdds::dds::RETCODE_OK) - { - return set_char8_value(value, id); - } - return insertResult; - } - } - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; -#else - auto it = values_.find(id); - if (it != values_.end()) - { - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_CHAR8 && id == MEMBER_ID_INVALID) - { - *((char*)it->second) = value; - return eprosima::fastdds::dds::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - ReturnCode_t result = ((DynamicData*)it->second)->set_char8_value(value, MEMBER_ID_INVALID); - if (result == eprosima::fastdds::dds::RETCODE_OK && get_kind() == eprosima::fastdds::dds::xtypes::TK_UNION) - { - set_union_id(id); - } - return result; - } - } - else if (get_kind() == eprosima::fastdds::dds::xtypes::TK_ARRAY && id != MEMBER_ID_INVALID) - { - ReturnCode_t insertResult = insert_array_data(id); - if (insertResult == eprosima::fastdds::dds::RETCODE_OK) - { - return set_char8_value(value, id); - } - return insertResult; - } - - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; -#endif // ifdef DYNAMIC_TYPES_CHECKING -} - -ReturnCode_t DynamicData::get_char16_value( - wchar_t& value, - MemberId id) const -{ -#ifdef DYNAMIC_TYPES_CHECKING - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_CHAR16 && id == MEMBER_ID_INVALID) - { - value = char16_value_; - return eprosima::fastdds::dds::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - auto it = complex_values_.find(id); - if (it != complex_values_.end()) - { - if (get_kind() != eprosima::fastdds::dds::xtypes::TK_UNION || id == union_id_) - { - return it->second->get_char16_value(value, MEMBER_ID_INVALID); - } - } - else if (get_kind() == eprosima::fastdds::dds::xtypes::TK_ARRAY) - { - return default_array_value_->get_char16_value(value, MEMBER_ID_INVALID); - } - } - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; -#else - auto it = values_.find(id); - if (it != values_.end()) - { - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_CHAR16 && id == MEMBER_ID_INVALID) - { - value = *((wchar_t*)it->second); - return eprosima::fastdds::dds::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - if (get_kind() != eprosima::fastdds::dds::xtypes::TK_UNION || id == union_id_) - { - return ((DynamicData*)it->second)->get_char16_value(value, MEMBER_ID_INVALID); - } - } - } - else if (get_kind() == eprosima::fastdds::dds::xtypes::TK_ARRAY && id != MEMBER_ID_INVALID) - { - return default_array_value_->get_char16_value(value, MEMBER_ID_INVALID); - } - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; -#endif // ifdef DYNAMIC_TYPES_CHECKING -} - -ReturnCode_t DynamicData::set_char16_value( - wchar_t value, - MemberId id) -{ -#ifdef DYNAMIC_TYPES_CHECKING - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_CHAR16 && id == MEMBER_ID_INVALID) - { - char16_value_ = value; - return eprosima::fastdds::dds::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - auto it = complex_values_.find(id); - if (it != complex_values_.end()) - { - ReturnCode_t result = it->second->set_char16_value(value, MEMBER_ID_INVALID); - if (result == eprosima::fastdds::dds::RETCODE_OK && get_kind() == eprosima::fastdds::dds::xtypes::TK_UNION) - { - set_union_id(id); - } - return result; - } - else if (get_kind() == eprosima::fastdds::dds::xtypes::TK_ARRAY) - { - ReturnCode_t insertResult = insert_array_data(id); - if (insertResult == eprosima::fastdds::dds::RETCODE_OK) - { - return set_char16_value(value, id); - } - return insertResult; - } - } - - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; -#else - auto it = values_.find(id); - if (it != values_.end()) - { - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_CHAR16 && id == MEMBER_ID_INVALID) - { - *((wchar_t*)it->second) = value; - return eprosima::fastdds::dds::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - ReturnCode_t result = ((DynamicData*)it->second)->set_char16_value(value, MEMBER_ID_INVALID); - if (result == eprosima::fastdds::dds::RETCODE_OK && get_kind() == eprosima::fastdds::dds::xtypes::TK_UNION) - { - set_union_id(id); - } - return result; - } - } - else if (get_kind() == eprosima::fastdds::dds::xtypes::TK_ARRAY && id != MEMBER_ID_INVALID) - { - ReturnCode_t insertResult = insert_array_data(id); - if (insertResult == eprosima::fastdds::dds::RETCODE_OK) - { - return set_char16_value(value, id); - } - return insertResult; - } - - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; -#endif // ifdef DYNAMIC_TYPES_CHECKING -} - -ReturnCode_t DynamicData::get_byte_value( - octet& value, - MemberId id) const -{ -#ifdef DYNAMIC_TYPES_CHECKING - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_BYTE && id == MEMBER_ID_INVALID) - { - value = byte_value_; - return eprosima::fastdds::dds::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - auto it = complex_values_.find(id); - if (it != complex_values_.end()) - { - if (get_kind() != eprosima::fastdds::dds::xtypes::TK_UNION || id == union_id_) - { - return it->second->get_byte_value(value, MEMBER_ID_INVALID); - } - } - else if (get_kind() == eprosima::fastdds::dds::xtypes::TK_ARRAY) - { - return default_array_value_->get_byte_value(value, MEMBER_ID_INVALID); - } - } - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; -#else - auto it = values_.find(id); - if (it != values_.end()) - { - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_BYTE && id == MEMBER_ID_INVALID) - { - value = *((octet*)it->second); - return eprosima::fastdds::dds::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - if (get_kind() != eprosima::fastdds::dds::xtypes::TK_UNION || id == union_id_) - { - return ((DynamicData*)it->second)->get_byte_value(value, MEMBER_ID_INVALID); - } - } - } - else if (get_kind() == eprosima::fastdds::dds::xtypes::TK_ARRAY && id != MEMBER_ID_INVALID) - { - return default_array_value_->get_byte_value(value, MEMBER_ID_INVALID); - } - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; -#endif // ifdef DYNAMIC_TYPES_CHECKING -} - -ReturnCode_t DynamicData::set_byte_value( - octet value, - MemberId id) -{ -#ifdef DYNAMIC_TYPES_CHECKING - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_BYTE && id == MEMBER_ID_INVALID) - { - byte_value_ = value; - return eprosima::fastdds::dds::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - auto it = complex_values_.find(id); - if (it != complex_values_.end()) - { - DynamicData* data = it->second; - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_BITSET && - data->type_->get_descriptor()->annotation_is_bit_bound()) - { - uint16_t bit_bound = data->type_->get_descriptor()->annotation_get_bit_bound(); - octet mask = 0x00; - for (uint16_t i = 0; i < bit_bound; ++i) - { - mask = mask << 1; - mask += 1; - } - value &= mask; - } - ReturnCode_t result = it->second->set_byte_value(value, MEMBER_ID_INVALID); - if (result == eprosima::fastdds::dds::RETCODE_OK && get_kind() == eprosima::fastdds::dds::xtypes::TK_UNION) - { - set_union_id(id); - } - return result; - } - else if (get_kind() == eprosima::fastdds::dds::xtypes::TK_ARRAY) - { - ReturnCode_t insertResult = insert_array_data(id); - if (insertResult == eprosima::fastdds::dds::RETCODE_OK) - { - return set_byte_value(value, id); - } - return insertResult; - } - } - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; -#else - auto it = values_.find(id); - if (it != values_.end()) - { - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_BYTE && id == MEMBER_ID_INVALID) - { - *((octet*)it->second) = value; - return eprosima::fastdds::dds::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - auto itDescriptor = descriptors_.find(id); - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_BITSET) - { - if (itDescriptor == descriptors_.end()) - { - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; - } - uint16_t bit_bound = ((MemberDescriptor*)itDescriptor->second)->annotation_get_bit_bound(); - octet mask = 0x00; - for (uint16_t i = 0; i < bit_bound; ++i) - { - mask = mask << 1; - mask += 1; - } - value &= mask; - } - ReturnCode_t result = ((DynamicData*)it->second)->set_byte_value(value, MEMBER_ID_INVALID); - if (result == eprosima::fastdds::dds::RETCODE_OK && get_kind() == eprosima::fastdds::dds::xtypes::TK_UNION) - { - set_union_id(id); - } - return result; - } - } - else if (get_kind() == eprosima::fastdds::dds::xtypes::TK_ARRAY && id != MEMBER_ID_INVALID) - { - ReturnCode_t insertResult = insert_array_data(id); - if (insertResult == eprosima::fastdds::dds::RETCODE_OK) - { - return set_byte_value(value, id); - } - return insertResult; - } - - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; -#endif // ifdef DYNAMIC_TYPES_CHECKING -} - -ReturnCode_t DynamicData::get_bool_value( - bool& value, - MemberId id) const -{ -#ifdef DYNAMIC_TYPES_CHECKING - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_BOOLEAN && id == MEMBER_ID_INVALID) - { - value = bool_value_; - return eprosima::fastdds::dds::RETCODE_OK; - } - else if (get_kind() == eprosima::fastdds::dds::xtypes::TK_BITMASK && id < type_->get_bounds()) - { - value = (uint64_value_ & ((uint64_t)1 << id)) != 0; - return eprosima::fastdds::dds::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - auto it = complex_values_.find(id); - if (it != complex_values_.end()) - { - if (get_kind() != eprosima::fastdds::dds::xtypes::TK_UNION || id == union_id_) - { - return it->second->get_bool_value(value, MEMBER_ID_INVALID); - } - } - else if (get_kind() == eprosima::fastdds::dds::xtypes::TK_ARRAY) - { - return default_array_value_->get_bool_value(value, MEMBER_ID_INVALID); - } - } - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; -#else - auto it = values_.end(); - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_BITMASK) - { - it = values_.find(MEMBER_ID_INVALID); - } - else - { - it = values_.find(id); - } - if (it != values_.end()) - { - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_BOOLEAN && id == MEMBER_ID_INVALID) - { - value = *((bool*)it->second); - return eprosima::fastdds::dds::RETCODE_OK; - } - else if (get_kind() == eprosima::fastdds::dds::xtypes::TK_BITMASK && id < type_->get_bounds()) - { - auto m_id = descriptors_.find(id); - MemberDescriptor* member = m_id->second; - uint16_t position = member->annotation_get_position(); - value = (*((uint64_t*)it->second) & ((uint64_t)1 << position)) != 0; - return eprosima::fastdds::dds::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - if (get_kind() != eprosima::fastdds::dds::xtypes::TK_UNION || id == union_id_) - { - return ((DynamicData*)it->second)->get_bool_value(value, MEMBER_ID_INVALID); - } - } - } - else if (get_kind() == eprosima::fastdds::dds::xtypes::TK_ARRAY && id != MEMBER_ID_INVALID) - { - return default_array_value_->get_bool_value(value, MEMBER_ID_INVALID); - } - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; -#endif // ifdef DYNAMIC_TYPES_CHECKING -} - -ReturnCode_t DynamicData::set_bool_value( - bool value, - MemberId id) -{ -#ifdef DYNAMIC_TYPES_CHECKING - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_BOOLEAN && id == MEMBER_ID_INVALID) - { - bool_value_ = value; - return eprosima::fastdds::dds::RETCODE_OK; - } - else if (get_kind() == eprosima::fastdds::dds::xtypes::TK_BITMASK) - { - if (id == MEMBER_ID_INVALID) - { - if (value) - { - uint64_value_ = ~((uint64_t)0); - } - else - { - uint64_value_ = 0; - } - } - else if (type_->get_bounds() == BOUND_UNLIMITED || id < type_->get_bounds()) - { - if (value) - { - uint64_value_ |= ((uint64_t)1 << id); - } - else - { - uint64_value_ &= ~((uint64_t)1 << id); - } - return eprosima::fastdds::dds::RETCODE_OK; - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error setting bool value. The given index is greater than the limit."); - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; - } - } - else if (id != MEMBER_ID_INVALID) - { - auto it = complex_values_.find(id); - if (it != complex_values_.end()) - { - ReturnCode_t result = it->second->set_bool_value(value, MEMBER_ID_INVALID); - if (result == eprosima::fastdds::dds::RETCODE_OK && get_kind() == eprosima::fastdds::dds::xtypes::TK_UNION) - { - set_union_id(id); - } - return result; - } - else if (get_kind() == eprosima::fastdds::dds::xtypes::TK_ARRAY) - { - ReturnCode_t insertResult = insert_array_data(id); - if (insertResult == eprosima::fastdds::dds::RETCODE_OK) - { - return set_bool_value(value, id); - } - return insertResult; - } - } - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; -#else - auto it = values_.end(); - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_BITMASK) - { - it = values_.find(MEMBER_ID_INVALID); - } - else - { - it = values_.find(id); - } - - if (it != values_.end()) - { - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_BOOLEAN && id == MEMBER_ID_INVALID) - { - *((bool*)it->second) = value; - return eprosima::fastdds::dds::RETCODE_OK; - } - else if (get_kind() == eprosima::fastdds::dds::xtypes::TK_BITMASK) - { - if (id == MEMBER_ID_INVALID) - { - if (value) - { - *((uint64_t*)it->second) = ~((uint64_t)0); - } - else - { - *((uint64_t*)it->second) = 0; - } - return eprosima::fastdds::dds::RETCODE_OK; - } - else if (type_->get_bounds() == BOUND_UNLIMITED || id < type_->get_bounds()) - { - auto m_id = descriptors_.find(id); - MemberDescriptor* member = m_id->second; - uint16_t position = member->annotation_get_position(); - if (value) - { - *((uint64_t*)it->second) |= ((uint64_t)1 << position); - } - else - { - *((uint64_t*)it->second) &= ~((uint64_t)1 << position); - } - return eprosima::fastdds::dds::RETCODE_OK; - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error setting bool value. The given index is greater than the limit."); - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; - } - } - else if (id != MEMBER_ID_INVALID) - { - ReturnCode_t result = ((DynamicData*)it->second)->set_bool_value(value, MEMBER_ID_INVALID); - if (result == eprosima::fastdds::dds::RETCODE_OK && get_kind() == eprosima::fastdds::dds::xtypes::TK_UNION) - { - set_union_id(id); - } - return result; - } - } - else if (get_kind() == eprosima::fastdds::dds::xtypes::TK_ARRAY && id != MEMBER_ID_INVALID) - { - ReturnCode_t insertResult = insert_array_data(id); - if (insertResult == eprosima::fastdds::dds::RETCODE_OK) - { - return set_bool_value(value, id); - } - return insertResult; - } - - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; -#endif // ifdef DYNAMIC_TYPES_CHECKING -} - -ReturnCode_t DynamicData::get_string_value( - std::string& value, - MemberId id) const -{ -#ifdef DYNAMIC_TYPES_CHECKING - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_STRING8 && id == MEMBER_ID_INVALID) - { - value = string_value_; - return eprosima::fastdds::dds::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - auto it = complex_values_.find(id); - if (it != complex_values_.end()) - { - if (get_kind() != eprosima::fastdds::dds::xtypes::TK_UNION || id == union_id_) - { - return it->second->get_string_value(value, MEMBER_ID_INVALID); - } - } - else if (get_kind() == eprosima::fastdds::dds::xtypes::TK_ARRAY) - { - return default_array_value_->get_string_value(value, MEMBER_ID_INVALID); - } - } - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; -#else - auto it = values_.find(id); - if (it != values_.end()) - { - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_STRING8 && id == MEMBER_ID_INVALID) - { - value = *((std::string*)it->second); - return eprosima::fastdds::dds::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - if (get_kind() != eprosima::fastdds::dds::xtypes::TK_UNION || id == union_id_) - { - return ((DynamicData*)it->second)->get_string_value(value, MEMBER_ID_INVALID); - } - } - } - else if (get_kind() == eprosima::fastdds::dds::xtypes::TK_ARRAY && id != MEMBER_ID_INVALID) - { - return default_array_value_->get_string_value(value, MEMBER_ID_INVALID); - } - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; -#endif // ifdef DYNAMIC_TYPES_CHECKING -} - -ReturnCode_t DynamicData::set_string_value( - const std::string& value, - MemberId id) -{ -#ifdef DYNAMIC_TYPES_CHECKING - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_STRING8 && id == MEMBER_ID_INVALID) - { - if (value.length() <= type_->get_bounds()) - { - string_value_ = value; - return eprosima::fastdds::dds::RETCODE_OK; - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, - "Error setting string value. The given string is greater than the length limit."); - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; - } - } - else if (id != MEMBER_ID_INVALID) - { - auto it = complex_values_.find(id); - if (it != complex_values_.end()) - { - ReturnCode_t result = it->second->set_string_value(value, MEMBER_ID_INVALID); - if (result == eprosima::fastdds::dds::RETCODE_OK && get_kind() == eprosima::fastdds::dds::xtypes::TK_UNION) - { - set_union_id(id); - } - return result; - } - else if (get_kind() == eprosima::fastdds::dds::xtypes::TK_ARRAY) - { - ReturnCode_t insertResult = insert_array_data(id); - if (insertResult == eprosima::fastdds::dds::RETCODE_OK) - { - return set_string_value(value, id); - } - return insertResult; - } - } - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; -#else - auto it = values_.find(id); - if (it != values_.end()) - { - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_STRING8 && id == MEMBER_ID_INVALID) - { - if (value.length() <= type_->get_bounds()) - { - *((std::string*)it->second) = value; - return eprosima::fastdds::dds::RETCODE_OK; - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, - "Error setting string value. The given string is greater than the length limit."); - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; - } - } - else if (id != MEMBER_ID_INVALID) - { - ReturnCode_t result = ((DynamicData*)it->second)->set_string_value(value, MEMBER_ID_INVALID); - if (result == eprosima::fastdds::dds::RETCODE_OK && get_kind() == eprosima::fastdds::dds::xtypes::TK_UNION) - { - set_union_id(id); - } - return result; - } - } - else if (get_kind() == eprosima::fastdds::dds::xtypes::TK_ARRAY && id != MEMBER_ID_INVALID) - { - ReturnCode_t insertResult = insert_array_data(id); - if (insertResult == eprosima::fastdds::dds::RETCODE_OK) - { - return set_string_value(value, id); - } - return insertResult; - } - - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; -#endif // ifdef DYNAMIC_TYPES_CHECKING -} - -void DynamicData::set_type_name( - const std::string& name) -{ - if (type_ != nullptr) - { - type_->set_name(name); - } -} - -void DynamicData::update_union_discriminator() -{ - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_UNION) - { - uint64_t sUnionValue; - union_discriminator_->get_discriminator_value(sUnionValue); - for (auto it = descriptors_.begin(); it != descriptors_.end(); ++it) - { - std::vector unionLabels = it->second->get_union_labels(); - for (uint64_t label : unionLabels) - { - if (sUnionValue == label) - { - union_id_ = it->first; - union_label_ = label; - break; - } - } - } - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error updating union id. The kind: " << get_kind() << " doesn't support it."); - } -} - -void DynamicData::set_union_discriminator( - DynamicData* pData) -{ - union_discriminator_ = pData; - if (union_discriminator_ != nullptr) - { - union_discriminator_->set_discriminator_value(union_label_); - } -} - -MemberId DynamicData::get_union_id() const -{ - return union_id_; -} - -ReturnCode_t DynamicData::set_union_id( - MemberId id) -{ - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_UNION) - { - auto it = descriptors_.find(id); - if (id == MEMBER_ID_INVALID || it != descriptors_.end()) - { - union_id_ = id; - if (it != descriptors_.end()) - { - std::vector unionLabels = it->second->get_union_labels(); - if (unionLabels.size() > 0) - { - union_label_ = unionLabels[0]; - if (union_discriminator_ != nullptr) - { - union_discriminator_->set_discriminator_value(union_label_); - } - } - } - return eprosima::fastdds::dds::RETCODE_OK; - } - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error setting union id. The kind: " << get_kind() << " doesn't support it."); - } - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; -} - -ReturnCode_t DynamicData::get_wstring_value( - std::wstring& value, - MemberId id) const -{ -#ifdef DYNAMIC_TYPES_CHECKING - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_STRING16 && id == MEMBER_ID_INVALID) - { - value = wstring_value_; - return eprosima::fastdds::dds::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - auto it = complex_values_.find(id); - if (it != complex_values_.end()) - { - if (get_kind() != eprosima::fastdds::dds::xtypes::TK_UNION || id == union_id_) - { - return it->second->get_wstring_value(value, MEMBER_ID_INVALID); - } - } - else if (get_kind() == eprosima::fastdds::dds::xtypes::TK_ARRAY) - { - return default_array_value_->get_wstring_value(value, MEMBER_ID_INVALID); - } - } - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; -#else - auto it = values_.find(id); - if (it != values_.end()) - { - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_STRING16 && id == MEMBER_ID_INVALID) - { - value = *((std::wstring*)it->second); - return eprosima::fastdds::dds::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - if (get_kind() != eprosima::fastdds::dds::xtypes::TK_UNION || id == union_id_) - { - return ((DynamicData*)it->second)->get_wstring_value(value, MEMBER_ID_INVALID); - } - } - } - else if (get_kind() == eprosima::fastdds::dds::xtypes::TK_ARRAY && id != MEMBER_ID_INVALID) - { - return default_array_value_->get_wstring_value(value, MEMBER_ID_INVALID); - } - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; -#endif // ifdef DYNAMIC_TYPES_CHECKING -} - -ReturnCode_t DynamicData::set_wstring_value( - const std::wstring& value, - MemberId id) -{ -#ifdef DYNAMIC_TYPES_CHECKING - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_STRING16 && id == MEMBER_ID_INVALID) - { - if (value.length() <= type_->get_bounds()) - { - wstring_value_ = value; - return eprosima::fastdds::dds::RETCODE_OK; - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, - "Error setting wstring value. The given string is greater than the length limit."); - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; - } - } - else if (id != MEMBER_ID_INVALID) - { - auto it = complex_values_.find(id); - if (it != complex_values_.end()) - { - ReturnCode_t result = it->second->set_wstring_value(value, MEMBER_ID_INVALID); - if (result == eprosima::fastdds::dds::RETCODE_OK && get_kind() == eprosima::fastdds::dds::xtypes::TK_UNION) - { - set_union_id(id); - } - return result; - } - else if (get_kind() == eprosima::fastdds::dds::xtypes::TK_ARRAY) - { - ReturnCode_t insertResult = insert_array_data(id); - if (insertResult == eprosima::fastdds::dds::RETCODE_OK) - { - return set_wstring_value(value, id); - } - return insertResult; - } - } - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; -#else - auto it = values_.find(id); - if (it != values_.end()) - { - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_STRING16 && id == MEMBER_ID_INVALID) - { - if (value.length() <= type_->get_bounds()) - { - *((std::wstring*)it->second) = value; - return eprosima::fastdds::dds::RETCODE_OK; - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, - "Error setting wstring value. The given string is greater than the length limit."); - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; - } - } - else if (id != MEMBER_ID_INVALID) - { - ReturnCode_t result = ((DynamicData*)it->second)->set_wstring_value(value, MEMBER_ID_INVALID); - if (result == eprosima::fastdds::dds::RETCODE_OK && get_kind() == eprosima::fastdds::dds::xtypes::TK_UNION) - { - set_union_id(id); - } - return result; - } - } - else if (get_kind() == eprosima::fastdds::dds::xtypes::TK_ARRAY && id != MEMBER_ID_INVALID) - { - ReturnCode_t insertResult = insert_array_data(id); - if (insertResult == eprosima::fastdds::dds::RETCODE_OK) - { - return set_wstring_value(value, id); - } - return insertResult; - } - - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; -#endif // ifdef DYNAMIC_TYPES_CHECKING -} - -ReturnCode_t DynamicData::get_enum_value( - uint32_t& value, - MemberId id) const -{ -#ifdef DYNAMIC_TYPES_CHECKING - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_ENUM && id == MEMBER_ID_INVALID) - { - value = uint32_value_; - return eprosima::fastdds::dds::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - auto it = complex_values_.find(id); - if (it != complex_values_.end()) - { - if (get_kind() != eprosima::fastdds::dds::xtypes::TK_UNION || id == union_id_) - { - return it->second->get_enum_value(value, MEMBER_ID_INVALID); - } - } - else if (get_kind() == eprosima::fastdds::dds::xtypes::TK_ARRAY) - { - return default_array_value_->get_enum_value(value, MEMBER_ID_INVALID); - } - } - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; -#else - auto itValue = values_.find(id); - if (itValue != values_.end()) - { - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_ENUM && id == MEMBER_ID_INVALID) - { - value = *((uint32_t*)itValue->second); - return eprosima::fastdds::dds::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - if (get_kind() != eprosima::fastdds::dds::xtypes::TK_UNION || id == union_id_) - { - return ((DynamicData*)itValue->second)->get_enum_value(value, MEMBER_ID_INVALID); - } - } - } - else if (get_kind() == eprosima::fastdds::dds::xtypes::TK_ARRAY && id != MEMBER_ID_INVALID) - { - return default_array_value_->get_enum_value(value, MEMBER_ID_INVALID); - } - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; -#endif // ifdef DYNAMIC_TYPES_CHECKING -} - -ReturnCode_t DynamicData::set_enum_value( - const uint32_t& value, - MemberId id /*= MEMBER_ID_INVALID*/) -{ -#ifdef DYNAMIC_TYPES_CHECKING - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_ENUM && id == MEMBER_ID_INVALID) - { - if (descriptors_.find(value) != descriptors_.end()) - { - uint32_value_ = value; - return eprosima::fastdds::dds::RETCODE_OK; - } - } - else if (id != MEMBER_ID_INVALID) - { - auto it = complex_values_.find(id); - if (it != complex_values_.end()) - { - ReturnCode_t result = it->second->set_enum_value(value, MEMBER_ID_INVALID); - if (result == eprosima::fastdds::dds::RETCODE_OK && get_kind() == eprosima::fastdds::dds::xtypes::TK_UNION) - { - set_union_id(id); - } - return result; - } - else if (get_kind() == eprosima::fastdds::dds::xtypes::TK_ARRAY) - { - ReturnCode_t insertResult = insert_array_data(id); - if (insertResult == eprosima::fastdds::dds::RETCODE_OK) - { - return set_enum_value(value, id); - } - return insertResult; - } - } - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; -#else - auto itValue = values_.find(id); - if (itValue != values_.end()) - { - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_ENUM && id == MEMBER_ID_INVALID) - { - if (descriptors_.find(value) != descriptors_.end()) - { - *((uint32_t*)itValue->second) = value; - return eprosima::fastdds::dds::RETCODE_OK; - } - } - else if (id != MEMBER_ID_INVALID) - { - ReturnCode_t result = ((DynamicData*)itValue->second)->set_enum_value(value, MEMBER_ID_INVALID); - if (result == eprosima::fastdds::dds::RETCODE_OK && get_kind() == eprosima::fastdds::dds::xtypes::TK_UNION) - { - set_union_id(id); - } - return result; - } - } - else if (get_kind() == eprosima::fastdds::dds::xtypes::TK_ARRAY && id != MEMBER_ID_INVALID) - { - ReturnCode_t insertResult = insert_array_data(id); - if (insertResult == eprosima::fastdds::dds::RETCODE_OK) - { - return set_enum_value(value, id); - } - return insertResult; - } - - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; -#endif // ifdef DYNAMIC_TYPES_CHECKING -} - -ReturnCode_t DynamicData::get_enum_value( - std::string& value, - MemberId id) const -{ -#ifdef DYNAMIC_TYPES_CHECKING - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_ENUM && id == MEMBER_ID_INVALID) - { - auto it = descriptors_.find(uint32_value_); - if (it != descriptors_.end()) - { - value = it->second->get_name(); - return eprosima::fastdds::dds::RETCODE_OK; - } - } - else if (id != MEMBER_ID_INVALID) - { - auto it = complex_values_.find(id); - if (it != complex_values_.end()) - { - if (get_kind() != eprosima::fastdds::dds::xtypes::TK_UNION || id == union_id_) - { - return it->second->get_enum_value(value, MEMBER_ID_INVALID); - } - } - else if (get_kind() == eprosima::fastdds::dds::xtypes::TK_ARRAY) - { - return default_array_value_->get_enum_value(value, MEMBER_ID_INVALID); - } - } - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; -#else - auto itValue = values_.find(id); - if (itValue != values_.end()) - { - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_ENUM && id == MEMBER_ID_INVALID) - { - auto it = descriptors_.find(*((uint32_t*)itValue->second)); - if (it != descriptors_.end()) - { - value = it->second->get_name(); - return eprosima::fastdds::dds::RETCODE_OK; - } - } - else if (id != MEMBER_ID_INVALID) - { - if (get_kind() != eprosima::fastdds::dds::xtypes::TK_UNION || id == union_id_) - { - return ((DynamicData*)itValue->second)->get_enum_value(value, MEMBER_ID_INVALID); - } - } - } - else if (get_kind() == eprosima::fastdds::dds::xtypes::TK_ARRAY && id != MEMBER_ID_INVALID) - { - return default_array_value_->get_enum_value(value, MEMBER_ID_INVALID); - } - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; -#endif // ifdef DYNAMIC_TYPES_CHECKING -} - -ReturnCode_t DynamicData::set_enum_value( - const std::string& value, - MemberId id) -{ -#ifdef DYNAMIC_TYPES_CHECKING - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_ENUM && id == MEMBER_ID_INVALID) - { - for (auto it = descriptors_.begin(); it != descriptors_.end(); ++it) - { - if (it->second->get_name() == value) - { - uint32_value_ = it->first; - return eprosima::fastdds::dds::RETCODE_OK; - } - } - } - else if (id != MEMBER_ID_INVALID) - { - auto it = complex_values_.find(id); - if (it != complex_values_.end()) - { - ReturnCode_t result = it->second->set_enum_value(value, MEMBER_ID_INVALID); - if (result == eprosima::fastdds::dds::RETCODE_OK && get_kind() == eprosima::fastdds::dds::xtypes::TK_UNION) - { - set_union_id(id); - } - return result; - } - else if (get_kind() == eprosima::fastdds::dds::xtypes::TK_ARRAY) - { - ReturnCode_t insertResult = insert_array_data(id); - if (insertResult == eprosima::fastdds::dds::RETCODE_OK) - { - return set_enum_value(value, id); - } - return insertResult; - } - } - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; -#else - auto itValue = values_.find(id); - if (itValue != values_.end()) - { - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_ENUM && id == MEMBER_ID_INVALID) - { - for (auto it = descriptors_.begin(); it != descriptors_.end(); ++it) - { - if (it->second->get_name() == value) - { - *((uint32_t*)itValue->second) = it->first; - return eprosima::fastdds::dds::RETCODE_OK; - } - } - } - else if (id != MEMBER_ID_INVALID) - { - ReturnCode_t result = ((DynamicData*)itValue->second)->set_enum_value(value, MEMBER_ID_INVALID); - if (result == eprosima::fastdds::dds::RETCODE_OK && get_kind() == eprosima::fastdds::dds::xtypes::TK_UNION) - { - set_union_id(id); - } - return result; - } - } - else if (get_kind() == eprosima::fastdds::dds::xtypes::TK_ARRAY && id != MEMBER_ID_INVALID) - { - ReturnCode_t insertResult = insert_array_data(id); - if (insertResult == eprosima::fastdds::dds::RETCODE_OK) - { - return set_enum_value(value, id); - } - return insertResult; - } - - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; -#endif // ifdef DYNAMIC_TYPES_CHECKING -} - -ReturnCode_t DynamicData::set_bitmask_value( - uint64_t value) -{ - if (type_->kind_ == eprosima::fastdds::dds::xtypes::TK_BITMASK) - { - return set_uint64_value(value, MEMBER_ID_INVALID); - } - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; -} - -ReturnCode_t DynamicData::get_bitmask_value( - uint64_t& value) const -{ - if (type_->kind_ == eprosima::fastdds::dds::xtypes::TK_BITMASK) - { - return get_uint64_value(value, MEMBER_ID_INVALID); - } - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; -} - -void DynamicData::sort_member_ids( - MemberId startId) -{ - MemberId index = startId; - MemberId curID = startId + 1; - uint32_t distance = 1; -#ifdef DYNAMIC_TYPES_CHECKING - while (index <= complex_values_.size()) - { - auto it = complex_values_.find(curID); - if (it != complex_values_.end()) - { - complex_values_[curID - distance] = it->second; - complex_values_.erase(it); - } - else - { - ++distance; - } - ++index; - ++curID; - } -#else - static_cast(index); - while (curID <= values_.size()) - { - auto it = values_.find(curID); - if (it != values_.end()) - { - values_[curID - distance] = it->second; - values_.erase(it); - } - else - { - ++distance; - } - ++index; - ++curID; - } -#endif // ifdef DYNAMIC_TYPES_CHECKING -} - -MemberId DynamicData::get_array_index( - const std::vector& position) -{ - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_ARRAY) - { - MemberId outPosition(0); - uint32_t offset(1); - if (position.size() == type_->get_bounds_size()) - { - for (int32_t i = static_cast(position.size() - 1); i >= 0; --i) - { - outPosition += position[i] * offset; - offset *= type_->get_bounds(static_cast(i)); - } - return outPosition; - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error getting array index. Invalid dimension count."); - } - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error getting array index. The kind " << get_kind() << "doesn't support it."); - } - return MEMBER_ID_INVALID; -} - -ReturnCode_t DynamicData::insert_array_data( - MemberId indexId) -{ - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_ARRAY) - { -#ifdef DYNAMIC_TYPES_CHECKING - if (indexId < type_->get_total_bounds()) - { - auto it = complex_values_.find(indexId); - if (it != complex_values_.end()) - { - DynamicDataFactory::get_instance()->delete_data(it->second); - complex_values_.erase(it); - } - DynamicData* value = DynamicDataFactory::get_instance()->create_data(type_->get_element_type()); - complex_values_.insert(std::make_pair(indexId, value)); - return eprosima::fastdds::dds::RETCODE_OK; - } -#else - if (indexId < type_->get_total_bounds()) - { - auto it = values_.find(indexId); - if (it != values_.end()) - { - DynamicDataFactory::get_instance()->delete_data((DynamicData*)it->second); - values_.erase(it); - } - DynamicData* value = DynamicDataFactory::get_instance()->create_data(type_->get_element_type()); - values_.insert(std::make_pair(indexId, value)); - return eprosima::fastdds::dds::RETCODE_OK; - } -#endif // ifdef DYNAMIC_TYPES_CHECKING - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting data. Index out of bounds"); - } - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, - "Error inserting data. The kind " << get_kind() << " doesn't support this method"); - } - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; -} - -ReturnCode_t DynamicData::clear_array_data( - MemberId indexId) -{ - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_ARRAY) - { -#ifdef DYNAMIC_TYPES_CHECKING - if (indexId < type_->get_total_bounds()) - { - auto it = complex_values_.find(indexId); - if (it != complex_values_.end()) - { - DynamicDataFactory::get_instance()->delete_data(it->second); - complex_values_.erase(it); - } - return eprosima::fastdds::dds::RETCODE_OK; - } -#else - if (indexId < type_->get_total_bounds()) - { - auto it = values_.find(indexId); - if (it != values_.end()) - { - DynamicDataFactory::get_instance()->delete_data((DynamicData*)it->second); - values_.erase(it); - } - return eprosima::fastdds::dds::RETCODE_OK; - } -#endif // ifdef DYNAMIC_TYPES_CHECKING - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error removing data. Index out of bounds"); - } - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error removing data. The kind " << get_kind() << " doesn't support this method"); - } - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; -} - -ReturnCode_t DynamicData::insert_int32_value( - int32_t value, - MemberId& outId) -{ - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_SEQUENCE && - type_->get_element_type()->get_kind() == eprosima::fastdds::dds::xtypes::TK_INT32) - { - ReturnCode_t result = insert_sequence_data(outId); - if (result == eprosima::fastdds::dds::RETCODE_OK) - { - result = set_int32_value(value, outId); - } - return result; - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting data. The current kinds don't support this method"); - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; - } -} - -ReturnCode_t DynamicData::insert_uint32_value( - uint32_t value, - MemberId& outId) -{ - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_SEQUENCE && - type_->get_element_type()->get_kind() == eprosima::fastdds::dds::xtypes::TK_UINT32) - { - ReturnCode_t result = insert_sequence_data(outId); - if (result == eprosima::fastdds::dds::RETCODE_OK) - { - result = set_uint32_value(value, outId); - } - return result; - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting data. The current kinds don't support this method"); - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; - } -} - -ReturnCode_t DynamicData::insert_int16_value( - int16_t value, - MemberId& outId) -{ - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_SEQUENCE && - type_->get_element_type()->get_kind() == eprosima::fastdds::dds::xtypes::TK_INT16) - { - ReturnCode_t result = insert_sequence_data(outId); - if (result == eprosima::fastdds::dds::RETCODE_OK) - { - result = set_int16_value(value, outId); - } - return result; - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting data. The current kinds don't support this method"); - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; - } -} - -ReturnCode_t DynamicData::insert_uint16_value( - uint16_t value, - MemberId& outId) -{ - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_SEQUENCE && - type_->get_element_type()->get_kind() == eprosima::fastdds::dds::xtypes::TK_UINT16) - { - ReturnCode_t result = insert_sequence_data(outId); - if (result == eprosima::fastdds::dds::RETCODE_OK) - { - result = set_uint16_value(value, outId); - } - return result; - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting data. The current kinds don't support this method"); - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; - } -} - -ReturnCode_t DynamicData::insert_int64_value( - int64_t value, - MemberId& outId) -{ - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_SEQUENCE && - type_->get_element_type()->get_kind() == eprosima::fastdds::dds::xtypes::TK_INT64) - { - ReturnCode_t result = insert_sequence_data(outId); - if (result == eprosima::fastdds::dds::RETCODE_OK) - { - result = set_int64_value(value, outId); - } - return result; - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting data. The current kinds don't support this method"); - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; - } -} - -ReturnCode_t DynamicData::insert_uint64_value( - uint64_t value, - MemberId& outId) -{ - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_SEQUENCE && - type_->get_element_type()->get_kind() == eprosima::fastdds::dds::xtypes::TK_UINT64) - { - ReturnCode_t result = insert_sequence_data(outId); - if (result == eprosima::fastdds::dds::RETCODE_OK) - { - result = set_uint64_value(value, outId); - } - return result; - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting data. The current kinds don't support this method"); - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; - } -} - -ReturnCode_t DynamicData::insert_float32_value( - float value, - MemberId& outId) -{ - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_SEQUENCE && - type_->get_element_type()->get_kind() == eprosima::fastdds::dds::xtypes::TK_FLOAT32) - { - ReturnCode_t result = insert_sequence_data(outId); - if (result == eprosima::fastdds::dds::RETCODE_OK) - { - result = set_float32_value(value, outId); - } - return result; - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting data. The current kinds don't support this method"); - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; - } -} - -ReturnCode_t DynamicData::insert_float64_value( - double value, - MemberId& outId) -{ - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_SEQUENCE && - type_->get_element_type()->get_kind() == eprosima::fastdds::dds::xtypes::TK_FLOAT64) - { - ReturnCode_t result = insert_sequence_data(outId); - if (result == eprosima::fastdds::dds::RETCODE_OK) - { - result = set_float64_value(value, outId); - } - return result; - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting data. The current kinds don't support this method"); - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; - } -} - -ReturnCode_t DynamicData::insert_float128_value( - long double value, - MemberId& outId) -{ - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_SEQUENCE && - type_->get_element_type()->get_kind() == eprosima::fastdds::dds::xtypes::TK_FLOAT128) - { - ReturnCode_t result = insert_sequence_data(outId); - if (result == eprosima::fastdds::dds::RETCODE_OK) - { - result = set_float128_value(value, outId); - } - return result; - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting data. The current kinds don't support this method"); - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; - } -} - -ReturnCode_t DynamicData::insert_char8_value( - char value, - MemberId& outId) -{ - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_SEQUENCE && - type_->get_element_type()->get_kind() == eprosima::fastdds::dds::xtypes::TK_CHAR8) - { - ReturnCode_t result = insert_sequence_data(outId); - if (result == eprosima::fastdds::dds::RETCODE_OK) - { - result = set_char8_value(value, outId); - } - return result; - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting data. The current kinds don't support this method"); - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; - } -} - -ReturnCode_t DynamicData::insert_char16_value( - wchar_t value, - MemberId& outId) -{ - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_SEQUENCE && - type_->get_element_type()->get_kind() == eprosima::fastdds::dds::xtypes::TK_CHAR16) - { - ReturnCode_t result = insert_sequence_data(outId); - if (result == eprosima::fastdds::dds::RETCODE_OK) - { - result = set_char16_value(value, outId); - } - return result; - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting data. The current kinds don't support this method"); - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; - } -} - -ReturnCode_t DynamicData::insert_byte_value( - octet value, - MemberId& outId) -{ - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_SEQUENCE && - type_->get_element_type()->get_kind() == eprosima::fastdds::dds::xtypes::TK_BYTE) - { - ReturnCode_t result = insert_sequence_data(outId); - if (result == eprosima::fastdds::dds::RETCODE_OK) - { - result = set_byte_value(value, outId); - } - return result; - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting data. The current kinds don't support this method"); - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; - } -} - -ReturnCode_t DynamicData::insert_bool_value( - bool value, - MemberId& outId) -{ - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_SEQUENCE && - type_->get_element_type()->get_kind() == eprosima::fastdds::dds::xtypes::TK_BOOLEAN) - { - ReturnCode_t result = insert_sequence_data(outId); - if (result == eprosima::fastdds::dds::RETCODE_OK) - { - result = set_bool_value(value, outId); - } - return result; - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting data. The current kinds don't support this method"); - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; - } -} - -ReturnCode_t DynamicData::insert_string_value( - const std::string& value, - MemberId& outId) -{ - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_SEQUENCE && - type_->get_element_type()->get_kind() == eprosima::fastdds::dds::xtypes::TK_STRING8) - { - ReturnCode_t result = insert_sequence_data(outId); - if (result == eprosima::fastdds::dds::RETCODE_OK) - { - result = set_string_value(value, outId); - } - return result; - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting data. The current kinds don't support this method"); - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; - } -} - -ReturnCode_t DynamicData::insert_wstring_value( - const std::wstring& value, - MemberId& outId) -{ - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_SEQUENCE && - type_->get_element_type()->get_kind() == eprosima::fastdds::dds::xtypes::TK_STRING16) - { - ReturnCode_t result = insert_sequence_data(outId); - if (result == eprosima::fastdds::dds::RETCODE_OK) - { - result = set_wstring_value(value, outId); - } - return result; - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting data. The current kinds don't support this method"); - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; - } -} - -ReturnCode_t DynamicData::insert_enum_value( - const std::string& value, - MemberId& outId) -{ - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_SEQUENCE && - type_->get_element_type()->get_kind() == eprosima::fastdds::dds::xtypes::TK_ENUM) - { - ReturnCode_t result = insert_sequence_data(outId); - if (result == eprosima::fastdds::dds::RETCODE_OK) - { - result = set_enum_value(value, outId); - } - return result; - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting data. The current kinds don't support this method"); - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; - } -} - -ReturnCode_t DynamicData::insert_complex_value( - const DynamicData* value, - MemberId& outId) -{ - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_SEQUENCE && - type_->get_element_type()->equals(value->type_.get())) - { - if (type_->get_bounds() == BOUND_UNLIMITED || get_item_count() < type_->get_bounds()) - { -#ifdef DYNAMIC_TYPES_CHECKING - outId = static_cast(complex_values_.size()); - complex_values_.insert(std::make_pair(outId, DynamicDataFactory::get_instance()->create_copy(value))); - return eprosima::fastdds::dds::RETCODE_OK; -#else - outId = static_cast(values_.size()); - values_.insert(std::make_pair(outId, DynamicDataFactory::get_instance()->create_copy(value))); - return eprosima::fastdds::dds::RETCODE_OK; -#endif // ifdef DYNAMIC_TYPES_CHECKING - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting data. The container is full."); - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; - } - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting data. The current kinds don't support this method"); - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; - } -} - -ReturnCode_t DynamicData::insert_complex_value( - DynamicData_ptr value, - MemberId& outId) -{ - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_SEQUENCE && - type_->get_element_type()->equals(value->type_.get())) - { - if (type_->get_bounds() == BOUND_UNLIMITED || get_item_count() < type_->get_bounds()) - { -#ifdef DYNAMIC_TYPES_CHECKING - outId = static_cast(complex_values_.size()); - complex_values_.insert(std::make_pair(outId, DynamicDataFactory::get_instance()->create_copy(value.get()))); - return eprosima::fastdds::dds::RETCODE_OK; -#else - outId = static_cast(values_.size()); - values_.insert(std::make_pair(outId, DynamicDataFactory::get_instance()->create_copy(value.get()))); - return eprosima::fastdds::dds::RETCODE_OK; -#endif // ifdef DYNAMIC_TYPES_CHECKING - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting data. The container is full."); - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; - } - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting data. The current kinds don't support this method"); - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; - } -} - -ReturnCode_t DynamicData::insert_complex_value( - DynamicData* value, - MemberId& outId) -{ - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_SEQUENCE && - type_->get_element_type()->equals(value->type_.get())) - { - if (type_->get_bounds() == BOUND_UNLIMITED || get_item_count() < type_->get_bounds()) - { -#ifdef DYNAMIC_TYPES_CHECKING - outId = static_cast(complex_values_.size()); - complex_values_.insert(std::make_pair(outId, value)); - return eprosima::fastdds::dds::RETCODE_OK; -#else - outId = static_cast(values_.size()); - values_.insert(std::make_pair(outId, value)); - return eprosima::fastdds::dds::RETCODE_OK; -#endif // ifdef DYNAMIC_TYPES_CHECKING - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting data. The container is full."); - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; - } - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting data. The current kinds don't support this method"); - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; - } -} - -ReturnCode_t DynamicData::insert_sequence_data( - MemberId& outId) -{ - outId = MEMBER_ID_INVALID; - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_SEQUENCE) - { - if (type_->get_bounds() == BOUND_UNLIMITED || get_item_count() < type_->get_bounds()) - { -#ifdef DYNAMIC_TYPES_CHECKING - DynamicData* new_element = DynamicDataFactory::get_instance()->create_data(type_->get_element_type()); - outId = static_cast(complex_values_.size()); - complex_values_.insert(std::make_pair(outId, new_element)); - return eprosima::fastdds::dds::RETCODE_OK; -#else - DynamicData* new_element = DynamicDataFactory::get_instance()->create_data(type_->get_element_type()); - outId = static_cast(values_.size()); - values_.insert(std::make_pair(outId, new_element)); - return eprosima::fastdds::dds::RETCODE_OK; -#endif // ifdef DYNAMIC_TYPES_CHECKING - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting data. The container is full."); - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; - } - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, - "Error inserting data. The kind " << get_kind() << " doesn't support this method"); - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; - } -} - -ReturnCode_t DynamicData::remove_sequence_data( - MemberId id) -{ - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_SEQUENCE || - get_kind() == eprosima::fastdds::dds::xtypes::TK_ARRAY) - { -#ifdef DYNAMIC_TYPES_CHECKING - auto it = complex_values_.find(id); - if (it != complex_values_.end()) - { - DynamicDataFactory::get_instance()->delete_data(it->second); - complex_values_.erase(it); - sort_member_ids(id); - return eprosima::fastdds::dds::RETCODE_OK; - } -#else - auto it = values_.find(id); - if (it != values_.end()) - { - DynamicDataFactory::get_instance()->delete_data((DynamicData*)it->second); - values_.erase(it); - sort_member_ids(id); - return eprosima::fastdds::dds::RETCODE_OK; - } -#endif // ifdef DYNAMIC_TYPES_CHECKING - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error removing data. Member not found"); - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; - } - - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error removing data. The current Kind " << get_kind() - << " doesn't support this method"); - - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; -} - -ReturnCode_t DynamicData::insert_map_data( - const DynamicData* key, - MemberId& outKeyId, - MemberId& outValueId) -{ - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_MAP && type_->get_key_element_type()->equals(key->type_.get())) - { - if (type_->get_bounds() == BOUND_UNLIMITED || get_item_count() < type_->get_bounds()) - { -#ifdef DYNAMIC_TYPES_CHECKING - for (auto it = complex_values_.begin(); it != complex_values_.end(); ++it) - { - if (it->second->key_element_ && it->second->equals(key)) - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting to map. The key already exists."); - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; - } - } - outKeyId = static_cast(complex_values_.size()); - DynamicData* keyCopy = DynamicDataFactory::get_instance()->create_copy(key); - keyCopy->key_element_ = true; - complex_values_.insert(std::make_pair(outKeyId, keyCopy)); - - DynamicData* new_element = DynamicDataFactory::get_instance()->create_data(type_->get_element_type()); - outValueId = static_cast(complex_values_.size()); - complex_values_.insert(std::make_pair(outValueId, new_element)); - return eprosima::fastdds::dds::RETCODE_OK; -#else - for (auto it = values_.begin(); it != values_.end(); ++it) - { - if (((DynamicData*)it->second)->key_element_ && ((DynamicData*)it->second)->equals(key)) - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting to map. The key already exists."); - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; - } - } - outKeyId = static_cast(values_.size()); - DynamicData* keyCopy = DynamicDataFactory::get_instance()->create_copy(key); - keyCopy->key_element_ = true; - values_.insert(std::make_pair(outKeyId, keyCopy)); - - DynamicData* new_element = DynamicDataFactory::get_instance()->create_data(type_->get_element_type()); - outValueId = static_cast(values_.size()); - values_.insert(std::make_pair(outValueId, new_element)); - return eprosima::fastdds::dds::RETCODE_OK; -#endif // ifdef DYNAMIC_TYPES_CHECKING - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting to map. The map is full"); - return eprosima::fastdds::dds::RETCODE_ERROR; - } - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting to map. The current Kind " << get_kind() - << " doesn't support this method"); - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; - } -} - -ReturnCode_t DynamicData::insert_map_data( - const DynamicData* key, - DynamicData* value, - MemberId& outKey, - MemberId& outValue) -{ - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_MAP && - type_->get_key_element_type()->equals(key->type_.get()) && - type_->get_element_type()->equals(value->type_.get())) - { - if (type_->get_bounds() == BOUND_UNLIMITED || get_item_count() < type_->get_bounds()) - { -#ifdef DYNAMIC_TYPES_CHECKING - for (auto it = complex_values_.begin(); it != complex_values_.end(); ++it) - { - if (it->second->key_element_ && it->second->equals(key)) - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting to map. The key already exists."); - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; - } - } - outKey = static_cast(complex_values_.size()); - DynamicData* keyCopy = DynamicDataFactory::get_instance()->create_copy(key); - keyCopy->key_element_ = true; - complex_values_.insert(std::make_pair(outKey, keyCopy)); - - outValue = static_cast(complex_values_.size()); - complex_values_.insert(std::make_pair(outValue, value)); - return eprosima::fastdds::dds::RETCODE_OK; -#else - for (auto it = values_.begin(); it != values_.end(); ++it) - { - if (it->second == key) - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting to map. The key already exists."); - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; - } - } - outKey = static_cast(values_.size()); - DynamicData* keyCopy = DynamicDataFactory::get_instance()->create_copy(key); - keyCopy->key_element_ = true; - values_.insert(std::make_pair(outKey, keyCopy)); - - outValue = static_cast(values_.size()); - values_.insert(std::make_pair(outValue, value)); - return eprosima::fastdds::dds::RETCODE_OK; -#endif // ifdef DYNAMIC_TYPES_CHECKING - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting to map. The map is full"); - return eprosima::fastdds::dds::RETCODE_ERROR; - } - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting to map. The current Kind " << get_kind() - << " doesn't support this method"); - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; - } -} - -ReturnCode_t DynamicData::insert_map_data( - const DynamicData* key, - const DynamicData* value, - MemberId& outKey, - MemberId& outValue) -{ - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_MAP && - type_->get_key_element_type()->equals(key->type_.get()) && - type_->get_element_type()->equals(value->type_.get())) - { - if (type_->get_bounds() == BOUND_UNLIMITED || get_item_count() < type_->get_bounds()) - { -#ifdef DYNAMIC_TYPES_CHECKING - for (auto it = complex_values_.begin(); it != complex_values_.end(); ++it) - { - if (it->second->key_element_ && it->second->equals(key)) - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting to map. The key already exists."); - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; - } - } - outKey = static_cast(complex_values_.size()); - DynamicData* keyCopy = DynamicDataFactory::get_instance()->create_copy(key); - keyCopy->key_element_ = true; - complex_values_.insert(std::make_pair(outKey, keyCopy)); - - outValue = static_cast(complex_values_.size()); - DynamicData* valueCopy = DynamicDataFactory::get_instance()->create_copy(value); - complex_values_.insert(std::make_pair(outValue, valueCopy)); - return eprosima::fastdds::dds::RETCODE_OK; -#else - for (auto it = values_.begin(); it != values_.end(); ++it) - { - if (it->second == key) - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting to map. The key already exists."); - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; - } - } - outKey = static_cast(values_.size()); - DynamicData* keyCopy = DynamicDataFactory::get_instance()->create_copy(key); - keyCopy->key_element_ = true; - values_.insert(std::make_pair(outKey, keyCopy)); - - outValue = static_cast(values_.size()); - DynamicData* valueCopy = DynamicDataFactory::get_instance()->create_copy(value); - values_.insert(std::make_pair(outValue, valueCopy)); - return eprosima::fastdds::dds::RETCODE_OK; -#endif // ifdef DYNAMIC_TYPES_CHECKING - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting to map. The map is full"); - return eprosima::fastdds::dds::RETCODE_ERROR; - } - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting to map. The current Kind " << get_kind() - << " doesn't support this method"); - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; - } -} - -ReturnCode_t DynamicData::insert_map_data( - const DynamicData* key, - DynamicData_ptr value, - MemberId& outKey, - MemberId& outValue) -{ - return insert_map_data(key, reinterpret_cast(value.get()), outKey, outValue); -} - -ReturnCode_t DynamicData::remove_map_data( - MemberId keyId) -{ - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_MAP) - { -#ifdef DYNAMIC_TYPES_CHECKING - auto itKey = complex_values_.find(keyId); - auto itValue = complex_values_.find(keyId + 1); - if (itKey != complex_values_.end() && itValue != complex_values_.end() && itKey->second->key_element_) - { - DynamicDataFactory::get_instance()->delete_data(itKey->second); - DynamicDataFactory::get_instance()->delete_data(itValue->second); - complex_values_.erase(itKey); - complex_values_.erase(itValue); - sort_member_ids(keyId); - return eprosima::fastdds::dds::RETCODE_OK; - } -#else - auto itKey = values_.find(keyId); - auto itValue = values_.find(keyId + 1); - if (itKey != values_.end() && itValue != values_.end() && ((DynamicData*)itKey->second)->key_element_) - { - DynamicDataFactory::get_instance()->delete_data(((DynamicData*)itKey->second)); - DynamicDataFactory::get_instance()->delete_data(((DynamicData*)itValue->second)); - values_.erase(itKey); - values_.erase(itValue); - sort_member_ids(keyId); - return eprosima::fastdds::dds::RETCODE_OK; - } -#endif // ifdef DYNAMIC_TYPES_CHECKING - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error removing from map. Invalid input KeyId"); - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; - } - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error removing from map. The current Kind " << get_kind() - << " doesn't support this method"); - return eprosima::fastdds::dds::RETCODE_ERROR; - } -} - -ReturnCode_t DynamicData::clear_data() -{ - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_SEQUENCE || - get_kind() == eprosima::fastdds::dds::xtypes::TK_MAP || - get_kind() == eprosima::fastdds::dds::xtypes::TK_ARRAY) - { -#ifdef DYNAMIC_TYPES_CHECKING - for (auto it = complex_values_.begin(); it != complex_values_.end(); ++it) - { - DynamicDataFactory::get_instance()->delete_data(it->second); - } - complex_values_.clear(); -#else - for (auto it = values_.begin(); it != values_.end(); ++it) - { - DynamicDataFactory::get_instance()->delete_data((DynamicData*)it->second); - } - values_.clear(); -#endif // ifdef DYNAMIC_TYPES_CHECKING - return eprosima::fastdds::dds::RETCODE_OK; - } - - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error clearing data. The current Kind " << get_kind() - << " doesn't support this method"); - - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; -} - -ReturnCode_t DynamicData::get_complex_value( - DynamicData** value, - MemberId id) const -{ - // Check that the type is complex and in case of dynamic containers, check that the index is valid - if (id != MEMBER_ID_INVALID && - (get_kind() == eprosima::fastdds::dds::xtypes::TK_STRUCTURE || - get_kind() == eprosima::fastdds::dds::xtypes::TK_UNION || - get_kind() == eprosima::fastdds::dds::xtypes::TK_SEQUENCE || - get_kind() == eprosima::fastdds::dds::xtypes::TK_ARRAY || - get_kind() == eprosima::fastdds::dds::xtypes::TK_MAP || - get_kind() == eprosima::fastdds::dds::xtypes::TK_BITSET)) - { -#ifdef DYNAMIC_TYPES_CHECKING - auto it = complex_values_.find(id); - if (it != complex_values_.end()) - { - *value = DynamicDataFactory::get_instance()->create_copy(it->second); - return eprosima::fastdds::dds::RETCODE_OK; - } - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; -#else - auto it = values_.find(id); - if (it != values_.end()) - { - *value = DynamicDataFactory::get_instance()->create_copy((DynamicData*)it->second); - return eprosima::fastdds::dds::RETCODE_OK; - } - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; -#endif // ifdef DYNAMIC_TYPES_CHECKING - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error settings complex value. The kind " << get_kind() << "doesn't support it"); - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; - } -} - -ReturnCode_t DynamicData::set_complex_value( - DynamicData* value, - MemberId id) -{ - // Check that the type is complex and in case of dynamic containers, check that the index is valid - if (id != MEMBER_ID_INVALID && - (get_kind() == eprosima::fastdds::dds::xtypes::TK_STRUCTURE || - get_kind() == eprosima::fastdds::dds::xtypes::TK_UNION || - get_kind() == eprosima::fastdds::dds::xtypes::TK_SEQUENCE || - get_kind() == eprosima::fastdds::dds::xtypes::TK_ARRAY || - get_kind() == eprosima::fastdds::dds::xtypes::TK_MAP || - get_kind() == eprosima::fastdds::dds::xtypes::TK_BITSET)) - { - // With containers, check that the index is valid - if ((get_kind() == eprosima::fastdds::dds::xtypes::TK_SEQUENCE || - get_kind() == eprosima::fastdds::dds::xtypes::TK_ARRAY || - get_kind() == eprosima::fastdds::dds::xtypes::TK_MAP) && - id < type_->get_total_bounds()) - { -#ifdef DYNAMIC_TYPES_CHECKING - auto it = complex_values_.find(id); - if (it != complex_values_.end()) - { - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_MAP && it->second->key_element_) - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error setting complex Value. They given id is a Key value."); - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; - } - else - { - if (it->second != nullptr) - { - DynamicDataFactory::get_instance()->delete_data(it->second); - } - complex_values_.erase(it); - - complex_values_.insert(std::make_pair(id, value)); - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_UNION && union_id_ != id) - { - set_union_id(id); - } - } - } - else if (get_kind() == eprosima::fastdds::dds::xtypes::TK_ARRAY) - { - complex_values_.insert(std::make_pair(id, value)); - return eprosima::fastdds::dds::RETCODE_OK; - } - -#else - auto it = values_.find(id); - if (it != values_.end()) - { - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_MAP && ((DynamicData*)it->second)->key_element_) - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error setting complex Value. They given id is a Key value."); - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; - } - else - { - if (it->second != nullptr) - { - DynamicDataFactory::get_instance()->delete_data((DynamicData*)it->second); - } - values_.erase(it); - values_.insert(std::make_pair(id, value)); - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_UNION && union_id_ != id) - { - set_union_id(id); - } - } - } - else if (get_kind() == eprosima::fastdds::dds::xtypes::TK_ARRAY) - { - values_.insert(std::make_pair(id, value)); - return eprosima::fastdds::dds::RETCODE_OK; - } -#endif // ifdef DYNAMIC_TYPES_CHECKING - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error setting complex Value. id out of bounds."); - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; - } - return eprosima::fastdds::dds::RETCODE_OK; - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error settings complex value. The kind " << get_kind() << "doesn't support it"); - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; - } -} - -ReturnCode_t DynamicData::get_union_label( - uint64_t& value) const -{ - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_UNION) - { - if (union_id_ != MEMBER_ID_INVALID) - { - value = union_label_; - return eprosima::fastdds::dds::RETCODE_OK; - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error getting union label. There isn't any label selected"); - return eprosima::fastdds::dds::RETCODE_ERROR; - } - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error getting union label. The kind " << get_kind() << "doesn't support it"); - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; - } -} - -bool DynamicData::deserialize( - eprosima::fastcdr::Cdr& cdr) -{ - if (type_ != nullptr && type_->get_descriptor()->annotation_is_non_serialized()) - { - return true; - } - - switch (get_kind()) - { - default: - break; - case eprosima::fastdds::dds::xtypes::TK_INT32: - { -#ifdef DYNAMIC_TYPES_CHECKING - cdr >> int32_value_; - -#else - auto it = values_.begin(); - cdr >> *((int32_t*)it->second); -#endif // ifdef DYNAMIC_TYPES_CHECKING - break; - } - case eprosima::fastdds::dds::xtypes::TK_UINT32: - { -#ifdef DYNAMIC_TYPES_CHECKING - cdr >> uint32_value_; - -#else - auto it = values_.begin(); - cdr >> *((uint32_t*)it->second); -#endif // ifdef DYNAMIC_TYPES_CHECKING - break; - } - case eprosima::fastdds::dds::xtypes::TK_INT16: - { -#ifdef DYNAMIC_TYPES_CHECKING - cdr >> int16_value_; - -#else - auto it = values_.begin(); - cdr >> *((int16_t*)it->second); -#endif // ifdef DYNAMIC_TYPES_CHECKING - break; - } - case eprosima::fastdds::dds::xtypes::TK_UINT16: - { -#ifdef DYNAMIC_TYPES_CHECKING - cdr >> uint16_value_; - -#else - auto it = values_.begin(); - cdr >> *((uint16_t*)it->second); -#endif // ifdef DYNAMIC_TYPES_CHECKING - break; - } - case eprosima::fastdds::dds::xtypes::TK_INT64: - { -#ifdef DYNAMIC_TYPES_CHECKING - cdr >> int64_value_; - -#else - auto it = values_.begin(); - cdr >> *((int64_t*)it->second); -#endif // ifdef DYNAMIC_TYPES_CHECKING - break; - } - case eprosima::fastdds::dds::xtypes::TK_UINT64: - { -#ifdef DYNAMIC_TYPES_CHECKING - cdr >> uint64_value_; - -#else - auto it = values_.begin(); - cdr >> *((uint64_t*)it->second); -#endif // ifdef DYNAMIC_TYPES_CHECKING - break; - } - case eprosima::fastdds::dds::xtypes::TK_FLOAT32: - { -#ifdef DYNAMIC_TYPES_CHECKING - cdr >> float32_value_; -#else - auto it = values_.begin(); - cdr >> *((float*)it->second); -#endif // ifdef DYNAMIC_TYPES_CHECKING - break; - } - case eprosima::fastdds::dds::xtypes::TK_FLOAT64: - { -#ifdef DYNAMIC_TYPES_CHECKING - cdr >> float64_value_; - -#else - auto it = values_.begin(); - cdr >> *((double*)it->second); -#endif // ifdef DYNAMIC_TYPES_CHECKING - break; - } - case eprosima::fastdds::dds::xtypes::TK_FLOAT128: - { -#ifdef DYNAMIC_TYPES_CHECKING - cdr >> float128_value_; - -#else - auto it = values_.begin(); - cdr >> *((long double*)it->second); -#endif // ifdef DYNAMIC_TYPES_CHECKING - break; - } - case eprosima::fastdds::dds::xtypes::TK_CHAR8: - { -#ifdef DYNAMIC_TYPES_CHECKING - cdr >> char8_value_; - -#else - auto it = values_.begin(); - cdr >> *((char*)it->second); -#endif // ifdef DYNAMIC_TYPES_CHECKING - break; - } - case eprosima::fastdds::dds::xtypes::TK_CHAR16: - { -#ifdef DYNAMIC_TYPES_CHECKING - cdr >> char16_value_; - -#else - auto it = values_.begin(); - cdr >> *((wchar_t*)it->second); -#endif // ifdef DYNAMIC_TYPES_CHECKING - break; - } - case eprosima::fastdds::dds::xtypes::TK_BOOLEAN: - { -#ifdef DYNAMIC_TYPES_CHECKING - cdr >> bool_value_; - -#else - auto it = values_.begin(); - cdr >> *((bool*)it->second); -#endif // ifdef DYNAMIC_TYPES_CHECKING - break; - } - case eprosima::fastdds::dds::xtypes::TK_BYTE: - { -#ifdef DYNAMIC_TYPES_CHECKING - cdr >> byte_value_; - -#else - auto it = values_.begin(); - cdr >> *((octet*)it->second); -#endif // ifdef DYNAMIC_TYPES_CHECKING - break; - } - case eprosima::fastdds::dds::xtypes::TK_STRING8: - { -#ifdef DYNAMIC_TYPES_CHECKING - cdr >> string_value_; - -#else - auto it = values_.begin(); - cdr >> *((std::string*)it->second); -#endif // ifdef DYNAMIC_TYPES_CHECKING - break; - } - case eprosima::fastdds::dds::xtypes::TK_STRING16: - { -#ifdef DYNAMIC_TYPES_CHECKING - cdr >> wstring_value_; - -#else - auto it = values_.begin(); - cdr >> *((std::wstring*)it->second); -#endif // ifdef DYNAMIC_TYPES_CHECKING - break; - } - case eprosima::fastdds::dds::xtypes::TK_ENUM: - { -#ifdef DYNAMIC_TYPES_CHECKING - cdr >> uint32_value_; - -#else - auto it = values_.begin(); - cdr >> *((uint32_t*)it->second); -#endif // ifdef DYNAMIC_TYPES_CHECKING - break; - } - case eprosima::fastdds::dds::xtypes::TK_BITMASK: - { - size_t type_size = type_->get_size(); -#ifdef DYNAMIC_TYPES_CHECKING - switch (type_size) - { - case 1: - { - uint8_t temp; - cdr >> temp; - uint64_value_ = temp; - break; - } - case 2: - { - uint16_t temp; - cdr >> temp; - uint64_value_ = temp; - break; - } - case 3: - { - uint32_t temp; - cdr >> temp; - uint64_value_ = temp; - break; - } - case 4: cdr >> uint64_value_; break; - default: EPROSIMA_LOG_ERROR(DYN_TYPES, "Cannot deserialize bitmask of size " << type_size); - } -#else - auto it = values_.begin(); - switch (type_size) - { - case 1: cdr >> *((uint8_t*)it->second); break; - case 2: cdr >> *((uint16_t*)it->second); break; - case 3: cdr >> *((uint32_t*)it->second); break; - case 4: cdr >> *((uint64_t*)it->second); break; - default: EPROSIMA_LOG_ERROR(DYN_TYPES, "Cannot deserialize bitmask of size " << type_size); - } -#endif // ifdef DYNAMIC_TYPES_CHECKING - break; - } - case eprosima::fastdds::dds::xtypes::TK_UNION: - { - union_discriminator_->deserialize_discriminator(cdr); - update_union_discriminator(); - set_union_id(union_id_); - if (union_id_ != MEMBER_ID_INVALID) - { - -#ifdef DYNAMIC_TYPES_CHECKING - auto it = complex_values_.find(union_id_); - if (it != complex_values_.end()) - { - it->second->deserialize(cdr); - } -#else - auto it = values_.find(union_id_); - if (it != values_.end()) - { - ((DynamicData*)it->second)->deserialize(cdr); - } -#endif // ifdef DYNAMIC_TYPES_CHECKING - } - break; - } - case eprosima::fastdds::dds::xtypes::TK_STRUCTURE: - case eprosima::fastdds::dds::xtypes::TK_BITSET: - { -#ifdef DYNAMIC_TYPES_CHECKING - //uint32_t size(static_cast(complex_values_.size())), memberId(MEMBER_ID_INVALID); - for (uint32_t i = 0; i < complex_values_.size(); ++i) - { - //cdr >> memberId; - MemberDescriptor* member_desc = descriptors_[i]; - if (member_desc != nullptr) - { - if (!member_desc->annotation_is_non_serialized()) - { - auto it = complex_values_.find(i); - if (it != complex_values_.end()) - { - it->second->deserialize(cdr); - } - else - { - DynamicData* pData = DynamicDataFactory::get_instance()->create_data( - type_->get_element_type()); - pData->deserialize(cdr); - complex_values_.insert(std::make_pair(i, pData)); - } - } - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Missing MemberDescriptor " << i); - } - } -#else - //uint32_t size(static_cast(values_.size())), memberId(MEMBER_ID_INVALID); - for (uint32_t i = 0; i < values_.size(); ++i) - { - //cdr >> memberId; - MemberDescriptor* member_desc = descriptors_[i]; - if (member_desc != nullptr) - { - if (!member_desc->annotation_is_non_serialized()) - { - auto it = values_.find(i); - if (it != values_.end()) - { - ((DynamicData*)it->second)->deserialize(cdr); - } - else - { - DynamicData* pData = DynamicDataFactory::get_instance()->create_data( - type_->get_element_type()); - pData->deserialize(cdr); - values_.insert(std::make_pair(i, pData)); - } - } - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Missing MemberDescriptor " << i); - } - } -#endif // ifdef DYNAMIC_TYPES_CHECKING - } - break; - case eprosima::fastdds::dds::xtypes::TK_ARRAY: - { - uint32_t size(type_->get_total_bounds()); - if (size > 0) - { - DynamicData* inputData(nullptr); - for (uint32_t i = 0; i < size; ++i) - { -#ifdef DYNAMIC_TYPES_CHECKING - auto it = complex_values_.find(i); - if (it != complex_values_.end()) - { - it->second->deserialize(cdr); - } - else - { - if (inputData == nullptr) - { - inputData = DynamicDataFactory::get_instance()->create_data(type_->get_element_type()); - } - - inputData->deserialize(cdr); - if (!inputData->equals(default_array_value_)) - { - complex_values_.insert(std::make_pair(i, inputData)); - inputData = nullptr; - } - } -#else - auto it = values_.find(i); - if (it != values_.end()) - { - ((DynamicData*)it->second)->deserialize(cdr); - } - else - { - if (inputData == nullptr) - { - inputData = DynamicDataFactory::get_instance()->create_data(type_->get_element_type()); - } - - inputData->deserialize(cdr); - if (!inputData->equals(default_array_value_)) - { - values_.insert(std::make_pair(i, inputData)); - inputData = nullptr; - } - } -#endif // ifdef DYNAMIC_TYPES_CHECKING - } - if (inputData != nullptr) - { - DynamicDataFactory::get_instance()->delete_data(inputData); - } - } - break; - } - case eprosima::fastdds::dds::xtypes::TK_SEQUENCE: - case eprosima::fastdds::dds::xtypes::TK_MAP: - { - uint32_t size(0); - bool bKeyElement(false); - cdr >> size; - - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_MAP) - { - size *= 2; // We serialize the number of pairs. - } - for (uint32_t i = 0; i < size; ++i) - { - //cdr >> memberId; - if (get_kind() == eprosima::fastdds::dds::xtypes::TK_MAP) - { - bKeyElement = !bKeyElement; - } - -#ifdef DYNAMIC_TYPES_CHECKING - auto it = complex_values_.find(i); - if (it != complex_values_.end()) - { - it->second->deserialize(cdr); - it->second->key_element_ = bKeyElement; - } - else - { - DynamicData* pData = nullptr; - if (bKeyElement) - { - pData = DynamicDataFactory::get_instance()->create_data(type_->get_key_element_type()); - } - else - { - pData = DynamicDataFactory::get_instance()->create_data(type_->get_element_type()); - } - pData->deserialize(cdr); - pData->key_element_ = bKeyElement; - complex_values_.insert(std::make_pair(i, pData)); - } -#else - auto it = values_.find(i); - if (it != values_.end()) - { - ((DynamicData*)it->second)->deserialize(cdr); - ((DynamicData*)it->second)->key_element_ = bKeyElement; - } - else - { - DynamicData* pData = nullptr; - if (bKeyElement) - { - pData = DynamicDataFactory::get_instance()->create_data(type_->get_key_element_type()); - } - else - { - pData = DynamicDataFactory::get_instance()->create_data(type_->get_element_type()); - } - pData->deserialize(cdr); - pData->key_element_ = bKeyElement; - values_.insert(std::make_pair(i, pData)); - } -#endif // ifdef DYNAMIC_TYPES_CHECKING - } - break; - } - - case eprosima::fastdds::dds::xtypes::TK_ALIAS: - break; - } - return true; -} - -bool DynamicData::deserialize_discriminator( - eprosima::fastcdr::Cdr& cdr) -{ - switch (get_kind()) - { - case eprosima::fastdds::dds::xtypes::TK_INT32: - { - int32_t aux; - cdr >> aux; - discriminator_value_ = static_cast(aux); - break; - } - case eprosima::fastdds::dds::xtypes::TK_UINT32: - { - uint32_t aux; - cdr >> aux; - discriminator_value_ = static_cast(aux); - break; - } - case eprosima::fastdds::dds::xtypes::TK_INT16: - { - int16_t aux; - cdr >> aux; - discriminator_value_ = static_cast(aux); - break; - } - case eprosima::fastdds::dds::xtypes::TK_UINT16: - { - uint16_t aux; - cdr >> aux; - discriminator_value_ = static_cast(aux); - break; - } - case eprosima::fastdds::dds::xtypes::TK_INT64: - { - int64_t aux; - cdr >> aux; - discriminator_value_ = static_cast(aux); - break; - } - case eprosima::fastdds::dds::xtypes::TK_UINT64: - { - uint64_t aux; - cdr >> aux; - discriminator_value_ = static_cast(aux); - break; - } - case eprosima::fastdds::dds::xtypes::TK_CHAR8: - { - char aux; - cdr >> aux; - discriminator_value_ = static_cast(aux); - break; - } - case eprosima::fastdds::dds::xtypes::TK_CHAR16: - { - wchar_t aux; - cdr >> aux; - discriminator_value_ = static_cast(aux); - break; - } - case eprosima::fastdds::dds::xtypes::TK_BOOLEAN: - { - bool aux; - cdr >> aux; - discriminator_value_ = static_cast(aux); - break; - } - case eprosima::fastdds::dds::xtypes::TK_BYTE: - { - octet aux; - cdr >> aux; - discriminator_value_ = static_cast(aux); - break; - } - case eprosima::fastdds::dds::xtypes::TK_ENUM: - { - uint32_t aux; - cdr >> aux; - discriminator_value_ = static_cast(aux); - break; - } - case eprosima::fastdds::dds::xtypes::TK_FLOAT32: - case eprosima::fastdds::dds::xtypes::TK_FLOAT64: - case eprosima::fastdds::dds::xtypes::TK_FLOAT128: - case eprosima::fastdds::dds::xtypes::TK_STRING8: - case eprosima::fastdds::dds::xtypes::TK_STRING16: - case eprosima::fastdds::dds::xtypes::TK_BITMASK: - case eprosima::fastdds::dds::xtypes::TK_UNION: - case eprosima::fastdds::dds::xtypes::TK_STRUCTURE: - case eprosima::fastdds::dds::xtypes::TK_BITSET: - case eprosima::fastdds::dds::xtypes::TK_ARRAY: - case eprosima::fastdds::dds::xtypes::TK_SEQUENCE: - case eprosima::fastdds::dds::xtypes::TK_MAP: - case eprosima::fastdds::dds::xtypes::TK_ALIAS: - default: - break; - } - return true; -} - -size_t DynamicData::getCdrSerializedSize( - const DynamicData* data, - size_t current_alignment /*= 0*/) -{ - if (data->type_ != nullptr && data->type_->get_descriptor()->annotation_is_non_serialized()) - { - return 0; - } - - size_t initial_alignment = current_alignment; - - switch (data->get_kind()) - { - default: - break; - case eprosima::fastdds::dds::xtypes::TK_INT32: - case eprosima::fastdds::dds::xtypes::TK_UINT32: - case eprosima::fastdds::dds::xtypes::TK_FLOAT32: - case eprosima::fastdds::dds::xtypes::TK_ENUM: - case eprosima::fastdds::dds::xtypes::TK_CHAR16: // WCHARS NEED 32 Bits on Linux & MacOS - { - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - break; - } - case eprosima::fastdds::dds::xtypes::TK_INT16: - case eprosima::fastdds::dds::xtypes::TK_UINT16: - { - current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - break; - } - case eprosima::fastdds::dds::xtypes::TK_INT64: - case eprosima::fastdds::dds::xtypes::TK_UINT64: - case eprosima::fastdds::dds::xtypes::TK_FLOAT64: - { - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - break; - } - case eprosima::fastdds::dds::xtypes::TK_BITMASK: - { - size_t type_size = data->type_->get_size(); - current_alignment += type_size + eprosima::fastcdr::Cdr::alignment(current_alignment, type_size); - break; - } - case eprosima::fastdds::dds::xtypes::TK_FLOAT128: - { - current_alignment += 16 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - break; - } - case eprosima::fastdds::dds::xtypes::TK_CHAR8: - case eprosima::fastdds::dds::xtypes::TK_BOOLEAN: - case eprosima::fastdds::dds::xtypes::TK_BYTE: - { - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - break; - } - case eprosima::fastdds::dds::xtypes::TK_STRING8: - { -#ifdef DYNAMIC_TYPES_CHECKING - // string content (length + characters + 1) - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + - data->string_value_.length() + 1; -#else - auto it = data->values_.begin(); - // string content (length + characters + 1) - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + - ((std::string*)it->second)->length() + 1; -#endif // ifdef DYNAMIC_TYPES_CHECKING - break; - } - case eprosima::fastdds::dds::xtypes::TK_STRING16: - { -#ifdef DYNAMIC_TYPES_CHECKING - // string content (length + (characters * 4) ) - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + - ((data->wstring_value_.length()) * 4); -#else - auto it = data->values_.begin(); - // string content (length + (characters * 4) ) - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + - (((std::wstring*)it->second)->length() * 4); -#endif // ifdef DYNAMIC_TYPES_CHECKING - break; - } - case eprosima::fastdds::dds::xtypes::TK_UNION: - { - // Union discriminator - current_alignment += getCdrSerializedSize(data->union_discriminator_, current_alignment); - - if (data->union_id_ != MEMBER_ID_INVALID) - { -#ifdef DYNAMIC_TYPES_CHECKING - auto it = data->complex_values_.at(data->union_id_); -#else - auto it = (DynamicData*)data->values_.at(data->union_id_); -#endif // ifdef DYNAMIC_TYPES_CHECKING - current_alignment += getCdrSerializedSize(it, current_alignment); - } - break; - } - case eprosima::fastdds::dds::xtypes::TK_STRUCTURE: - case eprosima::fastdds::dds::xtypes::TK_BITSET: - { -#ifdef DYNAMIC_TYPES_CHECKING - //for (auto it = data->complex_values_.begin(); it != data->complex_values_.end(); ++it) - //{ - // current_alignment += getCdrSerializedSize(it->second, current_alignment); - //} - for (uint32_t i = 0; i < data->complex_values_.size(); ++i) - { - //cdr >> memberId; - auto d_it = data->descriptors_.find(i); - if (d_it != data->descriptors_.end()) - { - const MemberDescriptor* member_desc = d_it->second; - if (!member_desc->annotation_is_non_serialized()) - { - auto it = data->complex_values_.find(i); - if (it != data->complex_values_.end()) - { - current_alignment += getCdrSerializedSize(it->second, current_alignment); - } - } - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Missing MemberDescriptor " << i); - } - } - -#else - //for (auto it = data->values_.begin(); it != data->values_.end(); ++it) - //{ - // current_alignment += getCdrSerializedSize((DynamicData*)it->second, current_alignment); - //} - for (uint32_t i = 0; i < data->values_.size(); ++i) - { - //cdr >> memberId; - auto d_it = data->descriptors_.find(i); - if (d_it != data->descriptors_.end()) - { - const MemberDescriptor* member_desc = d_it->second; - if (!member_desc->annotation_is_non_serialized()) - { - auto it = data->values_.find(i); - if (it != data->values_.end()) - { - current_alignment += getCdrSerializedSize((DynamicData*)it->second, current_alignment); - } - } - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Missing MemberDescriptor " << i); - } - } -#endif // ifdef DYNAMIC_TYPES_CHECKING - break; - } - case eprosima::fastdds::dds::xtypes::TK_ARRAY: - { - uint32_t arraySize = data->type_->get_total_bounds(); - size_t emptyElementSize = - getEmptyCdrSerializedSize(data->type_->get_element_type().get(), current_alignment); - for (uint32_t idx = 0; idx < arraySize; ++idx) - { -#ifdef DYNAMIC_TYPES_CHECKING - auto it = data->complex_values_.find(idx); - if (it != data->complex_values_.end()) -#else - auto it = data->values_.find(idx); - if (it != data->values_.end()) -#endif // ifdef DYNAMIC_TYPES_CHECKING - { - // Element Size - current_alignment += getCdrSerializedSize((DynamicData*)it->second, current_alignment); - } - else - { - current_alignment += emptyElementSize; - } - } - break; - } - case eprosima::fastdds::dds::xtypes::TK_SEQUENCE: - case eprosima::fastdds::dds::xtypes::TK_MAP: - { - // Elements count - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); -#ifdef DYNAMIC_TYPES_CHECKING - for (auto it = data->complex_values_.begin(); it != data->complex_values_.end(); ++it) - { - // Element Size - current_alignment += getCdrSerializedSize(it->second, current_alignment); - } -#else - for (auto it = data->values_.begin(); it != data->values_.end(); ++it) - { - // Element Size - current_alignment += getCdrSerializedSize((DynamicData*)it->second, current_alignment); - } -#endif // ifdef DYNAMIC_TYPES_CHECKING - break; - } - case eprosima::fastdds::dds::xtypes::TK_ALIAS: - break; - } - - return current_alignment - initial_alignment; -} - -size_t DynamicData::getKeyMaxCdrSerializedSize( - const DynamicType_ptr type, - size_t current_alignment /*= 0*/) -{ - size_t initial_alignment = current_alignment; - - // Structures check the the size of the key for their children - if (type->get_kind() == eprosima::fastdds::dds::xtypes::TK_STRUCTURE || - type->get_kind() == eprosima::fastdds::dds::xtypes::TK_BITSET) - { - for (auto it = type->member_by_id_.begin(); it != type->member_by_id_.end(); ++it) - { - if (it->second->key_annotation()) - { - current_alignment += getKeyMaxCdrSerializedSize(it->second->descriptor_.type_, current_alignment); - } - } - } - else if (type->is_key_defined_) - { - return getMaxCdrSerializedSize(type, current_alignment); - } - return current_alignment - initial_alignment; -} - -size_t DynamicData::getMaxCdrSerializedSize( - const DynamicType_ptr type, - size_t current_alignment /*= 0*/) -{ - if (type->get_descriptor()->annotation_is_non_serialized()) - { - return 0; - } - - size_t initial_alignment = current_alignment; - - switch (type->get_kind()) - { - default: - break; - case eprosima::fastdds::dds::xtypes::TK_INT32: - case eprosima::fastdds::dds::xtypes::TK_UINT32: - case eprosima::fastdds::dds::xtypes::TK_FLOAT32: - case eprosima::fastdds::dds::xtypes::TK_ENUM: - case eprosima::fastdds::dds::xtypes::TK_CHAR16: // WCHARS NEED 32 Bits on Linux & MacOS - { - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - break; - } - case eprosima::fastdds::dds::xtypes::TK_INT16: - case eprosima::fastdds::dds::xtypes::TK_UINT16: - { - current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - break; - } - case eprosima::fastdds::dds::xtypes::TK_INT64: - case eprosima::fastdds::dds::xtypes::TK_UINT64: - case eprosima::fastdds::dds::xtypes::TK_FLOAT64: - { - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - break; - } - case eprosima::fastdds::dds::xtypes::TK_BITMASK: - { - size_t type_size = type->get_size(); - current_alignment += type_size + eprosima::fastcdr::Cdr::alignment(current_alignment, type_size); - break; - } - case eprosima::fastdds::dds::xtypes::TK_FLOAT128: - { - current_alignment += 16 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - break; - } - case eprosima::fastdds::dds::xtypes::TK_CHAR8: - case eprosima::fastdds::dds::xtypes::TK_BOOLEAN: - case eprosima::fastdds::dds::xtypes::TK_BYTE: - { - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - break; - } - case eprosima::fastdds::dds::xtypes::TK_STRING8: - { - // string length + string content + 1 - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + type->get_bounds() + 1; - break; - } - case eprosima::fastdds::dds::xtypes::TK_STRING16: - { - // string length + ( string content * 4 ) - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + (type->get_bounds() * 4); - - break; - } - case eprosima::fastdds::dds::xtypes::TK_UNION: - { - // union id - current_alignment += getMaxCdrSerializedSize(type->get_discriminator_type(), current_alignment); - - // Check the size of all members and take the size of the biggest one. - size_t temp_size(0); - size_t max_element_size(0); - for (auto it = type->member_by_id_.begin(); it != type->member_by_id_.end(); ++it) - { - temp_size = getMaxCdrSerializedSize(it->second->descriptor_.type_, current_alignment); - if (temp_size > max_element_size) - { - max_element_size = temp_size; - } - } - current_alignment += max_element_size; - break; - } - case eprosima::fastdds::dds::xtypes::TK_STRUCTURE: - case eprosima::fastdds::dds::xtypes::TK_BITSET: - { - for (auto it = type->member_by_id_.begin(); it != type->member_by_id_.end(); ++it) - { - if (!it->second->descriptor_.annotation_is_non_serialized()) - { - current_alignment += getMaxCdrSerializedSize(it->second->descriptor_.type_, current_alignment); - } - } - break; - } - case eprosima::fastdds::dds::xtypes::TK_ARRAY: - { - // Element size with the maximum size - current_alignment += type->get_total_bounds() * - (getMaxCdrSerializedSize(type->descriptor_->get_element_type())); - break; - } - case eprosima::fastdds::dds::xtypes::TK_SEQUENCE: - { - // Elements count - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - // Element size with the maximum size - current_alignment += type->get_total_bounds() * - (getMaxCdrSerializedSize(type->descriptor_->get_element_type())); - break; - } - case eprosima::fastdds::dds::xtypes::TK_MAP: - { - // Elements count - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - // Key Elements size with the maximum size - current_alignment += type->get_total_bounds() * - (getMaxCdrSerializedSize(type->descriptor_->get_key_element_type())); - - // Value Elements size with the maximum size - current_alignment += type->get_total_bounds() * - (getMaxCdrSerializedSize(type->descriptor_->get_element_type())); - break; - } - - case eprosima::fastdds::dds::xtypes::TK_ALIAS: - { - current_alignment += getMaxCdrSerializedSize(type->get_base_type()); - break; - } - } - - return current_alignment - initial_alignment; -} - -void DynamicData::serialize( - eprosima::fastcdr::Cdr& cdr) const -{ - if (type_ != nullptr && type_->get_descriptor()->annotation_is_non_serialized()) - { - return; - } - - switch (get_kind()) - { - default: - break; - case eprosima::fastdds::dds::xtypes::TK_INT32: - { -#ifdef DYNAMIC_TYPES_CHECKING - cdr << int32_value_; -#else - auto it = values_.begin(); - cdr << *((int32_t*)it->second); -#endif // ifdef DYNAMIC_TYPES_CHECKING - break; - } - case eprosima::fastdds::dds::xtypes::TK_UINT32: - { -#ifdef DYNAMIC_TYPES_CHECKING - cdr << uint32_value_; -#else - auto it = values_.begin(); - cdr << *((uint32_t*)it->second); -#endif // ifdef DYNAMIC_TYPES_CHECKING - break; - } - case eprosima::fastdds::dds::xtypes::TK_INT16: - { -#ifdef DYNAMIC_TYPES_CHECKING - cdr << int16_value_; -#else - auto it = values_.begin(); - cdr << *((int16_t*)it->second); -#endif // ifdef DYNAMIC_TYPES_CHECKING - break; - } - case eprosima::fastdds::dds::xtypes::TK_UINT16: - { -#ifdef DYNAMIC_TYPES_CHECKING - cdr << uint16_value_; -#else - auto it = values_.begin(); - cdr << *((uint16_t*)it->second); -#endif // ifdef DYNAMIC_TYPES_CHECKING - break; - } - case eprosima::fastdds::dds::xtypes::TK_INT64: - { -#ifdef DYNAMIC_TYPES_CHECKING - cdr << int64_value_; -#else - auto it = values_.begin(); - cdr << *((int64_t*)it->second); -#endif // ifdef DYNAMIC_TYPES_CHECKING - break; - } - case eprosima::fastdds::dds::xtypes::TK_UINT64: - { -#ifdef DYNAMIC_TYPES_CHECKING - cdr << uint64_value_; -#else - auto it = values_.begin(); - cdr << *((uint64_t*)it->second); -#endif // ifdef DYNAMIC_TYPES_CHECKING - break; - } - case eprosima::fastdds::dds::xtypes::TK_FLOAT32: - { -#ifdef DYNAMIC_TYPES_CHECKING - cdr << float32_value_; -#else - auto it = values_.begin(); - cdr << *((float*)it->second); -#endif // ifdef DYNAMIC_TYPES_CHECKING - break; - } - case eprosima::fastdds::dds::xtypes::TK_FLOAT64: - { -#ifdef DYNAMIC_TYPES_CHECKING - cdr << float64_value_; -#else - auto it = values_.begin(); - cdr << *((double*)it->second); -#endif // ifdef DYNAMIC_TYPES_CHECKING - break; - } - case eprosima::fastdds::dds::xtypes::TK_FLOAT128: - { -#ifdef DYNAMIC_TYPES_CHECKING - cdr << float128_value_; -#else - auto it = values_.begin(); - cdr << *((long double*)it->second); -#endif // ifdef DYNAMIC_TYPES_CHECKING - break; - } - case eprosima::fastdds::dds::xtypes::TK_CHAR8: - { -#ifdef DYNAMIC_TYPES_CHECKING - cdr << char8_value_; -#else - auto it = values_.begin(); - cdr << *((char*)it->second); -#endif // ifdef DYNAMIC_TYPES_CHECKING - break; - } - case eprosima::fastdds::dds::xtypes::TK_CHAR16: - { -#ifdef DYNAMIC_TYPES_CHECKING - cdr << char16_value_; -#else - auto it = values_.begin(); - cdr << *((wchar_t*)it->second); -#endif // ifdef DYNAMIC_TYPES_CHECKING - break; - } - case eprosima::fastdds::dds::xtypes::TK_BOOLEAN: - { -#ifdef DYNAMIC_TYPES_CHECKING - cdr << bool_value_; -#else - auto it = values_.begin(); - cdr << *((bool*)it->second); -#endif // ifdef DYNAMIC_TYPES_CHECKING - break; - } - case eprosima::fastdds::dds::xtypes::TK_BYTE: - { -#ifdef DYNAMIC_TYPES_CHECKING - cdr << byte_value_; -#else - auto it = values_.begin(); - cdr << *((octet*)it->second); -#endif // ifdef DYNAMIC_TYPES_CHECKING - break; - } - case eprosima::fastdds::dds::xtypes::TK_STRING8: - { -#ifdef DYNAMIC_TYPES_CHECKING - cdr << string_value_; -#else - auto it = values_.begin(); - cdr << *((std::string*)it->second); -#endif // ifdef DYNAMIC_TYPES_CHECKING - break; - } - case eprosima::fastdds::dds::xtypes::TK_STRING16: - { -#ifdef DYNAMIC_TYPES_CHECKING - cdr << wstring_value_; -#else - auto it = values_.begin(); - cdr << *((std::wstring*)it->second); -#endif // ifdef DYNAMIC_TYPES_CHECKING - break; - } - case eprosima::fastdds::dds::xtypes::TK_ENUM: - { -#ifdef DYNAMIC_TYPES_CHECKING - cdr << uint32_value_; -#else - auto it = values_.begin(); - cdr << *((uint32_t*)it->second); -#endif // ifdef DYNAMIC_TYPES_CHECKING - break; - } - case eprosima::fastdds::dds::xtypes::TK_BITMASK: - { - size_t type_size = type_->get_size(); -#ifdef DYNAMIC_TYPES_CHECKING - switch (type_size) - { - case 1: cdr << (uint8_t)uint64_value_; break; - case 2: cdr << (uint16_t)uint64_value_; break; - case 3: cdr << (uint32_t)uint64_value_; break; - case 4: cdr << uint64_value_; break; - default: EPROSIMA_LOG_ERROR(DYN_TYPES, "Cannot serialize bitmask of size " << type_size); - } -#else - auto it = values_.begin(); - switch (type_size) - { - case 1: cdr << *((uint8_t*)it->second); break; - case 2: cdr << *((uint16_t*)it->second); break; - case 3: cdr << *((uint32_t*)it->second); break; - case 4: cdr << *((uint64_t*)it->second); break; - default: EPROSIMA_LOG_ERROR(DYN_TYPES, "Cannot serialize bitmask of size " << type_size); - } -#endif // ifdef DYNAMIC_TYPES_CHECKING - break; - } - case eprosima::fastdds::dds::xtypes::TK_UNION: - { - union_discriminator_->serialize_discriminator(cdr); - //cdr << union_id_; - if (union_id_ != MEMBER_ID_INVALID) - { -#ifdef DYNAMIC_TYPES_CHECKING - auto it = complex_values_.at(union_id_); -#else - auto it = (DynamicData*) values_.at(union_id_); -#endif // ifdef DYNAMIC_TYPES_CHECKING - it->serialize(cdr); - } - break; - } - case eprosima::fastdds::dds::xtypes::TK_SEQUENCE: // Sequence is like structure, but with size - { -#ifdef DYNAMIC_TYPES_CHECKING - cdr << static_cast(complex_values_.size()); - for (uint32_t idx = 0; idx < static_cast(complex_values_.size()); ++idx) - { - auto it = complex_values_.at(idx); - it->serialize(cdr); - } -#else - cdr << static_cast(values_.size()); - for (uint32_t idx = 0; idx < static_cast(values_.size()); ++idx) - { - auto it = values_.at(idx); - ((DynamicData*)it)->serialize(cdr); - } -#endif // ifdef DYNAMIC_TYPES_CHECKING - break; - } - case eprosima::fastdds::dds::xtypes::TK_STRUCTURE: - case eprosima::fastdds::dds::xtypes::TK_BITSET: - { -#ifdef DYNAMIC_TYPES_CHECKING - for (uint32_t idx = 0; idx < static_cast(complex_values_.size()); ++idx) - { - auto d_it = descriptors_.find(idx); - if (d_it != descriptors_.end()) - { - const MemberDescriptor* member_desc = d_it->second; - if (!member_desc->annotation_is_non_serialized()) - { - auto it = complex_values_.at(idx); - it->serialize(cdr); - } - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Missing MemberDescriptor " << idx); - } - } -#else - for (uint32_t idx = 0; idx < static_cast(values_.size()); ++idx) - { - auto d_it = descriptors_.find(idx); - if (d_it != descriptors_.end()) - { - const MemberDescriptor* member_desc = d_it->second; - if (!member_desc->annotation_is_non_serialized()) - { - auto it = values_.at(idx); - ((DynamicData*)it)->serialize(cdr); - } - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Missing MemberDescriptor " << idx); - } - } -#endif // ifdef DYNAMIC_TYPES_CHECKING - break; - } - case eprosima::fastdds::dds::xtypes::TK_ARRAY: - { - uint32_t arraySize = type_->get_total_bounds(); - for (uint32_t idx = 0; idx < arraySize; ++idx) - { -#ifdef DYNAMIC_TYPES_CHECKING - auto it = complex_values_.find(idx); - if (it != complex_values_.end()) -#else - auto it = values_.find(idx); - if (it != values_.end()) -#endif // ifdef DYNAMIC_TYPES_CHECKING - { - ((DynamicData*)it->second)->serialize(cdr); - } - else - { - serialize_empty_data(type_->get_element_type(), cdr); - } - } - break; - } - case eprosima::fastdds::dds::xtypes::TK_MAP: - { -#ifdef DYNAMIC_TYPES_CHECKING - cdr << static_cast(complex_values_.size() / 2); // Number of pairs - for (auto it = complex_values_.begin(); it != complex_values_.end(); ++it) - { - it->second->serialize(cdr); - } -#else - cdr << static_cast(values_.size() / 2); - for (auto it = values_.begin(); it != values_.end(); ++it) - { - ((DynamicData*)it->second)->serialize(cdr); - } -#endif // ifdef DYNAMIC_TYPES_CHECKING - break; - } - case eprosima::fastdds::dds::xtypes::TK_ALIAS: - break; - } -} - -void DynamicData::serialize_discriminator( - eprosima::fastcdr::Cdr& cdr) const -{ - switch (get_kind()) - { - case eprosima::fastdds::dds::xtypes::TK_INT32: - { - int32_t aux = static_cast(discriminator_value_); - cdr << aux; - break; - } - case eprosima::fastdds::dds::xtypes::TK_UINT32: - { - uint32_t aux = static_cast(discriminator_value_); - cdr << aux; - break; - } - case eprosima::fastdds::dds::xtypes::TK_INT16: - { - int16_t aux = static_cast(discriminator_value_); - cdr << aux; - break; - } - case eprosima::fastdds::dds::xtypes::TK_UINT16: - { - uint16_t aux = static_cast(discriminator_value_); - cdr << aux; - break; - } - case eprosima::fastdds::dds::xtypes::TK_INT64: - { - int64_t aux = static_cast(discriminator_value_); - cdr << aux; - break; - } - case eprosima::fastdds::dds::xtypes::TK_UINT64: - { - uint64_t aux = static_cast(discriminator_value_); - cdr << aux; - break; - } - case eprosima::fastdds::dds::xtypes::TK_CHAR8: - { - char aux = static_cast(discriminator_value_); - cdr << aux; - break; - } - case eprosima::fastdds::dds::xtypes::TK_CHAR16: - { - wchar_t aux = static_cast(discriminator_value_); - cdr << aux; - break; - } - case eprosima::fastdds::dds::xtypes::TK_BOOLEAN: - { - bool aux = !!(discriminator_value_); - cdr << aux; - break; - } - case eprosima::fastdds::dds::xtypes::TK_BYTE: - { - octet aux = static_cast(discriminator_value_); - cdr << aux; - break; - } - case eprosima::fastdds::dds::xtypes::TK_ENUM: - { - uint32_t aux = static_cast(discriminator_value_); - cdr << aux; - break; - } - case eprosima::fastdds::dds::xtypes::TK_FLOAT32: - case eprosima::fastdds::dds::xtypes::TK_FLOAT64: - case eprosima::fastdds::dds::xtypes::TK_FLOAT128: - case eprosima::fastdds::dds::xtypes::TK_STRING8: - case eprosima::fastdds::dds::xtypes::TK_STRING16: - case eprosima::fastdds::dds::xtypes::TK_BITMASK: - case eprosima::fastdds::dds::xtypes::TK_UNION: - case eprosima::fastdds::dds::xtypes::TK_SEQUENCE: - case eprosima::fastdds::dds::xtypes::TK_STRUCTURE: - case eprosima::fastdds::dds::xtypes::TK_BITSET: - case eprosima::fastdds::dds::xtypes::TK_ARRAY: - case eprosima::fastdds::dds::xtypes::TK_MAP: - case eprosima::fastdds::dds::xtypes::TK_ALIAS: - default: - break; - } -} - -void DynamicData::serializeKey( - eprosima::fastcdr::Cdr& cdr) const -{ - // Structures check the the size of the key for their children - if (type_->get_kind() == eprosima::fastdds::dds::xtypes::TK_STRUCTURE || - type_->get_kind() == eprosima::fastdds::dds::xtypes::TK_BITSET) - { -#ifdef DYNAMIC_TYPES_CHECKING - for (auto it = complex_values_.begin(); it != complex_values_.end(); ++it) - { - it->second->serializeKey(cdr); - } -#else - for (auto it = values_.begin(); it != values_.end(); ++it) - { - ((DynamicData*)it->second)->serializeKey(cdr); - } -#endif // ifdef DYNAMIC_TYPES_CHECKING - } - else if (type_->is_key_defined_) - { - serialize(cdr); - } -} - -size_t DynamicData::getEmptyCdrSerializedSize( - const DynamicType* type, - size_t current_alignment /*= 0*/) -{ - if (type->get_descriptor()->annotation_is_non_serialized()) - { - return 0; - } - - size_t initial_alignment = current_alignment; - - switch (type->get_kind()) - { - default: - break; - case eprosima::fastdds::dds::xtypes::TK_INT32: - case eprosima::fastdds::dds::xtypes::TK_UINT32: - case eprosima::fastdds::dds::xtypes::TK_FLOAT32: - case eprosima::fastdds::dds::xtypes::TK_ENUM: - case eprosima::fastdds::dds::xtypes::TK_CHAR16: // WCHARS NEED 32 Bits on Linux & MacOS - { - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - break; - } - case eprosima::fastdds::dds::xtypes::TK_INT16: - case eprosima::fastdds::dds::xtypes::TK_UINT16: - { - current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - break; - } - case eprosima::fastdds::dds::xtypes::TK_INT64: - case eprosima::fastdds::dds::xtypes::TK_UINT64: - case eprosima::fastdds::dds::xtypes::TK_FLOAT64: - { - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - break; - } - case eprosima::fastdds::dds::xtypes::TK_BITMASK: - { - size_t type_size = type->get_size(); - current_alignment += type_size + eprosima::fastcdr::Cdr::alignment(current_alignment, type_size); - break; - } - case eprosima::fastdds::dds::xtypes::TK_FLOAT128: - { - current_alignment += 16 + eprosima::fastcdr::Cdr::alignment(current_alignment, 16); - break; - } - case eprosima::fastdds::dds::xtypes::TK_CHAR8: - case eprosima::fastdds::dds::xtypes::TK_BOOLEAN: - case eprosima::fastdds::dds::xtypes::TK_BYTE: - { - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - break; - } - case eprosima::fastdds::dds::xtypes::TK_STRING8: - { - // string length + 1 - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 1; - break; - } - case eprosima::fastdds::dds::xtypes::TK_STRING16: - { - // string length - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - break; - } - case eprosima::fastdds::dds::xtypes::TK_UNION: - { - // union discriminator - current_alignment += getEmptyCdrSerializedSize(type->get_discriminator_type().get(), current_alignment); - break; - } - case eprosima::fastdds::dds::xtypes::TK_STRUCTURE: - case eprosima::fastdds::dds::xtypes::TK_BITSET: - { - for (auto it = type->member_by_id_.begin(); it != type->member_by_id_.end(); ++it) - { - if (!it->second->descriptor_.annotation_is_non_serialized()) - { - current_alignment += getEmptyCdrSerializedSize( - it->second->descriptor_.type_.get(), current_alignment); - } - } - break; - } - case eprosima::fastdds::dds::xtypes::TK_ARRAY: - { - // Elements count - //current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - // Element size with the maximum size - current_alignment += type->get_total_bounds() * - (getEmptyCdrSerializedSize(type->descriptor_->get_element_type().get())); - break; - } - case eprosima::fastdds::dds::xtypes::TK_SEQUENCE: - case eprosima::fastdds::dds::xtypes::TK_MAP: - { - // Elements count - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - break; - } - - case eprosima::fastdds::dds::xtypes::TK_ALIAS: - current_alignment += getEmptyCdrSerializedSize(type->get_base_type().get()); - break; - } - - return current_alignment - initial_alignment; -} - -void DynamicData::serialize_empty_data( - const DynamicType_ptr pType, - eprosima::fastcdr::Cdr& cdr) const -{ - if (pType->get_descriptor()->annotation_is_non_serialized()) - { - return; - } - - switch (pType->get_kind()) - { - default: - break; - case eprosima::fastdds::dds::xtypes::TK_ALIAS: - { - serialize_empty_data(pType->get_base_type(), cdr); - break; - } - case eprosima::fastdds::dds::xtypes::TK_INT32: - { - cdr << static_cast(0); - break; - } - case eprosima::fastdds::dds::xtypes::TK_UINT32: - { - cdr << static_cast(0); - break; - } - case eprosima::fastdds::dds::xtypes::TK_INT16: - { - cdr << static_cast(0); - break; - } - case eprosima::fastdds::dds::xtypes::TK_UINT16: - { - cdr << static_cast(0); - break; - } - case eprosima::fastdds::dds::xtypes::TK_INT64: - { - cdr << static_cast(0); - break; - } - case eprosima::fastdds::dds::xtypes::TK_UINT64: - { - cdr << static_cast(0); - break; - } - case eprosima::fastdds::dds::xtypes::TK_FLOAT32: - { - cdr << static_cast(0.0f); - break; - } - case eprosima::fastdds::dds::xtypes::TK_FLOAT64: - { - cdr << static_cast(0.0); - break; - } - case eprosima::fastdds::dds::xtypes::TK_FLOAT128: - { - cdr << static_cast(0.0); - break; - } - case eprosima::fastdds::dds::xtypes::TK_CHAR8: - { - cdr << static_cast(0); - break; - } - case eprosima::fastdds::dds::xtypes::TK_CHAR16: - { - cdr << static_cast(0); - break; - } - case eprosima::fastdds::dds::xtypes::TK_BOOLEAN: - { - cdr << static_cast(0); - break; - } - case eprosima::fastdds::dds::xtypes::TK_BYTE: - { - cdr << static_cast(0); - break; - } - case eprosima::fastdds::dds::xtypes::TK_STRING8: - { - cdr << std::string(); - break; - } - case eprosima::fastdds::dds::xtypes::TK_STRING16: - { - cdr << std::wstring(); - break; - } - case eprosima::fastdds::dds::xtypes::TK_ENUM: - { - cdr << static_cast(0); - break; - } - case eprosima::fastdds::dds::xtypes::TK_BITMASK: - { - size_t type_size = pType->get_size(); - switch (type_size) - { - case 1: cdr << static_cast(0); break; - case 2: cdr << static_cast(0); break; - case 3: cdr << static_cast(0); break; - case 4: cdr << static_cast(0); break; - default: EPROSIMA_LOG_ERROR(DYN_TYPES, "Cannot deserialize bitmask of size " << type_size); - } - break; - } - case eprosima::fastdds::dds::xtypes::TK_UNION: - { - cdr << static_cast(MEMBER_ID_INVALID); - break; - } - case eprosima::fastdds::dds::xtypes::TK_SEQUENCE: // Sequence is like structure, but with size - { - cdr << static_cast(0); - break; - } - case eprosima::fastdds::dds::xtypes::TK_STRUCTURE: - case eprosima::fastdds::dds::xtypes::TK_BITSET: - { - for (uint32_t idx = 0; idx < pType->member_by_id_.size(); ++idx) - { - auto it = pType->member_by_id_.at(idx); - if (!it->descriptor_.annotation_is_non_serialized()) - { - serialize_empty_data(it->descriptor_.type_, cdr); - } - } - break; - } - case eprosima::fastdds::dds::xtypes::TK_ARRAY: - { - uint32_t arraySize = pType->get_total_bounds(); - //cdr << arraySize; - for (uint32_t i = 0; i < arraySize; ++i) - { - serialize_empty_data(pType->get_element_type(), cdr); - } - break; - } - case eprosima::fastdds::dds::xtypes::TK_MAP: - { - cdr << static_cast(0); - break; - } - } -} - -} // namespace types -} // namespace fastrtps -} // namespace eprosima diff --git a/src/cpp/dynamic-types/DynamicDataFactory.cpp b/src/cpp/dynamic-types/DynamicDataFactory.cpp deleted file mode 100644 index 72f1a432dc9..00000000000 --- a/src/cpp/dynamic-types/DynamicDataFactory.cpp +++ /dev/null @@ -1,235 +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. - -#include -#include -#include -#include - -namespace eprosima { -namespace fastrtps { -namespace types { - -class DynamicDataFactoryReleaser -{ -public: - - ~DynamicDataFactoryReleaser() - { - DynamicDataFactory::delete_instance(); - } - -}; - -static DynamicDataFactoryReleaser s_releaser; -static DynamicDataFactory* s_instance = nullptr; - -DynamicDataFactory* DynamicDataFactory::get_instance() -{ - if (s_instance == nullptr) - { - s_instance = new DynamicDataFactory(); - } - return s_instance; -} - -ReturnCode_t DynamicDataFactory::delete_instance() -{ - if (s_instance != nullptr) - { - delete s_instance; - s_instance = nullptr; - return eprosima::fastdds::dds::RETCODE_OK; - } - return eprosima::fastdds::dds::RETCODE_ERROR; -} - -DynamicDataFactory::DynamicDataFactory() -{ -} - -DynamicDataFactory::~DynamicDataFactory() -{ -#ifndef DISABLE_DYNAMIC_MEMORY_CHECK - std::unique_lock scoped(mutex_); - while (dynamic_datas_.size() > 0) - { - delete_data(dynamic_datas_[dynamic_datas_.size() - 1]); - } - dynamic_datas_.clear(); -#endif // ifndef DISABLE_DYNAMIC_MEMORY_CHECK -} - -DynamicData* DynamicDataFactory::create_copy( - const DynamicData* pData) -{ - DynamicData* newData = new DynamicData(pData); -#ifndef DISABLE_DYNAMIC_MEMORY_CHECK - { - std::unique_lock scoped(mutex_); - dynamic_datas_.push_back(newData); - } -#endif // ifndef DISABLE_DYNAMIC_MEMORY_CHECK - - return newData; -} - -DynamicData* DynamicDataFactory::create_data( - DynamicTypeBuilder* pBuilder) -{ - if (pBuilder != nullptr && pBuilder->is_consistent()) - { - DynamicType_ptr pType = DynamicTypeBuilderFactory::get_instance()->create_type(pBuilder); - return create_data(pType); - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error creating DynamicData. Invalid dynamic type builder"); - return nullptr; - } -} - -DynamicData* DynamicDataFactory::create_data( - DynamicType_ptr pType) -{ - if (pType != nullptr && pType->is_consistent()) - { - try - { - DynamicData* newData = nullptr; - // ALIAS types create a DynamicData based on the base type and renames it with the name of the ALIAS. - if (pType->get_base_type() != nullptr) - { - if (pType->get_kind() == eprosima::fastdds::dds::xtypes::TK_ALIAS) - { - newData = create_data(pType->get_base_type()); - newData->set_type_name(pType->get_name()); - } - else if (pType->get_kind() == eprosima::fastdds::dds::xtypes::TK_STRUCTURE || - pType->get_kind() == eprosima::fastdds::dds::xtypes::TK_BITSET) - { - newData = new DynamicData(pType); -#ifndef DISABLE_DYNAMIC_MEMORY_CHECK - { - std::unique_lock scoped(mutex_); - dynamic_datas_.push_back(newData); - } -#endif // ifndef DISABLE_DYNAMIC_MEMORY_CHECK - create_members(newData, pType->get_base_type()); - } - } - else - { - newData = new DynamicData(pType); -#ifndef DISABLE_DYNAMIC_MEMORY_CHECK - { - std::unique_lock scoped(mutex_); - dynamic_datas_.push_back(newData); - } -#endif // ifndef DISABLE_DYNAMIC_MEMORY_CHECK - - // Arrays must have created every members for serialization. - if (pType->get_kind() == eprosima::fastdds::dds::xtypes::TK_ARRAY) - { - DynamicData* defaultArrayData = new DynamicData(pType->get_element_type()); -#ifndef DISABLE_DYNAMIC_MEMORY_CHECK - { - std::unique_lock scoped(mutex_); - dynamic_datas_.push_back(defaultArrayData); - } -#endif // ifndef DISABLE_DYNAMIC_MEMORY_CHECK - newData->default_array_value_ = defaultArrayData; - } - // Unions need a discriminator data - else if (pType->get_kind() == eprosima::fastdds::dds::xtypes::TK_UNION) - { - DynamicData* discriminatorData = new DynamicData(pType->get_discriminator_type()); -#ifndef DISABLE_DYNAMIC_MEMORY_CHECK - { - std::unique_lock scoped(mutex_); - dynamic_datas_.push_back(discriminatorData); - } -#endif // ifndef DISABLE_DYNAMIC_MEMORY_CHECK - newData->set_union_discriminator(discriminatorData); - } - } - return newData; - } - catch (std::exception& e) - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Exception creating DynamicData: " << e.what()); - return nullptr; - } - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error creating DynamicData. Invalid dynamic type"); - return nullptr; - } -} - -ReturnCode_t DynamicDataFactory::create_members( - DynamicData* pData, - DynamicType_ptr pType) -{ - if (pType != nullptr && pData != nullptr) - { - pData->create_members(pType); - if ((pType->get_kind() == eprosima::fastdds::dds::xtypes::TK_STRUCTURE || - pType->get_kind() == eprosima::fastdds::dds::xtypes::TK_BITSET) && - pType->get_base_type() != nullptr) - { - create_members(pData, pType->get_base_type()); - } - return eprosima::fastdds::dds::RETCODE_OK; - } - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; -} - -ReturnCode_t DynamicDataFactory::delete_data( - DynamicData* pData) -{ - if (pData != nullptr) - { -#ifndef DISABLE_DYNAMIC_MEMORY_CHECK - std::unique_lock scoped(mutex_); - auto it = std::find(dynamic_datas_.begin(), dynamic_datas_.end(), pData); - if (it != dynamic_datas_.end()) - { - dynamic_datas_.erase(it); - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error deleting DynamicData. It isn't registered in the factory"); - return eprosima::fastdds::dds::RETCODE_ALREADY_DELETED; - } -#endif // ifndef DISABLE_DYNAMIC_MEMORY_CHECK - delete pData; - } - return eprosima::fastdds::dds::RETCODE_OK; -} - -bool DynamicDataFactory::is_empty() const -{ -#ifndef DISABLE_DYNAMIC_MEMORY_CHECK - std::unique_lock scoped(mutex_); - return dynamic_datas_.empty(); -#else - return true; -#endif // ifndef DISABLE_DYNAMIC_MEMORY_CHECK -} - -} // namespace types -} // namespace fastrtps -} // namespace eprosima diff --git a/src/cpp/dynamic-types/DynamicDataHelper.cpp b/src/cpp/dynamic-types/DynamicDataHelper.cpp deleted file mode 100644 index 4afa23cdaef..00000000000 --- a/src/cpp/dynamic-types/DynamicDataHelper.cpp +++ /dev/null @@ -1,893 +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. - -#include - -#include -#include - -using namespace eprosima::fastrtps::types; - -void DynamicDataHelper::print( - const DynamicData_ptr& data) -{ - print(data.get()); -} - -std::ostream& DynamicDataHelper::print( - std::ostream& output, - const DynamicData_ptr& data) -{ - return print(output, data.get()); -} - -void DynamicDataHelper::print( - const DynamicData* data) -{ - if (nullptr != data) - { - switch (data->type_->get_kind()) - { - case eprosima::fastdds::dds::xtypes::TK_STRUCTURE: - { - std::map members; - data->type_->get_all_members(members); - for (auto it : members) - { - print_member(const_cast(data), it.second); - } - break; - } - default: - { - std::cout << "Only structs are supported by DynamicDataHelper::print method." << std::endl; - } - } - } - else - { - std::cout << "" << std::endl; - } -} - -std::ostream& DynamicDataHelper::print( - std::ostream& output, - const DynamicData* data) -{ - if (nullptr != data) - { - switch (data->type_->get_kind()) - { - case eprosima::fastdds::dds::xtypes::TK_STRUCTURE: - { - std::map members; - data->type_->get_all_members(members); - for (auto it : members) - { - print_member(const_cast(data), output, it.second); - } - break; - } - default: - { - output << "Only structs are supported by DynamicDataHelper::print method.\n"; - } - } - } - else - { - output << "\n"; - } - return output; -} - -void DynamicDataHelper::print_basic_element( - DynamicData* data, - MemberId id, - TypeKind kind) -{ - switch (kind) - { - case eprosima::fastdds::dds::xtypes::TK_NONE: - { - std::cout << ""; - break; - } - case eprosima::fastdds::dds::xtypes::TK_BOOLEAN: - { - std::cout << (data->get_bool_value(id) ? "true" : "false"); - break; - } - case eprosima::fastdds::dds::xtypes::TK_BYTE: - { - std::cout << static_cast(data->get_byte_value(id)); - break; - } - case eprosima::fastdds::dds::xtypes::TK_INT16: - { - std::cout << data->get_int16_value(id); - break; - } - case eprosima::fastdds::dds::xtypes::TK_INT32: - { - std::cout << data->get_int32_value(id); - break; - } - case eprosima::fastdds::dds::xtypes::TK_INT64: - { - std::cout << data->get_int64_value(id); - break; - } - case eprosima::fastdds::dds::xtypes::TK_UINT16: - { - std::cout << data->get_uint16_value(id); - break; - } - case eprosima::fastdds::dds::xtypes::TK_UINT32: - { - std::cout << data->get_uint32_value(id); - break; - } - case eprosima::fastdds::dds::xtypes::TK_UINT64: - { - std::cout << data->get_uint64_value(id); - break; - } - case eprosima::fastdds::dds::xtypes::TK_FLOAT32: - { - std::cout << data->get_float32_value(id); - break; - } - case eprosima::fastdds::dds::xtypes::TK_FLOAT64: - { - std::cout << data->get_float64_value(id); - break; - } - case eprosima::fastdds::dds::xtypes::TK_FLOAT128: - { - std::cout << data->get_float128_value(id); - break; - } - case eprosima::fastdds::dds::xtypes::TK_CHAR8: - { - std::cout << data->get_char8_value(id); - break; - } - case eprosima::fastdds::dds::xtypes::TK_CHAR16: - { - std::cout << data->get_char16_value(id); - break; - } - case eprosima::fastdds::dds::xtypes::TK_STRING8: - { - std::cout << data->get_string_value(id); - break; - } - case eprosima::fastdds::dds::xtypes::TK_STRING16: - { - std::wcout << data->get_wstring_value(id); - break; - } - case eprosima::fastdds::dds::xtypes::TK_BITMASK: - { - size_t size = data->type_->get_size(); - switch (size) - { - case 1: std::cout << data->get_uint8_value(id); break; - case 2: std::cout << data->get_uint16_value(id); break; - case 3: std::cout << data->get_uint32_value(id); break; - case 4: std::cout << data->get_uint64_value(id); break; - } - break; - } - case eprosima::fastdds::dds::xtypes::TK_ENUM: - { - std::cout << data->get_uint32_value(id); - break; - } - default: - break; - } -} - -void DynamicDataHelper::print_basic_element( - DynamicData* data, - MemberId id, - TypeKind kind, - std::ostream& output) -{ - switch (kind) - { - case eprosima::fastdds::dds::xtypes::TK_NONE: - { - output << ""; - break; - } - case eprosima::fastdds::dds::xtypes::TK_BOOLEAN: - { - output << (data->get_bool_value(id) ? "true" : "false"); - break; - } - case eprosima::fastdds::dds::xtypes::TK_BYTE: - { - output << std::to_string(static_cast(data->get_byte_value(id))); - break; - } - case eprosima::fastdds::dds::xtypes::TK_INT16: - { - output << std::to_string(data->get_int16_value(id)); - break; - } - case eprosima::fastdds::dds::xtypes::TK_INT32: - { - output << std::to_string(data->get_int32_value(id)); - break; - } - case eprosima::fastdds::dds::xtypes::TK_INT64: - { - output << std::to_string(data->get_int64_value(id)); - break; - } - case eprosima::fastdds::dds::xtypes::TK_UINT16: - { - output << std::to_string(data->get_uint16_value(id)); - break; - } - case eprosima::fastdds::dds::xtypes::TK_UINT32: - { - output << std::to_string(data->get_uint32_value(id)); - break; - } - case eprosima::fastdds::dds::xtypes::TK_UINT64: - { - output << std::to_string(data->get_uint64_value(id)); - break; - } - case eprosima::fastdds::dds::xtypes::TK_FLOAT32: - { - output << std::to_string(data->get_float32_value(id)); - break; - } - case eprosima::fastdds::dds::xtypes::TK_FLOAT64: - { - output << std::to_string(data->get_float64_value(id)); - break; - } - case eprosima::fastdds::dds::xtypes::TK_FLOAT128: - { - output << std::to_string(data->get_float128_value(id)); - break; - } - case eprosima::fastdds::dds::xtypes::TK_CHAR8: - { - output << std::to_string(data->get_char8_value(id)); - break; - } - case eprosima::fastdds::dds::xtypes::TK_CHAR16: - { - output << std::to_string(data->get_char16_value(id)); - break; - } - case eprosima::fastdds::dds::xtypes::TK_STRING8: - { - output << data->get_string_value(id); - break; - } - case eprosima::fastdds::dds::xtypes::TK_STRING16: - { - std::wcout << data->get_wstring_value(id); - break; - } - case eprosima::fastdds::dds::xtypes::TK_BITMASK: - { - size_t size = data->type_->get_size(); - switch (size) - { - case 1: output << std::to_string(data->get_uint8_value(id)); break; - case 2: output << std::to_string(data->get_uint16_value(id)); break; - case 3: output << std::to_string(data->get_uint32_value(id)); break; - case 4: output << std::to_string(data->get_uint64_value(id)); break; - } - break; - } - case eprosima::fastdds::dds::xtypes::TK_ENUM: - { - output << std::to_string(data->get_uint32_value(id)); - break; - } - default: - break; - } -} - -void DynamicDataHelper::print_collection( - DynamicData* data, - const std::string& tabs) -{ - switch (data->type_->get_element_type()->get_kind()) - { - case eprosima::fastdds::dds::xtypes::TK_NONE: - case eprosima::fastdds::dds::xtypes::TK_BOOLEAN: - case eprosima::fastdds::dds::xtypes::TK_BYTE: - case eprosima::fastdds::dds::xtypes::TK_INT16: - case eprosima::fastdds::dds::xtypes::TK_INT32: - case eprosima::fastdds::dds::xtypes::TK_INT64: - case eprosima::fastdds::dds::xtypes::TK_UINT16: - case eprosima::fastdds::dds::xtypes::TK_UINT32: - case eprosima::fastdds::dds::xtypes::TK_UINT64: - case eprosima::fastdds::dds::xtypes::TK_FLOAT32: - case eprosima::fastdds::dds::xtypes::TK_FLOAT64: - case eprosima::fastdds::dds::xtypes::TK_FLOAT128: - case eprosima::fastdds::dds::xtypes::TK_CHAR8: - case eprosima::fastdds::dds::xtypes::TK_CHAR16: - case eprosima::fastdds::dds::xtypes::TK_STRING8: - case eprosima::fastdds::dds::xtypes::TK_STRING16: - case eprosima::fastdds::dds::xtypes::TK_ENUM: - case eprosima::fastdds::dds::xtypes::TK_BITMASK: - { - print_basic_collection(data); - break; - } - case eprosima::fastdds::dds::xtypes::TK_STRUCTURE: - case eprosima::fastdds::dds::xtypes::TK_BITSET: - case eprosima::fastdds::dds::xtypes::TK_UNION: - case eprosima::fastdds::dds::xtypes::TK_SEQUENCE: - case eprosima::fastdds::dds::xtypes::TK_ARRAY: - case eprosima::fastdds::dds::xtypes::TK_MAP: - { - print_complex_collection(data, tabs); - break; - } - default: - break; - - } -} - -void DynamicDataHelper::print_collection( - DynamicData* data, - std::ostream& output, - const std::string& tabs) -{ - switch (data->type_->get_element_type()->get_kind()) - { - case eprosima::fastdds::dds::xtypes::TK_NONE: - case eprosima::fastdds::dds::xtypes::TK_BOOLEAN: - case eprosima::fastdds::dds::xtypes::TK_BYTE: - case eprosima::fastdds::dds::xtypes::TK_INT16: - case eprosima::fastdds::dds::xtypes::TK_INT32: - case eprosima::fastdds::dds::xtypes::TK_INT64: - case eprosima::fastdds::dds::xtypes::TK_UINT16: - case eprosima::fastdds::dds::xtypes::TK_UINT32: - case eprosima::fastdds::dds::xtypes::TK_UINT64: - case eprosima::fastdds::dds::xtypes::TK_FLOAT32: - case eprosima::fastdds::dds::xtypes::TK_FLOAT64: - case eprosima::fastdds::dds::xtypes::TK_FLOAT128: - case eprosima::fastdds::dds::xtypes::TK_CHAR8: - case eprosima::fastdds::dds::xtypes::TK_CHAR16: - case eprosima::fastdds::dds::xtypes::TK_STRING8: - case eprosima::fastdds::dds::xtypes::TK_STRING16: - case eprosima::fastdds::dds::xtypes::TK_ENUM: - case eprosima::fastdds::dds::xtypes::TK_BITMASK: - { - print_basic_collection(data, output); - break; - } - case eprosima::fastdds::dds::xtypes::TK_STRUCTURE: - case eprosima::fastdds::dds::xtypes::TK_BITSET: - case eprosima::fastdds::dds::xtypes::TK_UNION: - case eprosima::fastdds::dds::xtypes::TK_SEQUENCE: - case eprosima::fastdds::dds::xtypes::TK_ARRAY: - case eprosima::fastdds::dds::xtypes::TK_MAP: - { - print_complex_collection(data, output, tabs); - break; - } - default: - break; - - } -} - -void DynamicDataHelper::fill_array_positions( - const std::vector& bounds, - std::vector>& positions) -{ - uint32_t total_size = 1; - for (size_t i = 0; i < bounds.size(); ++i) - { - total_size *= bounds[i]; - } - - for (uint32_t idx = 0; idx < total_size; ++idx) - { - positions.push_back({}); - get_index_position(idx, bounds, positions[idx]); - } -} - -void DynamicDataHelper::get_index_position( - uint32_t index, - const std::vector& bounds, - std::vector& position) -{ - position.resize(bounds.size()); - if (bounds.size() > 0) - { - aux_index_position(index, static_cast(bounds.size() - 1), bounds, position); - } -} - -void DynamicDataHelper::aux_index_position( - uint32_t index, - uint32_t inner_index, - const std::vector& bounds, - std::vector& position) -{ - uint32_t remainder = index % bounds[inner_index]; - position[inner_index] = remainder; - if (inner_index > 0) - { - aux_index_position(index / bounds[inner_index], inner_index - 1, bounds, position); - } -} - -void DynamicDataHelper::print_basic_collection( - DynamicData* data) -{ - if (data->type_->get_kind() == eprosima::fastdds::dds::xtypes::TK_SEQUENCE) - { - auto count = data->get_item_count(); - std::cout << "["; - for (uint32_t i = 0; i < count; ++i) - { - print_basic_element(data, i, data->type_->get_element_type()->get_kind()); - std::cout << (i == count - 1 ? "]" : ", "); - } - if (count == 0) - { - std::cout << "]"; - } - } - else - { - const std::vector& bounds = data->type_->descriptor_->bound_; - - std::vector> positions; - fill_array_positions(bounds, positions); - - std::cout << "["; - for (size_t i = 0; i < positions.size(); ++i) - { - print_basic_element(data, data->get_array_index(positions[i]), data->type_->get_element_type()->get_kind()); - std::cout << (i == positions.size() - 1 ? "]" : ", "); - } - } - std::cout << std::endl; -} - -void DynamicDataHelper::print_basic_collection( - DynamicData* data, - std::ostream& output) -{ - if (data->type_->get_kind() == eprosima::fastdds::dds::xtypes::TK_SEQUENCE) - { - auto count = data->get_item_count(); - output << "["; - for (uint32_t i = 0; i < count; ++i) - { - print_basic_element(data, i, data->type_->get_element_type()->get_kind(), output); - output << (i == count - 1 ? "]" : ", "); - } - if (count == 0) - { - output << "]"; - } - } - else - { - const std::vector& bounds = data->type_->descriptor_->bound_; - - std::vector> positions; - fill_array_positions(bounds, positions); - - output << "["; - for (size_t i = 0; i < positions.size(); ++i) - { - print_basic_element(data, data->get_array_index(positions[i]), - data->type_->get_element_type()->get_kind(), output); - output << (i == positions.size() - 1 ? "]" : ", "); - } - } - output << "\n"; -} - -void DynamicDataHelper::print_complex_collection( - DynamicData* data, - const std::string& tabs) -{ - std::cout << std::endl; - if (data->type_->get_kind() == eprosima::fastdds::dds::xtypes::TK_SEQUENCE) - { - auto count = data->get_item_count(); - - for (uint32_t i = 0; i < count; ++i) - { - std::cout << tabs << "[" << i << "] = "; - print_complex_element(data, i, tabs); - std::cout << std::endl; - } - - if (count == 0) - { - std::cout << "[]"; - } - } - else - { - const std::vector& bounds = data->type_->descriptor_->bound_; - - std::vector> positions; - fill_array_positions(bounds, positions); - - for (size_t i = 0; i < positions.size(); ++i) - { - std::cout << tabs << "[" << i << "] = "; - print_complex_element(data, data->get_array_index(positions[i]), tabs); - std::cout << std::endl; - } - } -} - -void DynamicDataHelper::print_complex_collection( - DynamicData* data, - std::ostream& output, - const std::string& tabs) -{ - output << "\n"; - if (data->type_->get_kind() == eprosima::fastdds::dds::xtypes::TK_SEQUENCE) - { - auto count = data->get_item_count(); - - for (uint32_t i = 0; i < count; ++i) - { - output << tabs; - output << "["; - output << std::to_string(i); - output << "] = "; - print_complex_element(data, i, output, tabs); - output << "\n"; - } - - if (count == 0) - { - output << "[]"; - } - } - else - { - const std::vector& bounds = data->type_->descriptor_->bound_; - - std::vector> positions; - fill_array_positions(bounds, positions); - - for (size_t i = 0; i < positions.size(); ++i) - { - output << tabs; - output << "["; - output << std::to_string(i); - output << "] = "; - print_complex_element(data, data->get_array_index(positions[i]), output, tabs); - output << "\n"; - } - } -} - -void DynamicDataHelper::print_complex_element( - DynamicData* data, - MemberId id, - const std::string& tabs) -{ - DynamicData* st_data = data->loan_value(id); - const TypeDescriptor* desc = st_data->type_->get_type_descriptor(); - switch (desc->get_kind()) - { - case eprosima::fastdds::dds::xtypes::TK_STRUCTURE: - case eprosima::fastdds::dds::xtypes::TK_BITSET: - { - std::cout << "" << std::endl; - std::map members; - st_data->type_->get_all_members(members); - for (auto it : members) - { - print_member(st_data, it.second, tabs + "\t"); - } - break; - } - case eprosima::fastdds::dds::xtypes::TK_UNION: - { - std::cout << "" << std::endl; - DynamicTypeMember member; - st_data->type_->get_member(member, st_data->union_id_); - print_member(st_data, &member, tabs + "\t"); - break; - } - case eprosima::fastdds::dds::xtypes::TK_SEQUENCE: - case eprosima::fastdds::dds::xtypes::TK_ARRAY: - { - print_collection(st_data, tabs + "\t"); - break; - } - case eprosima::fastdds::dds::xtypes::TK_MAP: - { - std::cout << "" << std::endl; - std::map members; - st_data->type_->get_all_members(members); - size_t size = st_data->get_item_count(); - for (size_t i = 0; i < size; ++i) - { - size_t index = i * 2; - MemberId member_id = st_data->get_member_id_at_index(static_cast(index)); - std::cout << "Key: "; - print_member(st_data, members[member_id], tabs + "\t"); - member_id = data->get_member_id_at_index(static_cast(index + 1)); - std::cout << "Value: "; - print_member(st_data, members[member_id], tabs + "\t"); - } - break; - } - default: - break; - } - data->return_loaned_value(st_data); -} - -void DynamicDataHelper::print_complex_element( - DynamicData* data, - MemberId id, - std::ostream& output, - const std::string& tabs) -{ - DynamicData* st_data = data->loan_value(id); - const TypeDescriptor* desc = st_data->type_->get_type_descriptor(); - switch (desc->get_kind()) - { - case eprosima::fastdds::dds::xtypes::TK_STRUCTURE: - case eprosima::fastdds::dds::xtypes::TK_BITSET: - { - output << "\n"; - std::map members; - st_data->type_->get_all_members(members); - for (auto it : members) - { - print_member(st_data, output, it.second, tabs + "\t"); - } - break; - } - case eprosima::fastdds::dds::xtypes::TK_UNION: - { - output << "\n"; - DynamicTypeMember member; - st_data->type_->get_member(member, st_data->union_id_); - print_member(st_data, output, &member, tabs + "\t"); - break; - } - case eprosima::fastdds::dds::xtypes::TK_SEQUENCE: - case eprosima::fastdds::dds::xtypes::TK_ARRAY: - { - print_collection(st_data, output, tabs + "\t"); - break; - } - case eprosima::fastdds::dds::xtypes::TK_MAP: - { - output << "\n"; - std::map members; - st_data->type_->get_all_members(members); - size_t size = st_data->get_item_count(); - for (size_t i = 0; i < size; ++i) - { - size_t index = i * 2; - MemberId member_id = st_data->get_member_id_at_index(static_cast(index)); - output << "Key: "; - print_member(st_data, output, members[member_id], tabs + "\t"); - member_id = data->get_member_id_at_index(static_cast(index + 1)); - output << "Value: "; - print_member(st_data, output, members[member_id], tabs + "\t"); - } - break; - } - default: - break; - } - data->return_loaned_value(st_data); -} - -void DynamicDataHelper::print_member( - DynamicData* data, - const DynamicTypeMember* type, - const std::string& tabs) -{ - std::cout << tabs << type->get_name() << ": "; - const MemberDescriptor* desc = type->get_descriptor(); - switch (desc->get_kind()) - { - case eprosima::fastdds::dds::xtypes::TK_NONE: - case eprosima::fastdds::dds::xtypes::TK_BOOLEAN: - case eprosima::fastdds::dds::xtypes::TK_BYTE: - case eprosima::fastdds::dds::xtypes::TK_INT16: - case eprosima::fastdds::dds::xtypes::TK_INT32: - case eprosima::fastdds::dds::xtypes::TK_INT64: - case eprosima::fastdds::dds::xtypes::TK_UINT16: - case eprosima::fastdds::dds::xtypes::TK_UINT32: - case eprosima::fastdds::dds::xtypes::TK_UINT64: - case eprosima::fastdds::dds::xtypes::TK_FLOAT32: - case eprosima::fastdds::dds::xtypes::TK_FLOAT64: - case eprosima::fastdds::dds::xtypes::TK_FLOAT128: - case eprosima::fastdds::dds::xtypes::TK_CHAR8: - case eprosima::fastdds::dds::xtypes::TK_CHAR16: - case eprosima::fastdds::dds::xtypes::TK_STRING8: - case eprosima::fastdds::dds::xtypes::TK_STRING16: - case eprosima::fastdds::dds::xtypes::TK_ENUM: - case eprosima::fastdds::dds::xtypes::TK_BITMASK: - { - print_basic_element(data, type->get_id(), desc->get_kind()); - std::cout << std::endl; - break; - } - case eprosima::fastdds::dds::xtypes::TK_STRUCTURE: - case eprosima::fastdds::dds::xtypes::TK_BITSET: - { - DynamicData* st_data = data->loan_value(type->get_id()); - std::cout << "" << std::endl; - std::map members; - desc->get_type()->get_all_members(members); - for (auto it : members) - { - print_member(st_data, it.second, tabs + "\t"); - } - data->return_loaned_value(st_data); - break; - } - case eprosima::fastdds::dds::xtypes::TK_UNION: - { - std::cout << "" << std::endl; - DynamicData* st_data = data->loan_value(type->get_id()); - DynamicTypeMember member; - desc->get_type()->get_member(member, data->union_id_); - print_member(st_data, &member, tabs + "\t"); - break; - } - case eprosima::fastdds::dds::xtypes::TK_SEQUENCE: - case eprosima::fastdds::dds::xtypes::TK_ARRAY: - { - DynamicData* st_data = data->loan_value(type->get_id()); - print_collection(st_data, tabs + "\t"); - data->return_loaned_value(st_data); - break; - } - case eprosima::fastdds::dds::xtypes::TK_MAP: - { - std::cout << "" << std::endl; - DynamicData* st_data = data->loan_value(type->get_id()); - std::map members; - desc->get_type()->get_all_members(members); - size_t size = data->get_item_count(); - for (size_t i = 0; i < size; ++i) - { - size_t index = i * 2; - MemberId id = data->get_member_id_at_index(static_cast(index)); - std::cout << "Key: "; - print_member(st_data, members[id], tabs + "\t"); - id = data->get_member_id_at_index(static_cast(index + 1)); - std::cout << "Value: "; - print_member(st_data, members[id], tabs + "\t"); - } - data->return_loaned_value(st_data); - break; - } - default: - break; - } -} - -void DynamicDataHelper::print_member( - DynamicData* data, - std::ostream& output, - const DynamicTypeMember* type, - const std::string& tabs) -{ - output << tabs; - output << type->get_name(); - output << ": "; - const MemberDescriptor* desc = type->get_descriptor(); - switch (desc->get_kind()) - { - case eprosima::fastdds::dds::xtypes::TK_NONE: - case eprosima::fastdds::dds::xtypes::TK_BOOLEAN: - case eprosima::fastdds::dds::xtypes::TK_BYTE: - case eprosima::fastdds::dds::xtypes::TK_INT16: - case eprosima::fastdds::dds::xtypes::TK_INT32: - case eprosima::fastdds::dds::xtypes::TK_INT64: - case eprosima::fastdds::dds::xtypes::TK_UINT16: - case eprosima::fastdds::dds::xtypes::TK_UINT32: - case eprosima::fastdds::dds::xtypes::TK_UINT64: - case eprosima::fastdds::dds::xtypes::TK_FLOAT32: - case eprosima::fastdds::dds::xtypes::TK_FLOAT64: - case eprosima::fastdds::dds::xtypes::TK_FLOAT128: - case eprosima::fastdds::dds::xtypes::TK_CHAR8: - case eprosima::fastdds::dds::xtypes::TK_CHAR16: - case eprosima::fastdds::dds::xtypes::TK_STRING8: - case eprosima::fastdds::dds::xtypes::TK_STRING16: - case eprosima::fastdds::dds::xtypes::TK_ENUM: - case eprosima::fastdds::dds::xtypes::TK_BITMASK: - { - print_basic_element(data, type->get_id(), desc->get_kind(), output); - output << "\n"; - break; - } - case eprosima::fastdds::dds::xtypes::TK_STRUCTURE: - case eprosima::fastdds::dds::xtypes::TK_BITSET: - { - DynamicData* st_data = data->loan_value(type->get_id()); - output << "\n"; - std::map members; - desc->get_type()->get_all_members(members); - for (auto it : members) - { - print_member(st_data, output, it.second, tabs + "\t"); - } - data->return_loaned_value(st_data); - break; - } - case eprosima::fastdds::dds::xtypes::TK_UNION: - { - output << "\n"; - DynamicData* st_data = data->loan_value(type->get_id()); - DynamicTypeMember member; - desc->get_type()->get_member(member, data->union_id_); - print_member(st_data, output, &member, tabs + "\t"); - break; - } - case eprosima::fastdds::dds::xtypes::TK_SEQUENCE: - case eprosima::fastdds::dds::xtypes::TK_ARRAY: - { - DynamicData* st_data = data->loan_value(type->get_id()); - print_collection(st_data, output, tabs + "\t"); - data->return_loaned_value(st_data); - break; - } - case eprosima::fastdds::dds::xtypes::TK_MAP: - { - output << "\n"; - DynamicData* st_data = data->loan_value(type->get_id()); - std::map members; - desc->get_type()->get_all_members(members); - size_t size = data->get_item_count(); - for (size_t i = 0; i < size; ++i) - { - size_t index = i * 2; - MemberId id = data->get_member_id_at_index(static_cast(index)); - output << "Key: "; - print_member(st_data, output, members[id], tabs + "\t"); - id = data->get_member_id_at_index(static_cast(index + 1)); - output << "Value: "; - print_member(st_data, output, members[id], tabs + "\t"); - } - data->return_loaned_value(st_data); - break; - } - default: - break; - } -} diff --git a/src/cpp/dynamic-types/DynamicPubSubType.cpp b/src/cpp/dynamic-types/DynamicPubSubType.cpp deleted file mode 100644 index ef115ef26c3..00000000000 --- a/src/cpp/dynamic-types/DynamicPubSubType.cpp +++ /dev/null @@ -1,291 +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. - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace eprosima { -namespace fastrtps { -namespace types { - -DynamicPubSubType::DynamicPubSubType() - : dynamic_type_(nullptr) - , m_keyBuffer(nullptr) -{ -} - -DynamicPubSubType::DynamicPubSubType( - DynamicType_ptr pType) - : dynamic_type_(pType) - , m_keyBuffer(nullptr) -{ - UpdateDynamicTypeInfo(); -} - -DynamicPubSubType::~DynamicPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -void DynamicPubSubType::CleanDynamicType() -{ - dynamic_type_ = nullptr; -} - -DynamicType_ptr DynamicPubSubType::GetDynamicType() const -{ - return dynamic_type_; -} - -ReturnCode_t DynamicPubSubType::SetDynamicType( - DynamicData_ptr pData) -{ - if (dynamic_type_ == nullptr) - { - dynamic_type_ = pData->type_; - UpdateDynamicTypeInfo(); - return eprosima::fastdds::dds::RETCODE_OK; - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error Setting the dynamic type. There is already a registered type"); - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; - } -} - -ReturnCode_t DynamicPubSubType::SetDynamicType( - DynamicType_ptr pType) -{ - if (dynamic_type_ == nullptr) - { - dynamic_type_ = pType; - UpdateDynamicTypeInfo(); - return eprosima::fastdds::dds::RETCODE_OK; - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error Setting the dynamic type. There is already a registered type"); - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; - } -} - -void* DynamicPubSubType::createData() -{ - return DynamicDataFactory::get_instance()->create_data(dynamic_type_); -} - -void DynamicPubSubType::deleteData( - void* data) -{ - DynamicDataFactory::get_instance()->delete_data((DynamicData*)data); -} - -bool DynamicPubSubType::deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) -{ - eprosima::fastcdr::FastBuffer fastbuffer((char*)payload->data, payload->length); // Object that manages the raw buffer. - eprosima::fastcdr::Cdr deser(fastbuffer -#if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::DEFAULT_ENDIAN - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR -#endif // FASTCDR_VERSION_MAJOR == 1 - ); - - try - { - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - //Deserialize the object: - ((DynamicData*)data)->deserialize(deser); - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - return true; -} - -bool DynamicPubSubType::getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* handle, - bool force_md5) -{ - if (dynamic_type_ == nullptr || !m_isGetKeyDefined) - { - return false; - } - DynamicData* pDynamicData = (DynamicData*)data; - size_t keyBufferSize = static_cast(DynamicData::getKeyMaxCdrSerializedSize(dynamic_type_)); - - if (m_keyBuffer == nullptr) - { - m_keyBuffer = (unsigned char*)malloc(keyBufferSize > 16 ? keyBufferSize : 16); - memset(m_keyBuffer, 0, keyBufferSize > 16 ? keyBufferSize : 16); - } - - eprosima::fastcdr::FastBuffer fastbuffer((char*)m_keyBuffer, keyBufferSize); - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, - eprosima::fastdds::rtps::DEFAULT_XCDR_VERSION); // Object that serializes the data. - pDynamicData->serializeKey(ser); - if (force_md5 || keyBufferSize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, (unsigned int)ser.getSerializedDataLength()); -#else - m_md5.update(m_keyBuffer, (unsigned int)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; -} - -std::function DynamicPubSubType::getSerializedSizeProvider( - void* data, - fastdds::dds::DataRepresentationId_t data_representation) -{ - static_cast(data_representation); - return [data]() -> uint32_t - { - return (uint32_t)DynamicData::getCdrSerializedSize((DynamicData*)data) + 4 /*encapsulation*/; - }; -} - -bool DynamicPubSubType::serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - fastdds::dds::DataRepresentationId_t data_representation) -{ - if (dynamic_type_ == nullptr) - { - dynamic_type_ = static_cast(data)->type_; - UpdateDynamicTypeInfo(); - } - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer((char*)payload->data, payload->max_size); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == - fastdds::dds::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 - if (data_representation == fastdds::dds::DataRepresentationId_t::XCDR_DATA_REPRESENTATION) - { - if (MUTABLE == extensibility_) - { - ser.set_encoding_flag(eprosima::fastcdr::EncodingAlgorithmFlag::PL_CDR); - } - else - { - ser.set_encoding_flag(eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - } - } - else - { - if (MUTABLE == extensibility_) - { - ser.set_encoding_flag(eprosima::fastcdr::EncodingAlgorithmFlag::PL_CDR2); - } - else if (APPENDABLE == extensibility_) - { - ser.set_encoding_flag(eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); - } - else - { - ser.set_encoding_flag(eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2); - } - } -#endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - ((DynamicData*)data)->serialize(ser); // Serialize the object: - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - -#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 - return true; -} - -void DynamicPubSubType::UpdateDynamicTypeInfo() -{ - if (dynamic_type_ != nullptr) - { - m_isGetKeyDefined = dynamic_type_->key_annotation(); - - std::map membersMap; - dynamic_type_->get_all_members(membersMap); - for (auto it = membersMap.begin(); it != membersMap.end(); ++it) - { - m_isGetKeyDefined |= it->second->key_annotation(); - } - - m_typeSize = static_cast(DynamicData::getMaxCdrSerializedSize(dynamic_type_) + 4); - setName(dynamic_type_->get_name().c_str()); - - // Retrieve extensibility. - if (dynamic_type_->get_descriptor()->annotation_is_final()) - { - extensibility_ = FINAL; - } - else if (dynamic_type_->get_descriptor()->annotation_is_mutable()) - { - extensibility_ = MUTABLE; - } - else - { - extensibility_ = APPENDABLE; - } - } -} - -} // namespace types -} // namespace fastrtps -} // namespace eprosima diff --git a/src/cpp/dynamic-types/DynamicType.cpp b/src/cpp/dynamic-types/DynamicType.cpp deleted file mode 100644 index c99d594f385..00000000000 --- a/src/cpp/dynamic-types/DynamicType.cpp +++ /dev/null @@ -1,555 +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. - -#include -#include -#include -#include -#include -#include -#include - -namespace eprosima { -namespace fastrtps { -namespace types { - -DynamicType::DynamicType() - : descriptor_(nullptr) - , name_("") - , kind_(eprosima::fastdds::dds::xtypes::TK_NONE) - , is_key_defined_(false) -{ -} - -DynamicType::DynamicType( - const TypeDescriptor* descriptor) - : is_key_defined_(false) -{ - descriptor_ = new TypeDescriptor(descriptor); - try - { - name_ = descriptor->get_name(); - kind_ = descriptor->get_kind(); - } - catch (...) - { - name_ = ""; - kind_ = eprosima::fastdds::dds::xtypes::TK_NONE; - } - - // Alias types use the same members than it's base class. - if (kind_ == eprosima::fastdds::dds::xtypes::TK_ALIAS) - { - for (auto it = descriptor_->get_base_type()->member_by_id_.begin(); - it != descriptor_->get_base_type()->member_by_id_.end(); ++it) - { - member_by_name_.insert(std::make_pair(it->second->get_name(), it->second)); - } - } -} - -DynamicType::DynamicType( - const DynamicTypeBuilder* other) - : descriptor_(nullptr) - , name_("") - , kind_(eprosima::fastdds::dds::xtypes::TK_NONE) - , is_key_defined_(false) -{ - copy_from_builder(other); -} - -DynamicType::~DynamicType() -{ - clear(); -} - -ReturnCode_t DynamicType::apply_annotation( - AnnotationDescriptor& descriptor) -{ - if (descriptor.is_consistent()) - { - AnnotationDescriptor* pNewDescriptor = new AnnotationDescriptor(); - pNewDescriptor->copy_from(&descriptor); - descriptor_->annotation_.push_back(pNewDescriptor); - is_key_defined_ = key_annotation(); - return eprosima::fastdds::dds::RETCODE_OK; - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error applying annotation. The input descriptor isn't consistent."); - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; - } -} - -ReturnCode_t DynamicType::apply_annotation( - const std::string& annotation_name, - const std::string& key, - const std::string& value) -{ - AnnotationDescriptor* ann = descriptor_->get_annotation(annotation_name); - if (ann != nullptr) - { - ann->set_value(key, value); - } - else - { - AnnotationDescriptor* pNewDescriptor = new AnnotationDescriptor(); - pNewDescriptor->set_type( - DynamicTypeBuilderFactory::get_instance()->create_annotation_primitive(annotation_name)); - pNewDescriptor->set_value(key, value); - descriptor_->annotation_.push_back(pNewDescriptor); - is_key_defined_ = key_annotation(); - } - return eprosima::fastdds::dds::RETCODE_OK; -} - -ReturnCode_t DynamicType::apply_annotation_to_member( - MemberId id, - AnnotationDescriptor& descriptor) -{ - if (descriptor.is_consistent()) - { - auto it = member_by_id_.find(id); - if (it != member_by_id_.end()) - { - it->second->apply_annotation(descriptor); - return eprosima::fastdds::dds::RETCODE_OK; - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error applying annotation to member. MemberId not found."); - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; - } - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error applying annotation to member. The input descriptor isn't consistent."); - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; - } -} - -ReturnCode_t DynamicType::apply_annotation_to_member( - MemberId id, - const std::string& annotation_name, - const std::string& key, - const std::string& value) -{ - auto it = member_by_id_.find(id); - if (it != member_by_id_.end()) - { - it->second->apply_annotation(annotation_name, key, value); - return eprosima::fastdds::dds::RETCODE_OK; - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error applying annotation to member. MemberId not found."); - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; - } -} - -void DynamicType::clear() -{ - name_ = ""; - kind_ = 0; - if (descriptor_ != nullptr) - { - delete descriptor_; - descriptor_ = nullptr; - } - - for (auto it = member_by_id_.begin(); it != member_by_id_.end(); ++it) - { - delete it->second; - } - member_by_id_.clear(); - member_by_name_.clear(); -} - -ReturnCode_t DynamicType::copy_from_builder( - const DynamicTypeBuilder* other) -{ - if (other != nullptr) - { - clear(); - - name_ = other->name_; - kind_ = other->kind_; - descriptor_ = new TypeDescriptor(other->descriptor_); - - for (auto it = other->member_by_id_.begin(); it != other->member_by_id_.end(); ++it) - { - DynamicTypeMember* newMember = new DynamicTypeMember(it->second); - newMember->set_parent(this); - is_key_defined_ = newMember->key_annotation(); - member_by_id_.insert(std::make_pair(newMember->get_id(), newMember)); - member_by_name_.insert(std::make_pair(newMember->get_name(), newMember)); - } - - return eprosima::fastdds::dds::RETCODE_OK; - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error copying DynamicType, invalid input type"); - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; - } -} - -bool DynamicType::exists_member_by_name( - const std::string& name) const -{ - if (descriptor_->get_base_type() != nullptr) - { - if (descriptor_->get_base_type()->exists_member_by_name(name)) - { - return true; - } - } - return member_by_name_.find(name) != member_by_name_.end(); -} - -ReturnCode_t DynamicType::get_descriptor( - TypeDescriptor* descriptor) const -{ - if (descriptor != nullptr) - { - descriptor->copy_from(descriptor_); - return eprosima::fastdds::dds::RETCODE_OK; - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error getting TypeDescriptor, invalid input descriptor"); - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; - } -} - -const TypeDescriptor* DynamicType::get_descriptor() const -{ - return descriptor_; -} - -TypeDescriptor* DynamicType::get_descriptor() -{ - return descriptor_; -} - -bool DynamicType::key_annotation() const -{ - for (auto anIt = descriptor_->annotation_.begin(); anIt != descriptor_->annotation_.end(); ++anIt) - { - if ((*anIt)->key_annotation()) - { - return true; - } - } - return false; -} - -bool DynamicType::equals( - const DynamicType* other) const -{ - if (other != nullptr && descriptor_->annotation_.size() == other->descriptor_->annotation_.size() && - member_by_id_.size() == other->member_by_id_.size() && - member_by_name_.size() == other->member_by_name_.size()) - { - // Check the annotation list - for (auto it = descriptor_->annotation_.begin(), - it2 = other->descriptor_->annotation_.begin(); - it != descriptor_->annotation_.end(); ++it, ++it2) - { - if (!(*it)->equals(*it)) - { - return false; - } - } - - // Check the members by Id - for (auto it = member_by_id_.begin(); it != member_by_id_.end(); ++it) - { - auto it2 = other->member_by_id_.find(it->first); - if (it2 == other->member_by_id_.end() || !it2->second->equals(it->second)) - { - return false; - } - } - - for (auto it = other->member_by_id_.begin(); it != other->member_by_id_.end(); ++it) - { - auto it2 = member_by_id_.find(it->first); - if (it2 == member_by_id_.end() || !it2->second->equals(it->second)) - { - return false; - } - } - - // Check the members by Name - for (auto it = member_by_name_.begin(); it != member_by_name_.end(); ++it) - { - auto it2 = other->member_by_name_.find(it->first); - if (it2 == other->member_by_name_.end() || !it2->second->equals(it->second)) - { - return false; - } - } - - for (auto it = other->member_by_name_.begin(); it != other->member_by_name_.end(); ++it) - { - auto it2 = member_by_name_.find(it->first); - if (it2 == member_by_name_.end() || !it2->second->equals(it->second)) - { - return false; - } - } - - return true; - } - return false; -} - -MemberId DynamicType::get_members_count() const -{ - return static_cast(member_by_id_.size()); -} - -std::string DynamicType::get_name() const -{ - return name_; -} - -ReturnCode_t DynamicType::get_member_by_name( - DynamicTypeMember& member, - const std::string& name) -{ - auto it = member_by_name_.find(name); - if (it != member_by_name_.end()) - { - member = it->second; - return eprosima::fastdds::dds::RETCODE_OK; - } - else - { - EPROSIMA_LOG_WARNING(DYN_TYPES, "Error getting member by name, member not found."); - return eprosima::fastdds::dds::RETCODE_ERROR; - } -} - -ReturnCode_t DynamicType::get_all_members_by_name( - std::map& members) -{ - members = member_by_name_; - return eprosima::fastdds::dds::RETCODE_OK; -} - -ReturnCode_t DynamicType::get_member( - DynamicTypeMember& member, - MemberId id) -{ - auto it = member_by_id_.find(id); - if (it != member_by_id_.end()) - { - member = it->second; - return eprosima::fastdds::dds::RETCODE_OK; - } - else - { - EPROSIMA_LOG_WARNING(DYN_TYPES, "Error getting member, member not found."); - return eprosima::fastdds::dds::RETCODE_ERROR; - } -} - -ReturnCode_t DynamicType::get_all_members( - std::map& members) -{ - members = member_by_id_; - return eprosima::fastdds::dds::RETCODE_OK; -} - -uint32_t DynamicType::get_annotation_count() -{ - return static_cast(descriptor_->annotation_.size()); -} - -ReturnCode_t DynamicType::get_annotation( - AnnotationDescriptor& descriptor, - uint32_t idx) -{ - if (idx < descriptor_->annotation_.size()) - { - descriptor = *descriptor_->annotation_[idx]; - return eprosima::fastdds::dds::RETCODE_OK; - } - else - { - EPROSIMA_LOG_WARNING(DYN_TYPES, "Error getting annotation, annotation not found."); - return eprosima::fastdds::dds::RETCODE_ERROR; - } -} - -DynamicType_ptr DynamicType::get_base_type() const -{ - if (descriptor_ != nullptr) - { - return descriptor_->get_base_type(); - } - return DynamicType_ptr(nullptr); -} - -uint32_t DynamicType::get_bounds( - uint32_t index /*= 0*/) const -{ - if (descriptor_ != nullptr) - { - return descriptor_->get_bounds(index); - } - return BOUND_UNLIMITED; -} - -uint32_t DynamicType::get_bounds_size() const -{ - if (descriptor_ != nullptr) - { - return descriptor_->get_bounds_size(); - } - return 0; -} - -DynamicType_ptr DynamicType::get_discriminator_type() const -{ - if (descriptor_ != nullptr) - { - return descriptor_->get_discriminator_type(); - } - return DynamicType_ptr(nullptr); -} - -DynamicType_ptr DynamicType::get_element_type() const -{ - if (descriptor_ != nullptr) - { - return descriptor_->get_element_type(); - } - return DynamicType_ptr(nullptr); -} - -DynamicType_ptr DynamicType::get_key_element_type() const -{ - if (descriptor_ != nullptr) - { - return descriptor_->get_key_element_type(); - } - return DynamicType_ptr(nullptr); -} - -uint32_t DynamicType::get_total_bounds() const -{ - if (descriptor_ != nullptr) - { - return descriptor_->get_total_bounds(); - } - return BOUND_UNLIMITED; -} - -bool DynamicType::has_children() const -{ - return kind_ == eprosima::fastdds::dds::xtypes::TK_ANNOTATION || - kind_ == eprosima::fastdds::dds::xtypes::TK_ARRAY || - kind_ == eprosima::fastdds::dds::xtypes::TK_MAP || - kind_ == eprosima::fastdds::dds::xtypes::TK_SEQUENCE - || kind_ == eprosima::fastdds::dds::xtypes::TK_STRUCTURE || - kind_ == eprosima::fastdds::dds::xtypes::TK_UNION || - kind_ == eprosima::fastdds::dds::xtypes::TK_BITSET; -} - -bool DynamicType::is_complex_kind() const -{ - return kind_ == eprosima::fastdds::dds::xtypes::TK_ANNOTATION || - kind_ == eprosima::fastdds::dds::xtypes::TK_ARRAY || - kind_ == eprosima::fastdds::dds::xtypes::TK_BITMASK || - kind_ == eprosima::fastdds::dds::xtypes::TK_ENUM - || kind_ == eprosima::fastdds::dds::xtypes::TK_MAP || kind_ == eprosima::fastdds::dds::xtypes::TK_SEQUENCE || - kind_ == eprosima::fastdds::dds::xtypes::TK_STRUCTURE || - kind_ == eprosima::fastdds::dds::xtypes::TK_UNION || - kind_ == eprosima::fastdds::dds::xtypes::TK_BITSET; -} - -bool DynamicType::is_consistent() const -{ - return descriptor_->is_consistent(); -} - -bool DynamicType::is_discriminator_type() const -{ - if (kind_ == eprosima::fastdds::dds::xtypes::TK_ALIAS && descriptor_ != nullptr && - descriptor_->get_base_type() != nullptr) - { - return descriptor_->get_base_type()->is_discriminator_type(); - } - return kind_ == eprosima::fastdds::dds::xtypes::TK_BOOLEAN || kind_ == eprosima::fastdds::dds::xtypes::TK_BYTE || - kind_ == eprosima::fastdds::dds::xtypes::TK_INT16 || - kind_ == eprosima::fastdds::dds::xtypes::TK_INT32 || - kind_ == eprosima::fastdds::dds::xtypes::TK_INT64 || kind_ == eprosima::fastdds::dds::xtypes::TK_UINT16 || - kind_ == eprosima::fastdds::dds::xtypes::TK_UINT32 || - kind_ == eprosima::fastdds::dds::xtypes::TK_UINT64 || - kind_ == eprosima::fastdds::dds::xtypes::TK_FLOAT32 || kind_ == eprosima::fastdds::dds::xtypes::TK_FLOAT64 || - kind_ == eprosima::fastdds::dds::xtypes::TK_FLOAT128 || - kind_ == eprosima::fastdds::dds::xtypes::TK_CHAR8 || - kind_ == eprosima::fastdds::dds::xtypes::TK_CHAR16 || kind_ == eprosima::fastdds::dds::xtypes::TK_STRING8 || - kind_ == eprosima::fastdds::dds::xtypes::TK_STRING16 || - kind_ == eprosima::fastdds::dds::xtypes::TK_ENUM || - kind_ == eprosima::fastdds::dds::xtypes::TK_BITMASK; -} - -void DynamicType::set_name( - const std::string& name) -{ - if (descriptor_ != nullptr) - { - descriptor_->set_name(name); - } - name_ = name; -} - -size_t DynamicType::get_size() const -{ - switch (kind_) - { - case eprosima::fastdds::dds::xtypes::TK_BOOLEAN: case eprosima::fastdds::dds::xtypes::TK_BYTE: case eprosima:: - fastdds::dds::xtypes::TK_CHAR8: return 1; - case eprosima::fastdds::dds::xtypes::TK_INT16: case eprosima::fastdds::dds::xtypes::TK_UINT16: case eprosima:: - fastdds::dds::xtypes::TK_CHAR16: return 2; - case eprosima::fastdds::dds::xtypes::TK_INT32: case eprosima::fastdds::dds::xtypes::TK_UINT32: case eprosima:: - fastdds::dds::xtypes::TK_FLOAT32: return 4; - case eprosima::fastdds::dds::xtypes::TK_INT64: case eprosima::fastdds::dds::xtypes::TK_UINT64: case eprosima:: - fastdds::dds::xtypes::TK_FLOAT64: return 8; - case eprosima::fastdds::dds::xtypes::TK_FLOAT128: return 16; - case eprosima::fastdds::dds::xtypes::TK_BITMASK: case eprosima::fastdds::dds::xtypes::TK_ENUM: - { - size_t bits = descriptor_->get_bounds(0); - - if (bits % 8 == 0) - { - return bits / 8; - } - else - { - return (bits / 8) + 1; - } - } - } - EPROSIMA_LOG_ERROR(DYN_TYPES, "Called get_size() within a non primitive type! This is a program's logic error."); - return 0; -} - -} // namespace types -} // namespace fastrtps -} // namespace eprosima diff --git a/src/cpp/dynamic-types/DynamicTypeBuilder.cpp b/src/cpp/dynamic-types/DynamicTypeBuilder.cpp deleted file mode 100644 index a60b56427fc..00000000000 --- a/src/cpp/dynamic-types/DynamicTypeBuilder.cpp +++ /dev/null @@ -1,522 +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. - -#include -#include -#include -#include -#include -#include -#include -#include - -namespace eprosima { -namespace fastrtps { -namespace types { - -DynamicTypeBuilder::DynamicTypeBuilder() - : descriptor_(nullptr) - , current_member_id_(0) - , max_index_(0) -{ -} - -DynamicTypeBuilder::DynamicTypeBuilder( - const DynamicTypeBuilder* builder) - : current_member_id_(0) - , max_index_(0) -{ - copy_from_builder(builder); -} - -DynamicTypeBuilder::DynamicTypeBuilder( - const TypeDescriptor* descriptor) - : current_member_id_(0) - , max_index_(0) -{ - descriptor_ = new TypeDescriptor(descriptor); - try - { - name_ = descriptor->get_name(); - kind_ = descriptor->get_kind(); - } - catch (...) - { - name_ = ""; - kind_ = eprosima::fastdds::dds::xtypes::TK_NONE; - } - - // Alias types use the same members than it's base class. - if (kind_ == eprosima::fastdds::dds::xtypes::TK_ALIAS) - { - for (auto it = descriptor_->get_base_type()->member_by_id_.begin(); - it != descriptor_->get_base_type()->member_by_id_.end(); ++it) - { - member_by_name_.insert(std::make_pair(it->second->get_name(), it->second)); - } - } - - refresh_member_ids(); -} - -DynamicTypeBuilder::~DynamicTypeBuilder() -{ - name_ = ""; - kind_ = 0; - if (descriptor_ != nullptr) - { - delete descriptor_; - descriptor_ = nullptr; - } - - for (auto it = member_by_id_.begin(); it != member_by_id_.end(); ++it) - { - delete it->second; - } - member_by_id_.clear(); - member_by_name_.clear(); -} - -ReturnCode_t DynamicTypeBuilder::add_empty_member( - uint32_t index, - const std::string& name) -{ - MemberDescriptor descriptor(index, name); - if (descriptor_->get_kind() == eprosima::fastdds::dds::xtypes::TK_BITMASK) - { - if (index >= descriptor_->get_bounds(0)) - { - EPROSIMA_LOG_WARNING(DYN_TYPES, "Error adding member, out of bounds."); - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; - } - descriptor.annotation_set_position(static_cast(descriptor.get_index())); - } - return add_member(&descriptor); -} - -ReturnCode_t DynamicTypeBuilder::add_member( - const MemberDescriptor* descriptor) -{ - if (descriptor_ != nullptr && descriptor != nullptr && descriptor->is_consistent(descriptor_->get_kind())) - { - if (descriptor_->get_kind() == eprosima::fastdds::dds::xtypes::TK_ANNOTATION || - descriptor_->get_kind() == eprosima::fastdds::dds::xtypes::TK_BITMASK - || descriptor_->get_kind() == eprosima::fastdds::dds::xtypes::TK_ENUM || - descriptor_->get_kind() == eprosima::fastdds::dds::xtypes::TK_STRUCTURE - || descriptor_->get_kind() == eprosima::fastdds::dds::xtypes::TK_UNION || - descriptor_->get_kind() == eprosima::fastdds::dds::xtypes::TK_BITSET) - { - if (!exists_member_by_name(descriptor->get_name()) || - (kind_ == eprosima::fastdds::dds::xtypes::TK_BITSET && descriptor->get_name().empty())) // Bitsets allow multiple empty members. - { - if (check_union_configuration(descriptor)) - { - DynamicTypeMember* newMember = new DynamicTypeMember(descriptor, current_member_id_); - - // If the index of the new member is bigger than the current maximum, put it at the end. - if (newMember->get_index() > max_index_) - { - newMember->set_index(max_index_++); - } - else - { - // Move every member bigger than the current index to the right. - for (auto it = member_by_id_.begin(); it != member_by_id_.end(); ++it) - { - if (it->second->get_index() >= newMember->get_index()) - { - it->second->set_index(it->second->get_index() + 1); - } - } - } - - if (!descriptor->get_name().empty()) // Don't store empty bitset members. - { - member_by_id_.insert(std::make_pair(current_member_id_, newMember)); - member_by_name_.insert(std::make_pair(newMember->get_name(), newMember)); - } - else - { - delete newMember; - } - ++current_member_id_; - return eprosima::fastdds::dds::RETCODE_OK; - } - else - { - EPROSIMA_LOG_WARNING(DYN_TYPES, "Error adding member, invalid union parameters."); - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; - } - } - else - { - EPROSIMA_LOG_WARNING(DYN_TYPES, "Error adding member, there is other member with the same name."); - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; - } - } - else - { - EPROSIMA_LOG_WARNING(DYN_TYPES, "Error adding member, the current type " << descriptor_->get_kind() - << " doesn't support members."); - return eprosima::fastdds::dds::RETCODE_PRECONDITION_NOT_MET; - } - } - else - { - if (descriptor == nullptr) - { - EPROSIMA_LOG_WARNING(DYN_TYPES, "Error adding member, Invalid input descriptor."); - } - else - { - EPROSIMA_LOG_WARNING(DYN_TYPES, "Error adding member, The input descriptor isn't consistent."); - } - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; - } -} - -FASTDDS_EXPORTED_API MemberId DynamicTypeBuilder::get_member_id_by_name( - const std::string& name) const -{ - auto it = member_by_name_.find(name); - if (it != member_by_name_.end()) - { - return it->second->get_id(); - } - return MEMBER_ID_INVALID; -} - -ReturnCode_t DynamicTypeBuilder::add_member( - MemberId id, - const std::string& name, - DynamicTypeBuilder* type) -{ - if (type != nullptr) - { - MemberDescriptor descriptor(id, name, DynamicTypeBuilderFactory::get_instance()->create_type(type)); - return add_member(&descriptor); - } - else - { - MemberDescriptor descriptor(id, name, DynamicType_ptr(nullptr)); - return add_member(&descriptor); - } -} - -ReturnCode_t DynamicTypeBuilder::add_member( - MemberId id, - const std::string& name, - DynamicTypeBuilder* type, - const std::string& defaultValue) -{ - MemberDescriptor descriptor(id, name, DynamicTypeBuilderFactory::get_instance()->create_type(type), defaultValue); - return add_member(&descriptor); -} - -ReturnCode_t DynamicTypeBuilder::add_member( - MemberId id, - const std::string& name, - DynamicTypeBuilder* type, - const std::string& defaultValue, - const std::vector& unionLabels, - bool isDefaultLabel) -{ - MemberDescriptor descriptor(id, name, DynamicTypeBuilderFactory::get_instance()->create_type(type), - defaultValue, unionLabels, isDefaultLabel); - return add_member(&descriptor); -} - -ReturnCode_t DynamicTypeBuilder::add_member( - MemberId id, - const std::string& name, - DynamicType_ptr type) -{ - MemberDescriptor descriptor(id, name, type); - return add_member(&descriptor); -} - -ReturnCode_t DynamicTypeBuilder::add_member( - MemberId id, - const std::string& name, - DynamicType_ptr type, - const std::string& defaultValue) -{ - MemberDescriptor descriptor(id, name, type, defaultValue); - return add_member(&descriptor); -} - -ReturnCode_t DynamicTypeBuilder::add_member( - MemberId id, - const std::string& name, - DynamicType_ptr type_, - const std::string& defaultValue, - const std::vector& unionLabels, - bool isDefaultLabel) -{ - MemberDescriptor descriptor(id, name, type_, defaultValue, unionLabels, isDefaultLabel); - return add_member(&descriptor); -} - -ReturnCode_t DynamicTypeBuilder::apply_annotation( - AnnotationDescriptor& descriptor) -{ - return descriptor_->apply_annotation(descriptor); -} - -ReturnCode_t DynamicTypeBuilder::apply_annotation( - const std::string& annotation_name, - const std::string& key, - const std::string& value) -{ - return descriptor_->apply_annotation(annotation_name, key, value); -} - -ReturnCode_t DynamicTypeBuilder::apply_annotation_to_member( - MemberId id, - AnnotationDescriptor& descriptor) -{ - return _apply_annotation_to_member(id, descriptor); -} - -ReturnCode_t DynamicTypeBuilder::apply_annotation_to_member( - MemberId id, - const std::string& annotation_name, - const std::string& key, - const std::string& value) -{ - return _apply_annotation_to_member(id, annotation_name, key, value); -} - -DynamicType_ptr DynamicTypeBuilder::build() -{ - if (descriptor_->is_consistent()) - { - return DynamicTypeBuilderFactory::get_instance()->create_type(this); - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error building type. The current descriptor isn't consistent."); - return DynamicType_ptr(nullptr); - } -} - -bool DynamicTypeBuilder::check_union_configuration( - const MemberDescriptor* descriptor) -{ - if (descriptor_->get_kind() == eprosima::fastdds::dds::xtypes::TK_UNION) - { - if (!descriptor->is_default_union_value() && descriptor->get_union_labels().size() == 0) - { - return false; - } - for (auto it = member_by_id_.begin(); it != member_by_id_.end(); ++it) - { - // Check that there isn't any member as default label and that there isn't any member with the same case. - if ((descriptor->is_default_union_value() && it->second->is_default_union_value()) || - !descriptor->check_union_labels(it->second->get_union_labels())) - { - return false; - } - } - } - return true; -} - -ReturnCode_t DynamicTypeBuilder::copy_from( - const DynamicTypeBuilder* other) -{ - if (other != nullptr) - { - clear(); - - ReturnCode_t res = copy_from_builder(other); - if (res == eprosima::fastdds::dds::RETCODE_OK) - { - current_member_id_ = other->current_member_id_; - } - return res; - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error copying DynamicTypeBuilder. Invalid input parameter."); - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; - } -} - -ReturnCode_t DynamicTypeBuilder::copy_from_builder( - const DynamicTypeBuilder* other) -{ - if (other != nullptr) - { - clear(); - - name_ = other->name_; - kind_ = other->kind_; - descriptor_ = new TypeDescriptor(other->descriptor_); - - for (auto it = other->member_by_id_.begin(); it != other->member_by_id_.end(); ++it) - { - DynamicTypeMember* newMember = new DynamicTypeMember(it->second); - member_by_id_.insert(std::make_pair(newMember->get_id(), newMember)); - member_by_name_.insert(std::make_pair(newMember->get_name(), newMember)); - } - - return eprosima::fastdds::dds::RETCODE_OK; - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error copying DynamicType, invalid input type"); - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; - } -} - -void DynamicTypeBuilder::clear() -{ - name_ = ""; - kind_ = 0; - if (descriptor_ != nullptr) - { - delete descriptor_; - descriptor_ = nullptr; - } - - for (auto it = member_by_id_.begin(); it != member_by_id_.end(); ++it) - { - delete it->second; - } - member_by_id_.clear(); - member_by_name_.clear(); - current_member_id_ = 0; -} - -bool DynamicTypeBuilder::exists_member_by_name( - const std::string& name) const -{ - if (descriptor_->get_base_type() != nullptr) - { - if (descriptor_->get_base_type()->exists_member_by_name(name)) - { - return true; - } - } - return member_by_name_.find(name) != member_by_name_.end(); -} - -ReturnCode_t DynamicTypeBuilder::get_all_members( - std::map& members) -{ - members = member_by_id_; - return eprosima::fastdds::dds::RETCODE_OK; -} - -std::string DynamicTypeBuilder::get_name() const -{ - return name_; -} - -bool DynamicTypeBuilder::is_consistent() const -{ - return descriptor_->is_consistent(); -} - -bool DynamicTypeBuilder::is_discriminator_type() const -{ - if (kind_ == eprosima::fastdds::dds::xtypes::TK_ALIAS && descriptor_ != nullptr && - descriptor_->get_base_type() != nullptr) - { - return descriptor_->get_base_type()->is_discriminator_type(); - } - return kind_ == eprosima::fastdds::dds::xtypes::TK_BOOLEAN || kind_ == eprosima::fastdds::dds::xtypes::TK_BYTE || - kind_ == eprosima::fastdds::dds::xtypes::TK_INT16 || - kind_ == eprosima::fastdds::dds::xtypes::TK_INT32 || - kind_ == eprosima::fastdds::dds::xtypes::TK_INT64 || kind_ == eprosima::fastdds::dds::xtypes::TK_UINT16 || - kind_ == eprosima::fastdds::dds::xtypes::TK_UINT32 || - kind_ == eprosima::fastdds::dds::xtypes::TK_UINT64 || - kind_ == eprosima::fastdds::dds::xtypes::TK_FLOAT32 || kind_ == eprosima::fastdds::dds::xtypes::TK_FLOAT64 || - kind_ == eprosima::fastdds::dds::xtypes::TK_FLOAT128 || - kind_ == eprosima::fastdds::dds::xtypes::TK_CHAR8 || - kind_ == eprosima::fastdds::dds::xtypes::TK_CHAR16 || kind_ == eprosima::fastdds::dds::xtypes::TK_STRING8 || - kind_ == eprosima::fastdds::dds::xtypes::TK_STRING16 || - kind_ == eprosima::fastdds::dds::xtypes::TK_ENUM || - kind_ == eprosima::fastdds::dds::xtypes::TK_BITMASK; -} - -void DynamicTypeBuilder::refresh_member_ids() -{ - if ((descriptor_->get_kind() == eprosima::fastdds::dds::xtypes::TK_STRUCTURE || - descriptor_->get_kind() == eprosima::fastdds::dds::xtypes::TK_BITSET) && - descriptor_->get_base_type() != nullptr) - { - current_member_id_ = descriptor_->get_base_type()->get_members_count(); - } -} - -ReturnCode_t DynamicTypeBuilder::set_name( - const std::string& name) -{ - if (descriptor_ != nullptr) - { - descriptor_->set_name(name); - } - name_ = name; - return eprosima::fastdds::dds::RETCODE_OK; -} - -ReturnCode_t DynamicTypeBuilder::_apply_annotation_to_member( - MemberId id, - AnnotationDescriptor& descriptor) -{ - if (descriptor.is_consistent()) - { - auto it = member_by_id_.find(id); - if (it != member_by_id_.end()) - { - it->second->apply_annotation(descriptor); - return eprosima::fastdds::dds::RETCODE_OK; - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error applying annotation to member. MemberId not found."); - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; - } - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error applying annotation to member. The input descriptor isn't consistent."); - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; - } -} - -ReturnCode_t DynamicTypeBuilder::_apply_annotation_to_member( - MemberId id, - const std::string& annotation_name, - const std::string& key, - const std::string& value) -{ - auto it = member_by_id_.find(id); - if (it != member_by_id_.end()) - { - it->second->apply_annotation(annotation_name, key, value); - return eprosima::fastdds::dds::RETCODE_OK; - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error applying annotation to member. MemberId not found."); - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; - } -} - -} // namespace types -} // namespace fastrtps -} // namespace eprosima diff --git a/src/cpp/dynamic-types/DynamicTypeBuilderFactory.cpp b/src/cpp/dynamic-types/DynamicTypeBuilderFactory.cpp deleted file mode 100644 index 73ce32a65aa..00000000000 --- a/src/cpp/dynamic-types/DynamicTypeBuilderFactory.cpp +++ /dev/null @@ -1,2886 +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. - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace eprosima { -namespace fastrtps { -namespace types { - -static std::string get_type_name( - TypeKind kind) -{ - switch (kind) - { - // Primitive types, already defined (never will be asked, but ok) - case eprosima::fastdds::dds::xtypes::TK_BOOLEAN: return TKNAME_BOOLEAN; - case eprosima::fastdds::dds::xtypes::TK_INT16: return TKNAME_INT16; - case eprosima::fastdds::dds::xtypes::TK_INT32: return TKNAME_INT32; - case eprosima::fastdds::dds::xtypes::TK_UINT16: return TKNAME_UINT16; - case eprosima::fastdds::dds::xtypes::TK_UINT32: return TKNAME_UINT32; - case eprosima::fastdds::dds::xtypes::TK_FLOAT32: return TKNAME_FLOAT32; - case eprosima::fastdds::dds::xtypes::TK_FLOAT64: return TKNAME_FLOAT64; - case eprosima::fastdds::dds::xtypes::TK_CHAR8: return TKNAME_CHAR8; - case eprosima::fastdds::dds::xtypes::TK_BYTE: return TKNAME_BYTE; - case eprosima::fastdds::dds::xtypes::TK_INT64: return TKNAME_INT64; - case eprosima::fastdds::dds::xtypes::TK_UINT64: return TKNAME_UINT64; - case eprosima::fastdds::dds::xtypes::TK_FLOAT128: return TKNAME_FLOAT128; - case eprosima::fastdds::dds::xtypes::TK_CHAR16: return TKNAME_CHAR16; - /* - case eprosima::fastdds::dds::xtypes::TK_STRING8: return TKNAME_STRING8; - case eprosima::fastdds::dds::xtypes::TK_STRING16: return TKNAME_STRING16; - case eprosima::fastdds::dds::xtypes::TK_ALIAS: return TKNAME_ALIAS; - case eprosima::fastdds::dds::xtypes::TK_ENUM: return TKNAME_ENUM; - */ - case eprosima::fastdds::dds::xtypes::TK_BITMASK: return TKNAME_BITMASK; - /* - case eprosima::fastdds::dds::xtypes::TK_ANNOTATION: return TKNAME_ANNOTATION; - case eprosima::fastdds::dds::xtypes::TK_STRUCTURE: return TKNAME_STRUCTURE; - case eprosima::fastdds::dds::xtypes::TK_UNION: return TKNAME_UNION; - */ - case eprosima::fastdds::dds::xtypes::TK_BITSET: return TKNAME_BITSET; - /* - case eprosima::fastdds::dds::xtypes::TK_SEQUENCE: return TKNAME_SEQUENCE; - case eprosima::fastdds::dds::xtypes::TK_ARRAY: return TKNAME_ARRAY; - case eprosima::fastdds::dds::xtypes::TK_MAP: return TKNAME_MAP; - */ - default: - break; - } - return "UNDEF"; -} - -//static uint32_t s_typeNameCounter = 0; -static std::string GenerateTypeName( - const std::string& kind) -{ - std::string tempKind = kind; - std::replace(tempKind.begin(), tempKind.end(), ' ', '_'); - return tempKind;// + "_" + std::to_string(++s_typeNameCounter); -} - -class DynamicTypeBuilderFactoryReleaser -{ -public: - - ~DynamicTypeBuilderFactoryReleaser() - { - DynamicTypeBuilderFactory::delete_instance(); - } - -}; - -static DynamicTypeBuilderFactoryReleaser s_releaser; -static DynamicTypeBuilderFactory* g_instance = nullptr; -DynamicTypeBuilderFactory* DynamicTypeBuilderFactory::get_instance() -{ - if (g_instance == nullptr) - { - g_instance = new DynamicTypeBuilderFactory(); - } - return g_instance; -} - -ReturnCode_t DynamicTypeBuilderFactory::delete_instance() -{ - if (g_instance != nullptr) - { - delete g_instance; - g_instance = nullptr; - return eprosima::fastdds::dds::RETCODE_OK; - } - return eprosima::fastdds::dds::RETCODE_ERROR; -} - -DynamicTypeBuilderFactory::DynamicTypeBuilderFactory() -{ -} - -DynamicTypeBuilderFactory::~DynamicTypeBuilderFactory() -{ -#ifndef DISABLE_DYNAMIC_MEMORY_CHECK - std::unique_lock scoped(mutex_); - for (auto it = builders_list_.begin(); it != builders_list_.end(); ++it) - { - delete *it; - } - builders_list_.clear(); -#endif // ifndef DISABLE_DYNAMIC_MEMORY_CHECK -} - -void DynamicTypeBuilderFactory::add_builder_to_list( - DynamicTypeBuilder* pBuilder) -{ - (void)pBuilder; -#ifndef DISABLE_DYNAMIC_MEMORY_CHECK - std::unique_lock scoped(mutex_); - builders_list_.push_back(pBuilder); -#endif // ifndef DISABLE_DYNAMIC_MEMORY_CHECK -} - -DynamicType_ptr DynamicTypeBuilderFactory::build_type( - DynamicType_ptr other) -{ - return other; -} - -DynamicType_ptr DynamicTypeBuilderFactory::create_type( - const TypeDescriptor* descriptor, - const std::string& name) -{ - if (descriptor != nullptr) - { - DynamicType_ptr pNewType(new DynamicType(descriptor)); - if (name.length() > 0) - { - pNewType->set_name(name); - } - return pNewType; - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error building type, invalid input descriptor"); - return DynamicType_ptr(nullptr); - } -} - -DynamicType_ptr DynamicTypeBuilderFactory::create_type( - const DynamicTypeBuilder* other) -{ - if (other != nullptr) - { - DynamicType_ptr pNewType(new DynamicType(other)); - return pNewType; - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error building type, invalid input parameter"); - return DynamicType_ptr(nullptr); - } -} - -DynamicTypeBuilder* DynamicTypeBuilderFactory::create_alias_builder( - DynamicTypeBuilder* base_type, - const std::string& sName) -{ - if (base_type != nullptr) - { - DynamicType_ptr pType = create_type(base_type); - if (pType != nullptr) - { - return create_alias_builder(pType, sName); - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error creating alias type, Error creating dynamic type"); - } - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error creating alias type, base_type must be valid"); - } - return nullptr; -} - -DynamicTypeBuilder* DynamicTypeBuilderFactory::create_alias_builder( - DynamicType_ptr base_type, - const std::string& sName) -{ - if (base_type != nullptr) - { - TypeDescriptor pDescriptor; - pDescriptor.kind_ = eprosima::fastdds::dds::xtypes::TK_ALIAS; - pDescriptor.base_type_ = base_type; - if (sName.length() > 0) - { - pDescriptor.name_ = sName; - } - else - { - //pDescriptor.name_ = GenerateTypeName(get_type_name(eprosima::fastdds::dds::xtypes::TK_ALIAS)); - pDescriptor.name_ = base_type->get_name(); - } - - DynamicTypeBuilder* pNewTypeBuilder = new DynamicTypeBuilder(&pDescriptor); - add_builder_to_list(pNewTypeBuilder); - return pNewTypeBuilder; - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error creating alias type, base_type must be valid"); - } - return nullptr; -} - -DynamicTypeBuilder* DynamicTypeBuilderFactory::create_array_builder( - const DynamicTypeBuilder* element_type, - const std::vector& bounds) -{ - if (element_type != nullptr) - { - DynamicType_ptr pType = create_type(element_type); - if (pType != nullptr) - { - return create_array_builder(pType, bounds); - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error creating array, error creating dynamic type"); - } - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error creating array, element_type must be valid"); - } - return nullptr; -} - -DynamicTypeBuilder* DynamicTypeBuilderFactory::create_array_builder( - const DynamicType_ptr type, - const std::vector& bounds) -{ - if (type != nullptr) - { - TypeDescriptor pDescriptor; - pDescriptor.kind_ = eprosima::fastdds::dds::xtypes::TK_ARRAY; - // pDescriptor.name_ = TypeNamesGenerator::get_array_type_name(type->get_name(), bounds, false); - pDescriptor.element_type_ = type; - pDescriptor.bound_ = bounds; - - for (uint32_t i = 0; i < pDescriptor.bound_.size(); ++i) - { - if (pDescriptor.bound_[i] == 0) - { - pDescriptor.bound_[i] = MAX_ELEMENTS_COUNT; - } - } - - - DynamicTypeBuilder* pNewTypeBuilder = new DynamicTypeBuilder(&pDescriptor); - add_builder_to_list(pNewTypeBuilder); - return pNewTypeBuilder; - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error creating array, element_type must be valid"); - } - return nullptr; -} - -DynamicTypeBuilder* DynamicTypeBuilderFactory::create_bitmask_builder( - uint32_t bound) -{ - if (bound <= MAX_BITMASK_LENGTH) - { - TypeDescriptor pBoolDescriptor; - pBoolDescriptor.kind_ = eprosima::fastdds::dds::xtypes::TK_BOOLEAN; - pBoolDescriptor.name_ = GenerateTypeName(get_type_name(eprosima::fastdds::dds::xtypes::TK_BOOLEAN)); - - TypeDescriptor pDescriptor; - pDescriptor.kind_ = eprosima::fastdds::dds::xtypes::TK_BITMASK; - // TODO review on implementation for IDL - pDescriptor.name_ = GenerateTypeName(get_type_name(eprosima::fastdds::dds::xtypes::TK_BITMASK)); - pDescriptor.element_type_ = create_type(&pBoolDescriptor); - pDescriptor.bound_.push_back(bound); - - DynamicTypeBuilder* pNewTypeBuilder = new DynamicTypeBuilder(&pDescriptor); - add_builder_to_list(pNewTypeBuilder); - return pNewTypeBuilder; - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, - "Error creating bitmask, length exceeds the maximum value '" << MAX_BITMASK_LENGTH << "'"); - } - return nullptr; -} - -DynamicTypeBuilder* DynamicTypeBuilderFactory::create_bitset_builder() -{ - TypeDescriptor pDescriptor; - pDescriptor.kind_ = eprosima::fastdds::dds::xtypes::TK_BITSET; - // TODO Review on implementation for IDL - pDescriptor.name_ = GenerateTypeName(get_type_name(eprosima::fastdds::dds::xtypes::TK_BITSET)); - - DynamicTypeBuilder* pNewTypeBuilder = new DynamicTypeBuilder(&pDescriptor); - add_builder_to_list(pNewTypeBuilder); - return pNewTypeBuilder; - return nullptr; -} - -DynamicTypeBuilder* DynamicTypeBuilderFactory::create_bool_builder() -{ - TypeDescriptor pBoolDescriptor; - pBoolDescriptor.kind_ = eprosima::fastdds::dds::xtypes::TK_BOOLEAN; - pBoolDescriptor.name_ = GenerateTypeName(get_type_name(eprosima::fastdds::dds::xtypes::TK_BOOLEAN)); - - DynamicTypeBuilder* pNewTypeBuilder = new DynamicTypeBuilder(&pBoolDescriptor); - add_builder_to_list(pNewTypeBuilder); - return pNewTypeBuilder; -} - -DynamicTypeBuilder* DynamicTypeBuilderFactory::create_byte_builder() -{ - TypeDescriptor pByteDescriptor; - pByteDescriptor.kind_ = eprosima::fastdds::dds::xtypes::TK_BYTE; - pByteDescriptor.name_ = GenerateTypeName(get_type_name(eprosima::fastdds::dds::xtypes::TK_BYTE)); - - DynamicTypeBuilder* pNewTypeBuilder = new DynamicTypeBuilder(&pByteDescriptor); - add_builder_to_list(pNewTypeBuilder); - return pNewTypeBuilder; -} - -DynamicTypeBuilder* DynamicTypeBuilderFactory::create_char8_builder() -{ - TypeDescriptor pChar8Descriptor; - pChar8Descriptor.kind_ = eprosima::fastdds::dds::xtypes::TK_CHAR8; - pChar8Descriptor.name_ = GenerateTypeName(get_type_name(eprosima::fastdds::dds::xtypes::TK_CHAR8)); - - DynamicTypeBuilder* pNewTypeBuilder = new DynamicTypeBuilder(&pChar8Descriptor); - add_builder_to_list(pNewTypeBuilder); - return pNewTypeBuilder; -} - -DynamicTypeBuilder* DynamicTypeBuilderFactory::create_char16_builder() -{ - TypeDescriptor pChar16Descriptor; - pChar16Descriptor.kind_ = eprosima::fastdds::dds::xtypes::TK_CHAR16; - pChar16Descriptor.name_ = GenerateTypeName(get_type_name(eprosima::fastdds::dds::xtypes::TK_CHAR16)); - - DynamicTypeBuilder* pNewTypeBuilder = new DynamicTypeBuilder(&pChar16Descriptor); - add_builder_to_list(pNewTypeBuilder); - return pNewTypeBuilder; -} - -DynamicType_ptr DynamicTypeBuilderFactory::create_annotation_primitive( - const std::string& name) -{ - TypeDescriptor pEnumDescriptor; - pEnumDescriptor.kind_ = eprosima::fastdds::dds::xtypes::TK_ANNOTATION; - //pEnumDescriptor.name_ = GenerateTypeName(get_type_name(eprosima::fastdds::dds::xtypes::TK_ANNOTATION)); - pEnumDescriptor.name_ = name; - - return DynamicType_ptr(new DynamicType(&pEnumDescriptor)); -} - -DynamicTypeBuilder* DynamicTypeBuilderFactory::create_enum_builder() -{ - TypeDescriptor pEnumDescriptor; - pEnumDescriptor.kind_ = eprosima::fastdds::dds::xtypes::TK_ENUM; - //pEnumDescriptor.name_ = GenerateTypeName(get_type_name(eprosima::fastdds::dds::xtypes::TK_ENUM)); - // Enum currently is an alias for uint32_t - pEnumDescriptor.name_ = GenerateTypeName(get_type_name(eprosima::fastdds::dds::xtypes::TK_UINT32)); - - DynamicTypeBuilder* pNewTypeBuilder = new DynamicTypeBuilder(&pEnumDescriptor); - add_builder_to_list(pNewTypeBuilder); - return pNewTypeBuilder; -} - -DynamicTypeBuilder* DynamicTypeBuilderFactory::create_float32_builder() -{ - TypeDescriptor pFloat32Descriptor; - pFloat32Descriptor.kind_ = eprosima::fastdds::dds::xtypes::TK_FLOAT32; - pFloat32Descriptor.name_ = GenerateTypeName(get_type_name(eprosima::fastdds::dds::xtypes::TK_FLOAT32)); - - DynamicTypeBuilder* pNewTypeBuilder = new DynamicTypeBuilder(&pFloat32Descriptor); - add_builder_to_list(pNewTypeBuilder); - return pNewTypeBuilder; -} - -DynamicTypeBuilder* DynamicTypeBuilderFactory::create_float64_builder() -{ - TypeDescriptor pFloat64Descriptor; - pFloat64Descriptor.kind_ = eprosima::fastdds::dds::xtypes::TK_FLOAT64; - pFloat64Descriptor.name_ = GenerateTypeName(get_type_name(eprosima::fastdds::dds::xtypes::TK_FLOAT64)); - - DynamicTypeBuilder* pNewTypeBuilder = new DynamicTypeBuilder(&pFloat64Descriptor); - add_builder_to_list(pNewTypeBuilder); - return pNewTypeBuilder; -} - -DynamicTypeBuilder* DynamicTypeBuilderFactory::create_float128_builder() -{ - TypeDescriptor pFloat128Descriptor; - pFloat128Descriptor.kind_ = eprosima::fastdds::dds::xtypes::TK_FLOAT128; - pFloat128Descriptor.name_ = GenerateTypeName(get_type_name(eprosima::fastdds::dds::xtypes::TK_FLOAT128)); - - DynamicTypeBuilder* pNewTypeBuilder = new DynamicTypeBuilder(&pFloat128Descriptor); - add_builder_to_list(pNewTypeBuilder); - return pNewTypeBuilder; -} - -DynamicTypeBuilder* DynamicTypeBuilderFactory::create_int16_builder() -{ - TypeDescriptor pInt16Descriptor; - pInt16Descriptor.kind_ = eprosima::fastdds::dds::xtypes::TK_INT16; - pInt16Descriptor.name_ = GenerateTypeName(get_type_name(eprosima::fastdds::dds::xtypes::TK_INT16)); - - DynamicTypeBuilder* pNewTypeBuilder = new DynamicTypeBuilder(&pInt16Descriptor); - add_builder_to_list(pNewTypeBuilder); - return pNewTypeBuilder; -} - -DynamicTypeBuilder* DynamicTypeBuilderFactory::create_int32_builder() -{ - TypeDescriptor pInt32Descriptor; - pInt32Descriptor.kind_ = eprosima::fastdds::dds::xtypes::TK_INT32; - pInt32Descriptor.name_ = GenerateTypeName(get_type_name(eprosima::fastdds::dds::xtypes::TK_INT32)); - - DynamicTypeBuilder* pNewTypeBuilder = new DynamicTypeBuilder(&pInt32Descriptor); - add_builder_to_list(pNewTypeBuilder); - return pNewTypeBuilder; -} - -DynamicTypeBuilder* DynamicTypeBuilderFactory::create_int64_builder() -{ - TypeDescriptor pInt64Descriptor; - pInt64Descriptor.kind_ = eprosima::fastdds::dds::xtypes::TK_INT64; - pInt64Descriptor.name_ = GenerateTypeName(get_type_name(eprosima::fastdds::dds::xtypes::TK_INT64)); - - DynamicTypeBuilder* pNewTypeBuilder = new DynamicTypeBuilder(&pInt64Descriptor); - add_builder_to_list(pNewTypeBuilder); - return pNewTypeBuilder; -} - -DynamicTypeBuilder* DynamicTypeBuilderFactory::create_map_builder( - DynamicTypeBuilder* key_element_type, - DynamicTypeBuilder* element_type, - uint32_t bound) -{ - if (key_element_type != nullptr && element_type != nullptr) - { - DynamicType_ptr pKeyType = create_type(key_element_type); - DynamicType_ptr pValueType = create_type(element_type); - if (pKeyType != nullptr && pValueType != nullptr) - { - return create_map_builder(pKeyType, pValueType, bound); - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error creating map, Error creating dynamic types."); - } - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error creating map, element_type and key_element_type must be valid."); - } - return nullptr; -} - -DynamicTypeBuilder* DynamicTypeBuilderFactory::create_map_builder( - DynamicType_ptr key_type, - DynamicType_ptr value_type, - uint32_t bound) -{ - if (key_type != nullptr && value_type != nullptr) - { - if (bound == BOUND_UNLIMITED) - { - bound = MAX_ELEMENTS_COUNT; - } - - TypeDescriptor pDescriptor; - pDescriptor.kind_ = eprosima::fastdds::dds::xtypes::TK_MAP; - //pDescriptor.name_ = GenerateTypeName(get_type_name(eprosima::fastdds::dds::xtypes::TK_MAP)); - pDescriptor.bound_.push_back(bound); - pDescriptor.key_element_type_ = key_type; - pDescriptor.element_type_ = value_type; - - // pDescriptor.name_ = TypeNamesGenerator::get_map_type_name(key_type->get_name(), value_type->get_name(), - // bound, false); - - DynamicTypeBuilder* pNewTypeBuilder = new DynamicTypeBuilder(&pDescriptor); - add_builder_to_list(pNewTypeBuilder); - return pNewTypeBuilder; - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error creating map, element_type and key_element_type must be valid."); - } - return nullptr; -} - -DynamicTypeBuilder* DynamicTypeBuilderFactory::create_sequence_builder( - const DynamicTypeBuilder* element_type, - uint32_t bound) -{ - if (element_type != nullptr) - { - DynamicType_ptr pType = create_type(element_type); - if (pType != nullptr) - { - return create_sequence_builder(pType, bound); - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error creating sequence, error creating dynamic type."); - } - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error creating sequence, element_type must be valid."); - } - return nullptr; -} - -DynamicTypeBuilder* DynamicTypeBuilderFactory::create_sequence_builder( - const DynamicType_ptr type, - uint32_t bound) -{ - if (type != nullptr) - { - if (bound == BOUND_UNLIMITED) - { - bound = MAX_ELEMENTS_COUNT; - } - - TypeDescriptor pDescriptor; - pDescriptor.kind_ = eprosima::fastdds::dds::xtypes::TK_SEQUENCE; - // pDescriptor.name_ = TypeNamesGenerator::get_sequence_type_name(type->get_name(), bound, false); - pDescriptor.bound_.push_back(bound); - pDescriptor.element_type_ = type; - - DynamicTypeBuilder* pNewTypeBuilder = new DynamicTypeBuilder(&pDescriptor); - add_builder_to_list(pNewTypeBuilder); - return pNewTypeBuilder; - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error creating sequence, element_type must be valid."); - } - return nullptr; -} - -DynamicTypeBuilder* DynamicTypeBuilderFactory::create_string_builder( - uint32_t bound) -{ - if (bound == BOUND_UNLIMITED) - { - bound = MAX_STRING_LENGTH; - } - - TypeDescriptor pCharDescriptor; - pCharDescriptor.kind_ = eprosima::fastdds::dds::xtypes::TK_CHAR8; - pCharDescriptor.name_ = GenerateTypeName(get_type_name(eprosima::fastdds::dds::xtypes::TK_CHAR8)); - - TypeDescriptor pDescriptor; - pDescriptor.kind_ = eprosima::fastdds::dds::xtypes::TK_STRING8; - //pDescriptor.name_ = GenerateTypeName(get_type_name(eprosima::fastdds::dds::xtypes::TK_STRING8)); - pDescriptor.element_type_ = create_type(&pCharDescriptor); - pDescriptor.bound_.push_back(bound); - - // pDescriptor.name_ = TypeNamesGenerator::get_string_type_name(bound, false, true); - - DynamicTypeBuilder* pNewTypeBuilder = new DynamicTypeBuilder(&pDescriptor); - add_builder_to_list(pNewTypeBuilder); - return pNewTypeBuilder; -} - -DynamicTypeBuilder* DynamicTypeBuilderFactory::create_child_struct_builder( - DynamicTypeBuilder* parent_type) -{ - if (parent_type != nullptr && - (parent_type->get_kind() == eprosima::fastdds::dds::xtypes::TK_STRUCTURE || - parent_type->get_kind() == eprosima::fastdds::dds::xtypes::TK_BITSET)) - { - TypeDescriptor pDescriptor; - pDescriptor.kind_ = parent_type->get_kind(); - pDescriptor.name_ = GenerateTypeName(get_type_name(parent_type->get_kind())); - pDescriptor.base_type_ = create_type(parent_type); - - DynamicTypeBuilder* pNewTypeBuilder = new DynamicTypeBuilder(&pDescriptor); - add_builder_to_list(pNewTypeBuilder); - return pNewTypeBuilder; - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error creating child struct, invalid input type."); - return nullptr; - } -} - -DynamicTypeBuilder* DynamicTypeBuilderFactory::create_struct_builder() -{ - TypeDescriptor pDescriptor; - pDescriptor.kind_ = eprosima::fastdds::dds::xtypes::TK_STRUCTURE; - pDescriptor.name_ = GenerateTypeName(get_type_name(eprosima::fastdds::dds::xtypes::TK_STRUCTURE)); - - DynamicTypeBuilder* pNewTypeBuilder = new DynamicTypeBuilder(&pDescriptor); - add_builder_to_list(pNewTypeBuilder); - return pNewTypeBuilder; -} - -DynamicTypeBuilder* DynamicTypeBuilderFactory::create_custom_builder( - const TypeDescriptor* descriptor, - const std::string& name /*= ""*/) -{ - if (descriptor != nullptr) - { - TypeKind kind = descriptor->get_kind(); - if (kind == eprosima::fastdds::dds::xtypes::TK_BOOLEAN || kind == eprosima::fastdds::dds::xtypes::TK_BYTE || - kind == eprosima::fastdds::dds::xtypes::TK_INT16 || - kind == eprosima::fastdds::dds::xtypes::TK_INT32 || - kind == eprosima::fastdds::dds::xtypes::TK_INT64 || kind == eprosima::fastdds::dds::xtypes::TK_UINT16 || - kind == eprosima::fastdds::dds::xtypes::TK_UINT32 || - kind == eprosima::fastdds::dds::xtypes::TK_UINT64 || - kind == eprosima::fastdds::dds::xtypes::TK_FLOAT32 || - kind == eprosima::fastdds::dds::xtypes::TK_FLOAT64 || - kind == eprosima::fastdds::dds::xtypes::TK_FLOAT128 || - kind == eprosima::fastdds::dds::xtypes::TK_CHAR8 || - kind == eprosima::fastdds::dds::xtypes::TK_CHAR16 || - kind == eprosima::fastdds::dds::xtypes::TK_STRING8 || - kind == eprosima::fastdds::dds::xtypes::TK_STRING16 || - kind == eprosima::fastdds::dds::xtypes::TK_ALIAS || - kind == eprosima::fastdds::dds::xtypes::TK_ENUM || kind == eprosima::fastdds::dds::xtypes::TK_BITMASK || - kind == eprosima::fastdds::dds::xtypes::TK_STRUCTURE || - kind == eprosima::fastdds::dds::xtypes::TK_UNION || - kind == eprosima::fastdds::dds::xtypes::TK_BITSET || - kind == eprosima::fastdds::dds::xtypes::TK_SEQUENCE || - kind == eprosima::fastdds::dds::xtypes::TK_ARRAY || - kind == eprosima::fastdds::dds::xtypes::TK_MAP || - kind == eprosima::fastdds::dds::xtypes::TK_ANNOTATION) - { - DynamicTypeBuilder* pNewType = new DynamicTypeBuilder(descriptor); - if (pNewType != nullptr && name.length() > 0) - { - pNewType->set_name(name); - } - add_builder_to_list(pNewType); - return pNewType; - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, - "Error creating type, unsupported type kind: " << static_cast(kind)); - } - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error creating type, invalid input descriptor."); - } - return nullptr; -} - -DynamicTypeBuilder* DynamicTypeBuilderFactory::create_builder_copy( - const DynamicTypeBuilder* type) -{ - if (type != nullptr) - { - DynamicTypeBuilder* pNewType = new DynamicTypeBuilder(type); - add_builder_to_list(pNewType); - return pNewType; - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error creating type, invalid input type."); - } - return nullptr; -} - -DynamicTypeBuilder* DynamicTypeBuilderFactory::create_uint16_builder() -{ - TypeDescriptor pUInt16Descriptor; - pUInt16Descriptor.kind_ = eprosima::fastdds::dds::xtypes::TK_UINT16; - pUInt16Descriptor.name_ = GenerateTypeName(get_type_name(eprosima::fastdds::dds::xtypes::TK_UINT16)); - - DynamicTypeBuilder* pNewTypeBuilder = new DynamicTypeBuilder(&pUInt16Descriptor); - add_builder_to_list(pNewTypeBuilder); - return pNewTypeBuilder; -} - -DynamicTypeBuilder* DynamicTypeBuilderFactory::create_uint32_builder() -{ - TypeDescriptor pUInt32Descriptor; - pUInt32Descriptor.kind_ = eprosima::fastdds::dds::xtypes::TK_UINT32; - pUInt32Descriptor.name_ = GenerateTypeName(get_type_name(eprosima::fastdds::dds::xtypes::TK_UINT32)); - - DynamicTypeBuilder* pNewTypeBuilder = new DynamicTypeBuilder(&pUInt32Descriptor); - add_builder_to_list(pNewTypeBuilder); - return pNewTypeBuilder; -} - -DynamicTypeBuilder* DynamicTypeBuilderFactory::create_uint64_builder() -{ - TypeDescriptor pUInt64Descriptor; - pUInt64Descriptor.kind_ = eprosima::fastdds::dds::xtypes::TK_UINT64; - pUInt64Descriptor.name_ = GenerateTypeName(get_type_name(eprosima::fastdds::dds::xtypes::TK_UINT64)); - - DynamicTypeBuilder* pNewTypeBuilder = new DynamicTypeBuilder(&pUInt64Descriptor); - add_builder_to_list(pNewTypeBuilder); - return pNewTypeBuilder; -} - -DynamicTypeBuilder* DynamicTypeBuilderFactory::create_union_builder( - DynamicTypeBuilder* discriminator_type) -{ - if (discriminator_type != nullptr && discriminator_type->is_discriminator_type()) - { - DynamicType_ptr pType = create_type(discriminator_type); - if (pType != nullptr) - { - return create_union_builder(pType); - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error building Union, Error creating discriminator type"); - return nullptr; - } - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error building Union, invalid discriminator type"); - return nullptr; - } -} - -DynamicTypeBuilder* DynamicTypeBuilderFactory::create_union_builder( - DynamicType_ptr discriminator_type) -{ - if (discriminator_type != nullptr && discriminator_type->is_discriminator_type()) - { - TypeDescriptor pUnionDescriptor; - pUnionDescriptor.kind_ = eprosima::fastdds::dds::xtypes::TK_UNION; - pUnionDescriptor.name_ = GenerateTypeName(get_type_name(eprosima::fastdds::dds::xtypes::TK_UNION)); - pUnionDescriptor.discriminator_type_ = discriminator_type; - - DynamicTypeBuilder* pNewTypeBuilder = new DynamicTypeBuilder(&pUnionDescriptor); - add_builder_to_list(pNewTypeBuilder); - return pNewTypeBuilder; - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error building Union, invalid discriminator type"); - return nullptr; - } -} - -DynamicTypeBuilder* DynamicTypeBuilderFactory::create_wstring_builder( - uint32_t bound) -{ - if (bound == BOUND_UNLIMITED) - { - bound = MAX_STRING_LENGTH; - } - - TypeDescriptor pCharDescriptor; - pCharDescriptor.kind_ = eprosima::fastdds::dds::xtypes::TK_CHAR16; - pCharDescriptor.name_ = GenerateTypeName(get_type_name(eprosima::fastdds::dds::xtypes::TK_CHAR16)); - - TypeDescriptor pDescriptor; - pDescriptor.kind_ = eprosima::fastdds::dds::xtypes::TK_STRING16; - //pDescriptor.name_ = GenerateTypeName(get_type_name(eprosima::fastdds::dds::xtypes::TK_STRING16)); - pDescriptor.element_type_ = create_type(&pCharDescriptor); - pDescriptor.bound_.push_back(bound); - - // pDescriptor.name_ = TypeNamesGenerator::get_string_type_name(bound, true, true); - - DynamicTypeBuilder* pNewTypeBuilder = new DynamicTypeBuilder(&pDescriptor); - add_builder_to_list(pNewTypeBuilder); - return pNewTypeBuilder; -} - -ReturnCode_t DynamicTypeBuilderFactory::delete_builder( - DynamicTypeBuilder* builder) -{ - if (builder != nullptr) - { -#ifndef DISABLE_DYNAMIC_MEMORY_CHECK - std::unique_lock scoped(mutex_); - auto it = std::find(builders_list_.begin(), builders_list_.end(), builder); - if (it != builders_list_.end()) - { - builders_list_.erase(it); - delete builder; - } - else - { - EPROSIMA_LOG_WARNING(DYN_TYPES, "The given type has been deleted previously."); - return eprosima::fastdds::dds::RETCODE_ALREADY_DELETED; - } -#else - delete builder; -#endif // ifndef DISABLE_DYNAMIC_MEMORY_CHECK - } - return eprosima::fastdds::dds::RETCODE_OK; -} - -ReturnCode_t DynamicTypeBuilderFactory::delete_type( - DynamicType* type) -{ - if (type != nullptr) - { - delete type; - } - return eprosima::fastdds::dds::RETCODE_OK; -} - -DynamicType_ptr DynamicTypeBuilderFactory::get_primitive_type( - TypeKind kind) -{ - TypeDescriptor pDescriptor; - pDescriptor.kind_ = kind; - pDescriptor.name_ = GenerateTypeName(get_type_name(kind)); - return create_type(&pDescriptor); -} - -bool DynamicTypeBuilderFactory::is_empty() const -{ -#ifndef DISABLE_DYNAMIC_MEMORY_CHECK - return builders_list_.empty(); -#else - return true; -#endif // ifndef DISABLE_DYNAMIC_MEMORY_CHECK -} - -// void DynamicTypeBuilderFactory::build_type_identifier( -// const DynamicType_ptr type, -// TypeIdentifier& identifier, -// bool complete) const -// { -// const TypeDescriptor* descriptor = type->get_type_descriptor(); -// build_type_identifier(descriptor, identifier, complete); -// } - -// void DynamicTypeBuilderFactory::build_type_identifier( -// const TypeDescriptor* descriptor, -// TypeIdentifier& identifier, -// bool complete) const -// { -// const TypeIdentifier* id2 = (complete) -// ? TypeObjectFactory::get_instance()->get_type_identifier_trying_complete(descriptor->get_name()) -// : TypeObjectFactory::get_instance()->get_type_identifier(descriptor->get_name()); -// if (id2 != nullptr) -// { -// identifier = *id2; -// } -// else -// { -// switch (descriptor->kind_) -// { -// // Basic types -// case TK_NONE: -// case eprosima::fastdds::dds::xtypes::TK_BOOLEAN: -// case eprosima::fastdds::dds::xtypes::TK_BYTE: -// case eprosima::fastdds::dds::xtypes::TK_INT16: -// case eprosima::fastdds::dds::xtypes::TK_INT32: -// case eprosima::fastdds::dds::xtypes::TK_INT64: -// case eprosima::fastdds::dds::xtypes::TK_UINT16: -// case eprosima::fastdds::dds::xtypes::TK_UINT32: -// case eprosima::fastdds::dds::xtypes::TK_UINT64: -// case eprosima::fastdds::dds::xtypes::TK_FLOAT32: -// case eprosima::fastdds::dds::xtypes::TK_FLOAT64: -// case eprosima::fastdds::dds::xtypes::TK_FLOAT128: -// case eprosima::fastdds::dds::xtypes::TK_CHAR8: -// case eprosima::fastdds::dds::xtypes::TK_CHAR16: -// { -// identifier._d(descriptor->kind_); -// } -// break; -// // String TKs -// case eprosima::fastdds::dds::xtypes::TK_STRING8: -// { -// if (descriptor->bound_[0] < 256) -// { -// identifier._d(TI_STRING8_SMALL); -// identifier.string_sdefn().bound(static_cast(descriptor->bound_[0])); -// } -// else -// { -// identifier._d(TI_STRING8_LARGE); -// identifier.string_ldefn().bound(descriptor->bound_[0]); -// } -// } -// break; -// case eprosima::fastdds::dds::xtypes::TK_STRING16: -// { -// if (descriptor->bound_[0] < 256) -// { -// identifier._d(TI_STRING16_SMALL); -// identifier.string_sdefn().bound(static_cast(descriptor->bound_[0])); -// } -// else -// { -// identifier._d(TI_STRING16_LARGE); -// identifier.string_ldefn().bound(descriptor->bound_[0]); -// } -// } -// break; -// // Collection TKs -// case eprosima::fastdds::dds::xtypes::TK_SEQUENCE: -// { -// if (descriptor->bound_[0] < 256) -// { -// identifier._d(TI_PLAIN_SEQUENCE_SMALL); -// identifier.seq_sdefn().bound(static_cast(descriptor->bound_[0])); -// TypeIdentifier elem_id; -// build_type_identifier(descriptor->get_element_type()->descriptor_, elem_id, complete); -// identifier.seq_sdefn().element_identifier(&elem_id); -// } -// else -// { -// identifier._d(TI_PLAIN_SEQUENCE_LARGE); -// identifier.seq_ldefn().bound(descriptor->bound_[0]); -// TypeIdentifier elem_id; -// build_type_identifier(descriptor->get_element_type()->descriptor_, elem_id, complete); -// identifier.seq_ldefn().element_identifier(&elem_id); -// } -// } -// break; -// case eprosima::fastdds::dds::xtypes::TK_ARRAY: -// { -// uint32_t size = 0; -// for (uint32_t s : descriptor->bound_) -// { -// size += s; -// } - -// if (size < 256) -// { -// identifier._d(TI_PLAIN_ARRAY_SMALL); -// for (uint32_t b : descriptor->bound_) -// { -// identifier.array_sdefn().array_bound_seq().emplace_back(static_cast(b)); -// } -// TypeIdentifier elem_id; -// build_type_identifier(descriptor->get_element_type()->descriptor_, elem_id, complete); -// identifier.array_sdefn().element_identifier(&elem_id); -// } -// else -// { -// identifier._d(TI_PLAIN_ARRAY_LARGE); -// identifier.array_ldefn().array_bound_seq(descriptor->bound_); -// TypeIdentifier elem_id; -// build_type_identifier(descriptor->get_element_type()->descriptor_, elem_id, complete); -// identifier.array_ldefn().element_identifier(&elem_id); -// } -// } -// break; -// case eprosima::fastdds::dds::xtypes::TK_MAP: -// { -// if (descriptor->bound_[0] < 256) -// { -// identifier._d(TI_PLAIN_MAP_SMALL); -// identifier.map_sdefn().bound(static_cast(descriptor->bound_[0])); -// TypeIdentifier elem_id; -// build_type_identifier(descriptor->get_element_type()->descriptor_, elem_id, complete); -// identifier.map_sdefn().element_identifier(&elem_id); -// TypeIdentifier key_id; -// build_type_identifier(descriptor->get_key_element_type()->descriptor_, key_id, complete); -// identifier.map_sdefn().key_identifier(&key_id); -// } -// else -// { -// identifier._d(TI_PLAIN_MAP_LARGE); -// identifier.map_ldefn().bound(static_cast(descriptor->bound_[0])); -// TypeIdentifier elem_id; -// build_type_identifier(descriptor->get_element_type()->descriptor_, elem_id, complete); -// identifier.map_ldefn().element_identifier(&elem_id); -// TypeIdentifier key_id; -// build_type_identifier(descriptor->get_key_element_type()->descriptor_, key_id, complete); -// identifier.map_ldefn().key_identifier(&key_id); -// } -// } -// break; -// // Constructed/Named types -// case eprosima::fastdds::dds::xtypes::TK_ALIAS: -// // Enumerated TKs -// case eprosima::fastdds::dds::xtypes::TK_ENUM: -// case eprosima::fastdds::dds::xtypes::TK_BITMASK: -// // Structured TKs -// case eprosima::fastdds::dds::xtypes::TK_ANNOTATION: -// case eprosima::fastdds::dds::xtypes::TK_STRUCTURE: -// case eprosima::fastdds::dds::xtypes::TK_UNION: -// case eprosima::fastdds::dds::xtypes::TK_BITSET: -// { -// // Need to be registered as TypeObject first -// // and return them as EK_MINIMAL or EK_COMPLETE -// EPROSIMA_LOG_INFO(DYN_TYPE_FACTORY, "Complex types must be built from CompleteTypeObjects."); -// } -// break; -// } - -// TypeObjectFactory::get_instance()->add_type_identifier(descriptor->get_name(), &identifier); -// } -// } - -// void DynamicTypeBuilderFactory::build_type_object( -// const DynamicType_ptr type, -// TypeObject& object, -// bool complete, -// bool force) const -// { -// const TypeDescriptor* descriptor = type->get_type_descriptor(); - -// std::map membersMap; -// type->get_all_members(membersMap); -// std::vector members; -// for (auto it : membersMap) -// { -// members.push_back(it.second->get_descriptor()); -// } - -// build_type_object(descriptor, object, &members, complete, force); -// } - -// void DynamicTypeBuilderFactory::build_type_object( -// const TypeDescriptor* descriptor, -// TypeObject& object, -// const std::vector* members, -// bool complete, -// bool force) const -// { -// const TypeObject* obj2 = (force) -// ? nullptr -// : TypeObjectFactory::get_instance()->get_type_object(descriptor->get_name(), complete); - -// if (obj2 != nullptr) -// { -// object = *obj2; -// } -// else -// { -// switch (descriptor->kind_) -// { -// // Basic types -// case TK_NONE: -// case eprosima::fastdds::dds::xtypes::TK_BOOLEAN: -// case eprosima::fastdds::dds::xtypes::TK_BYTE: -// case eprosima::fastdds::dds::xtypes::TK_INT16: -// case eprosima::fastdds::dds::xtypes::TK_INT32: -// case eprosima::fastdds::dds::xtypes::TK_INT64: -// case eprosima::fastdds::dds::xtypes::TK_UINT16: -// case eprosima::fastdds::dds::xtypes::TK_UINT32: -// case eprosima::fastdds::dds::xtypes::TK_UINT64: -// case eprosima::fastdds::dds::xtypes::TK_FLOAT32: -// case eprosima::fastdds::dds::xtypes::TK_FLOAT64: -// case eprosima::fastdds::dds::xtypes::TK_FLOAT128: -// case eprosima::fastdds::dds::xtypes::TK_CHAR8: -// case eprosima::fastdds::dds::xtypes::TK_CHAR16: -// { -// break; -// } -// // String TKs -// case eprosima::fastdds::dds::xtypes::TK_STRING8: -// { -// build_string8_type_code(descriptor); -// break; -// } -// case eprosima::fastdds::dds::xtypes::TK_STRING16: -// { -// build_string16_type_code(descriptor); -// break; -// } -// // Collection TKs -// case eprosima::fastdds::dds::xtypes::TK_SEQUENCE: -// { -// build_sequence_type_code(descriptor, object, complete); -// break; -// } -// case eprosima::fastdds::dds::xtypes::TK_ARRAY: -// { -// build_array_type_code(descriptor, object, complete); -// break; -// } -// case eprosima::fastdds::dds::xtypes::TK_MAP: -// { -// build_map_type_code(descriptor, object, complete); -// break; -// } - -// // Constructed/Named types -// case eprosima::fastdds::dds::xtypes::TK_ALIAS: -// { -// build_alias_type_code(descriptor, object, complete); -// } -// break; -// // Enumerated TKs -// case eprosima::fastdds::dds::xtypes::TK_ENUM: -// { -// build_enum_type_code(descriptor, object, *members, complete); -// } -// break; -// case eprosima::fastdds::dds::xtypes::TK_BITMASK: -// { -// build_bitmask_type_code(descriptor, object, *members, complete); -// } -// break; -// // Structured TKs -// case eprosima::fastdds::dds::xtypes::TK_ANNOTATION: -// { -// build_annotation_type_code(descriptor, object, *members, complete); -// } -// break; -// case eprosima::fastdds::dds::xtypes::TK_STRUCTURE: -// { -// build_struct_type_code(descriptor, object, *members, complete); -// } -// break; -// case eprosima::fastdds::dds::xtypes::TK_UNION: -// { -// build_union_type_code(descriptor, object, *members, complete); -// } -// break; -// case eprosima::fastdds::dds::xtypes::TK_BITSET: -// { -// build_bitset_type_code(descriptor, object, *members, complete); -// } -// break; -// } -// } -// } - -// void DynamicTypeBuilderFactory::build_string8_type_code( -// const TypeDescriptor* descriptor) const -// { -// const TypeIdentifier* identifier = -// TypeObjectFactory::get_instance()->get_string_identifier( -// descriptor->get_bounds(), -// false); - -// TypeObjectFactory::get_instance()->add_type_identifier(descriptor->get_name(), identifier); -// } - -// void DynamicTypeBuilderFactory::build_string16_type_code( -// const TypeDescriptor* descriptor) const -// { -// const TypeIdentifier* identifier = -// TypeObjectFactory::get_instance()->get_string_identifier( -// descriptor->get_bounds(), -// true); - -// TypeObjectFactory::get_instance()->add_type_identifier(descriptor->get_name(), identifier); -// } - -// void DynamicTypeBuilderFactory::build_sequence_type_code( -// const TypeDescriptor* descriptor, -// TypeObject& object, -// bool complete) const -// { -// if (complete) -// { -// object._d(EK_COMPLETE); -// object.complete()._d(eprosima::fastdds::dds::xtypes::TK_SEQUENCE); -// object.complete().sequence_type().collection_flag().IS_FINAL(false); -// object.complete().sequence_type().collection_flag().IS_APPENDABLE(false); -// object.complete().sequence_type().collection_flag().IS_MUTABLE(false); -// object.complete().sequence_type().collection_flag().IS_NESTED(false); -// object.complete().sequence_type().collection_flag().IS_AUTOID_HASH(false); - -// // Apply annotations -// apply_type_annotations(object.complete().sequence_type().header().detail().ann_custom(), descriptor); - -// object.complete().sequence_type().header().detail().type_name(descriptor->get_name()); -// object.complete().sequence_type().header().common().bound(descriptor->get_bounds()); -// object.complete().sequence_type().element().common().element_flags().TRY_CONSTRUCT1(false); -// object.complete().sequence_type().element().common().element_flags().TRY_CONSTRUCT2(false); -// object.complete().sequence_type().element().common().element_flags().IS_EXTERNAL(false); -// object.complete().sequence_type().element().common().element_flags().IS_OPTIONAL(false); -// object.complete().sequence_type().element().common().element_flags().IS_MUST_UNDERSTAND(false); -// object.complete().sequence_type().element().common().element_flags().IS_KEY(false); -// object.complete().sequence_type().element().common().element_flags().IS_DEFAULT(false); - -// //TypeIdentifier ident; -// //build_type_identifier(descriptor->get_base_type()->descriptor_, ident); -// TypeObject obj; -// build_type_object(descriptor->get_element_type(), obj, complete); -// TypeIdentifier ident = *TypeObjectFactory::get_instance()->get_type_identifier( -// descriptor->get_element_type()->get_name()); - -// object.complete().sequence_type().element().common().type(ident); - -// const TypeIdentifier* identifier = -// TypeObjectFactory::get_instance()->get_sequence_identifier( -// descriptor->get_element_type()->get_name(), -// descriptor->get_bounds(), -// true); - -// TypeObjectFactory::get_instance()->add_type_object(descriptor->get_name(), identifier, &object); -// } -// else -// { -// object._d(EK_MINIMAL); -// object.minimal()._d(eprosima::fastdds::dds::xtypes::TK_SEQUENCE); -// object.minimal().sequence_type().collection_flag().IS_FINAL(false); -// object.minimal().sequence_type().collection_flag().IS_APPENDABLE(false); -// object.minimal().sequence_type().collection_flag().IS_MUTABLE(false); -// object.minimal().sequence_type().collection_flag().IS_NESTED(false); -// object.minimal().sequence_type().collection_flag().IS_AUTOID_HASH(false); - -// // Apply annotations -// object.minimal().sequence_type().header().common().bound(descriptor->get_bounds()); -// object.minimal().sequence_type().element().common().element_flags().TRY_CONSTRUCT1(false); -// object.minimal().sequence_type().element().common().element_flags().TRY_CONSTRUCT2(false); -// object.minimal().sequence_type().element().common().element_flags().IS_EXTERNAL(false); -// object.minimal().sequence_type().element().common().element_flags().IS_OPTIONAL(false); -// object.minimal().sequence_type().element().common().element_flags().IS_MUST_UNDERSTAND(false); -// object.minimal().sequence_type().element().common().element_flags().IS_KEY(false); -// object.minimal().sequence_type().element().common().element_flags().IS_DEFAULT(false); - -// //TypeIdentifier ident; -// //build_type_identifier(descriptor->get_base_type()->descriptor_, ident); -// TypeObject obj; -// build_type_object(descriptor->get_element_type(), obj); -// TypeIdentifier ident = *TypeObjectFactory::get_instance()->get_type_identifier( -// descriptor->get_element_type()->get_name()); - -// object.minimal().sequence_type().element().common().type(ident); - -// const TypeIdentifier* identifier = -// TypeObjectFactory::get_instance()->get_sequence_identifier( -// descriptor->get_element_type()->get_name(), -// descriptor->get_bounds(), -// false); - -// TypeObjectFactory::get_instance()->add_type_object(descriptor->get_name(), identifier, &object); -// } -// } - -// void DynamicTypeBuilderFactory::build_array_type_code( -// const TypeDescriptor* descriptor, -// TypeObject& object, -// bool complete) const -// { -// if (complete) -// { -// object._d(EK_COMPLETE); -// object.complete()._d(eprosima::fastdds::dds::xtypes::TK_ARRAY); -// object.complete().array_type().collection_flag().IS_FINAL(false); -// object.complete().array_type().collection_flag().IS_APPENDABLE(false); -// object.complete().array_type().collection_flag().IS_MUTABLE(false); -// object.complete().array_type().collection_flag().IS_NESTED(false); -// object.complete().array_type().collection_flag().IS_AUTOID_HASH(false); - -// // Apply annotations -// apply_type_annotations(object.complete().array_type().header().detail().ann_custom(), descriptor); - -// object.complete().array_type().header().detail().type_name(descriptor->get_name()); -// for (uint32_t i = 0; i < descriptor->get_bounds_size(); ++i) -// { -// object.complete().array_type().header().common().bound_seq().push_back(descriptor->get_bounds(i)); -// } -// object.complete().array_type().element().common().element_flags().TRY_CONSTRUCT1(false); -// object.complete().array_type().element().common().element_flags().TRY_CONSTRUCT2(false); -// object.complete().array_type().element().common().element_flags().IS_EXTERNAL(false); -// object.complete().array_type().element().common().element_flags().IS_OPTIONAL(false); -// object.complete().array_type().element().common().element_flags().IS_MUST_UNDERSTAND(false); -// object.complete().array_type().element().common().element_flags().IS_KEY(false); -// object.complete().array_type().element().common().element_flags().IS_DEFAULT(false); - -// //TypeIdentifier ident; -// //build_type_identifier(descriptor->get_base_type()->descriptor_, ident); -// TypeObject obj; -// build_type_object(descriptor->get_element_type(), obj, complete); -// TypeIdentifier ident = *TypeObjectFactory::get_instance()->get_type_identifier( -// descriptor->get_element_type()->get_name()); - -// object.complete().array_type().element().common().type(ident); - -// const TypeIdentifier* identifier = -// TypeObjectFactory::get_instance()->get_array_identifier( -// descriptor->get_element_type()->get_name(), -// object.complete().array_type().header().common().bound_seq(), -// true); - -// TypeObjectFactory::get_instance()->add_type_object(descriptor->get_name(), identifier, &object); -// } -// else -// { -// object._d(EK_MINIMAL); -// object.minimal()._d(eprosima::fastdds::dds::xtypes::TK_ARRAY); -// object.minimal().array_type().collection_flag().IS_FINAL(false); -// object.minimal().array_type().collection_flag().IS_APPENDABLE(false); -// object.minimal().array_type().collection_flag().IS_MUTABLE(false); -// object.minimal().array_type().collection_flag().IS_NESTED(false); -// object.minimal().array_type().collection_flag().IS_AUTOID_HASH(false); - -// // Apply annotations -// for (uint32_t i = 0; i < descriptor->get_bounds_size(); ++i) -// { -// object.minimal().array_type().header().common().bound_seq().push_back(descriptor->get_bounds(i)); -// } -// object.minimal().array_type().element().common().element_flags().TRY_CONSTRUCT1(false); -// object.minimal().array_type().element().common().element_flags().TRY_CONSTRUCT2(false); -// object.minimal().array_type().element().common().element_flags().IS_EXTERNAL(false); -// object.minimal().array_type().element().common().element_flags().IS_OPTIONAL(false); -// object.minimal().array_type().element().common().element_flags().IS_MUST_UNDERSTAND(false); -// object.minimal().array_type().element().common().element_flags().IS_KEY(false); -// object.minimal().array_type().element().common().element_flags().IS_DEFAULT(false); - -// //TypeIdentifier ident; -// //build_type_identifier(descriptor->get_base_type()->descriptor_, ident); -// TypeObject obj; -// build_type_object(descriptor->get_element_type(), obj); -// TypeIdentifier ident = *TypeObjectFactory::get_instance()->get_type_identifier( -// descriptor->get_element_type()->get_name()); - -// object.minimal().array_type().element().common().type(ident); - -// const TypeIdentifier* identifier = -// TypeObjectFactory::get_instance()->get_array_identifier( -// descriptor->get_element_type()->get_name(), -// object.minimal().array_type().header().common().bound_seq(), -// false); - -// TypeObjectFactory::get_instance()->add_type_object(descriptor->get_name(), identifier, &object); -// } -// } - -// void DynamicTypeBuilderFactory::build_map_type_code( -// const TypeDescriptor* descriptor, -// TypeObject& object, -// bool complete) const -// { -// if (complete) -// { -// object._d(EK_COMPLETE); -// object.complete()._d(eprosima::fastdds::dds::xtypes::TK_MAP); -// object.complete().map_type().collection_flag().IS_FINAL(false); -// object.complete().map_type().collection_flag().IS_APPENDABLE(false); -// object.complete().map_type().collection_flag().IS_MUTABLE(false); -// object.complete().map_type().collection_flag().IS_NESTED(false); -// object.complete().map_type().collection_flag().IS_AUTOID_HASH(false); - -// // Apply annotations -// apply_type_annotations(object.complete().map_type().header().detail().ann_custom(), descriptor); - -// object.complete().map_type().header().detail().type_name(descriptor->get_name()); -// object.complete().map_type().header().common().bound(descriptor->get_bounds()); -// object.complete().map_type().element().common().element_flags().TRY_CONSTRUCT1(false); -// object.complete().map_type().element().common().element_flags().TRY_CONSTRUCT2(false); -// object.complete().map_type().element().common().element_flags().IS_EXTERNAL(false); -// object.complete().map_type().element().common().element_flags().IS_OPTIONAL(false); -// object.complete().map_type().element().common().element_flags().IS_MUST_UNDERSTAND(false); -// object.complete().map_type().element().common().element_flags().IS_KEY(false); -// object.complete().map_type().element().common().element_flags().IS_DEFAULT(false); -// object.complete().map_type().key().common().element_flags().TRY_CONSTRUCT1(false); -// object.complete().map_type().key().common().element_flags().TRY_CONSTRUCT2(false); -// object.complete().map_type().key().common().element_flags().IS_EXTERNAL(false); -// object.complete().map_type().key().common().element_flags().IS_OPTIONAL(false); -// object.complete().map_type().key().common().element_flags().IS_MUST_UNDERSTAND(false); -// object.complete().map_type().key().common().element_flags().IS_KEY(false); -// object.complete().map_type().key().common().element_flags().IS_DEFAULT(false); - -// //TypeIdentifier ident; -// //build_type_identifier(descriptor->get_base_type()->descriptor_, ident); -// TypeObject obj; -// build_type_object(descriptor->get_element_type(), obj, complete); -// TypeIdentifier ident = *TypeObjectFactory::get_instance()->get_type_identifier( -// descriptor->get_element_type()->get_name()); - -// build_type_object(descriptor->get_key_element_type(), obj, complete); -// TypeIdentifier ident_key = *TypeObjectFactory::get_instance()->get_type_identifier( -// descriptor->get_key_element_type()->get_name()); - -// object.complete().map_type().element().common().type(ident); -// object.complete().map_type().key().common().type(ident_key); - -// const TypeIdentifier* identifier = -// TypeObjectFactory::get_instance()->get_map_identifier( -// descriptor->get_key_element_type()->get_name(), -// descriptor->get_element_type()->get_name(), -// descriptor->get_bounds(), -// true); - -// TypeObjectFactory::get_instance()->add_type_object(descriptor->get_name(), identifier, &object); -// } -// else -// { -// object._d(EK_MINIMAL); -// object.minimal()._d(eprosima::fastdds::dds::xtypes::TK_MAP); -// object.minimal().map_type().collection_flag().IS_FINAL(false); -// object.minimal().map_type().collection_flag().IS_APPENDABLE(false); -// object.minimal().map_type().collection_flag().IS_MUTABLE(false); -// object.minimal().map_type().collection_flag().IS_NESTED(false); -// object.minimal().map_type().collection_flag().IS_AUTOID_HASH(false); - -// // Apply annotations -// object.minimal().map_type().header().common().bound(descriptor->get_bounds()); -// object.minimal().map_type().element().common().element_flags().TRY_CONSTRUCT1(false); -// object.minimal().map_type().element().common().element_flags().TRY_CONSTRUCT2(false); -// object.minimal().map_type().element().common().element_flags().IS_EXTERNAL(false); -// object.minimal().map_type().element().common().element_flags().IS_OPTIONAL(false); -// object.minimal().map_type().element().common().element_flags().IS_MUST_UNDERSTAND(false); -// object.minimal().map_type().element().common().element_flags().IS_KEY(false); -// object.minimal().map_type().element().common().element_flags().IS_DEFAULT(false); - -// //TypeIdentifier ident; -// //build_type_identifier(descriptor->get_base_type()->descriptor_, ident); -// TypeObject obj; -// build_type_object(descriptor->get_element_type(), obj); -// TypeIdentifier ident = *TypeObjectFactory::get_instance()->get_type_identifier( -// descriptor->get_element_type()->get_name()); - -// build_type_object(descriptor->get_key_element_type(), obj, complete); -// TypeIdentifier ident_key = *TypeObjectFactory::get_instance()->get_type_identifier( -// descriptor->get_key_element_type()->get_name()); - -// object.minimal().map_type().element().common().type(ident); -// object.minimal().map_type().key().common().type(ident_key); - -// const TypeIdentifier* identifier = -// TypeObjectFactory::get_instance()->get_map_identifier( -// descriptor->get_key_element_type()->get_name(), -// descriptor->get_element_type()->get_name(), -// descriptor->get_bounds(), -// false); - -// TypeObjectFactory::get_instance()->add_type_object(descriptor->get_name(), identifier, &object); -// } -// } - -// void DynamicTypeBuilderFactory::build_alias_type_code( -// const TypeDescriptor* descriptor, -// TypeObject& object, -// bool complete) const -// { -// if (complete) -// { -// object._d(EK_COMPLETE); -// object.complete()._d(eprosima::fastdds::dds::xtypes::TK_ALIAS); -// object.complete().alias_type().alias_flags().IS_FINAL(false); -// object.complete().alias_type().alias_flags().IS_APPENDABLE(false); -// object.complete().alias_type().alias_flags().IS_MUTABLE(false); -// object.complete().alias_type().alias_flags().IS_NESTED(false); -// object.complete().alias_type().alias_flags().IS_AUTOID_HASH(false); - -// // Apply annotations -// apply_type_annotations(object.complete().alias_type().header().detail().ann_custom(), descriptor); - -// object.complete().alias_type().header().detail().type_name(descriptor->get_name()); -// object.complete().alias_type().body().common().related_flags().TRY_CONSTRUCT1(false); -// object.complete().alias_type().body().common().related_flags().TRY_CONSTRUCT2(false); -// object.complete().alias_type().body().common().related_flags().IS_EXTERNAL(false); -// object.complete().alias_type().body().common().related_flags().IS_OPTIONAL(false); -// object.complete().alias_type().body().common().related_flags().IS_MUST_UNDERSTAND(false); -// object.complete().alias_type().body().common().related_flags().IS_KEY(false); -// object.complete().alias_type().body().common().related_flags().IS_DEFAULT(false); - -// //TypeIdentifier ident; -// //build_type_identifier(descriptor->get_base_type()->descriptor_, ident); -// TypeObject obj; -// build_type_object(descriptor->get_base_type(), obj, complete); -// TypeIdentifier ident = *TypeObjectFactory::get_instance()->get_type_identifier( -// descriptor->get_base_type()->get_name()); - -// object.complete().alias_type().body().common().related_type(ident); - -// TypeIdentifier identifier; -// identifier._d(EK_COMPLETE); - -// eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); -// size_t current_alignment {0}; -// eprosima::fastrtps::rtps::SerializedPayload_t payload(static_cast( -// calculator.calculate_serialized_size(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 << 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]; -// } - -// // Add our alias -// TypeObjectFactory::get_instance()->add_alias(descriptor->get_name(), descriptor->get_base_type()->get_name()); - -// TypeObjectFactory::get_instance()->add_type_object(descriptor->get_name(), &identifier, &object); -// } -// else -// { -// object._d(EK_MINIMAL); -// object.minimal()._d(eprosima::fastdds::dds::xtypes::TK_ALIAS); -// object.minimal().alias_type().alias_flags().IS_FINAL(false); -// object.minimal().alias_type().alias_flags().IS_APPENDABLE(false); -// object.minimal().alias_type().alias_flags().IS_MUTABLE(false); -// object.minimal().alias_type().alias_flags().IS_NESTED(false); -// object.minimal().alias_type().alias_flags().IS_AUTOID_HASH(false); - -// object.minimal().alias_type().body().common().related_flags().TRY_CONSTRUCT1(false); -// object.minimal().alias_type().body().common().related_flags().TRY_CONSTRUCT2(false); -// object.minimal().alias_type().body().common().related_flags().IS_EXTERNAL(false); -// object.minimal().alias_type().body().common().related_flags().IS_OPTIONAL(false); -// object.minimal().alias_type().body().common().related_flags().IS_MUST_UNDERSTAND(false); -// object.minimal().alias_type().body().common().related_flags().IS_KEY(false); -// object.minimal().alias_type().body().common().related_flags().IS_DEFAULT(false); - -// //TypeIdentifier ident; -// //build_type_identifier(descriptor->get_base_type()->descriptor_, ident); -// TypeObject obj; -// build_type_object(descriptor->get_base_type()->descriptor_, obj); -// TypeIdentifier ident = *TypeObjectFactory::get_instance()->get_type_identifier( -// descriptor->get_base_type()->get_name()); - -// object.minimal().alias_type().body().common().related_type(ident); - -// TypeIdentifier identifier; -// identifier._d(EK_MINIMAL); - -// eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); -// size_t current_alignment {0}; -// eprosima::fastrtps::rtps::SerializedPayload_t payload(static_cast( -// calculator.calculate_serialized_size(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 << 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]; -// } - -// // Add our alias -// TypeObjectFactory::get_instance()->add_alias(descriptor->get_name(), descriptor->get_base_type()->get_name()); - -// TypeObjectFactory::get_instance()->add_type_object(descriptor->get_name(), &identifier, &object); -// } -// } - -// void DynamicTypeBuilderFactory::build_enum_type_code( -// const TypeDescriptor* descriptor, -// TypeObject& object, -// const std::vector members, -// bool complete) const -// { -// if (complete) -// { -// object._d(EK_COMPLETE); -// object.complete()._d(eprosima::fastdds::dds::xtypes::TK_ENUM); -// object.complete().enumerated_type().header().common().bit_bound(descriptor->annotation_get_bit_bound()); -// object.complete().enumerated_type().header().detail().type_name(descriptor->get_name()); - -// // Apply annotations -// apply_type_annotations(object.complete().enumerated_type().header().detail().ann_custom(), descriptor); - -// for (const MemberDescriptor* member : members) -// { -// CompleteEnumeratedLiteral mel; -// mel.common().flags().IS_DEFAULT(member->annotation_is_default_literal()); -// mel.common().value(member->get_index()); -// mel.detail().name(member->get_name()); - -// // Apply member annotations -// TypeDescriptor member_type_descriptor; -// member->type_->get_descriptor(&member_type_descriptor); -// apply_type_annotations(mel.detail().ann_custom(), &member_type_descriptor); - -// object.complete().enumerated_type().literal_seq().emplace_back(mel); -// } - -// TypeIdentifier identifier; -// identifier._d(EK_COMPLETE); - -// eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); -// size_t current_alignment {0}; -// eprosima::fastrtps::rtps::SerializedPayload_t payload(static_cast( -// calculator.calculate_serialized_size(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 << 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(descriptor->get_name(), &identifier, &object); -// } -// else -// { -// object._d(EK_MINIMAL); -// object.minimal()._d(eprosima::fastdds::dds::xtypes::TK_ENUM); -// object.minimal().enumerated_type().header().common().bit_bound(32); // TODO fixed by IDL, isn't? - -// for (const MemberDescriptor* member : members) -// { -// MinimalEnumeratedLiteral mel; -// mel.common().flags().IS_DEFAULT(member->annotation_is_default_literal()); -// mel.common().value(member->get_index()); -// MD5 hash(member->get_name()); -// for (int i = 0; i < 4; ++i) -// { -// mel.detail().name_hash()[i] = hash.digest[i]; -// } -// object.minimal().enumerated_type().literal_seq().emplace_back(mel); -// } - -// TypeIdentifier identifier; -// identifier._d(EK_MINIMAL); - -// eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); -// size_t current_alignment {0}; -// eprosima::fastrtps::rtps::SerializedPayload_t payload(static_cast( -// calculator.calculate_serialized_size(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 << 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(descriptor->get_name(), &identifier, &object); -// } -// } - -// void DynamicTypeBuilderFactory::build_struct_type_code( -// const TypeDescriptor* descriptor, -// TypeObject& object, -// const std::vector members, -// bool complete) const -// { -// if (complete) -// { -// object._d(EK_COMPLETE); -// object.complete()._d(eprosima::fastdds::dds::xtypes::TK_STRUCTURE); - -// object.complete().struct_type().struct_flags().IS_FINAL(descriptor->annotation_is_final()); -// object.complete().struct_type().struct_flags().IS_APPENDABLE(descriptor->annotation_is_appendable()); -// object.complete().struct_type().struct_flags().IS_MUTABLE(descriptor->annotation_is_mutable()); -// object.complete().struct_type().struct_flags().IS_NESTED(descriptor->annotation_get_nested()); -// object.complete().struct_type().struct_flags().IS_AUTOID_HASH(false); - -// // Apply annotations -// apply_type_annotations(object.complete().struct_type().header().detail().ann_custom(), descriptor); - -// for (const MemberDescriptor* member : members) -// { -// CompleteStructMember msm; -// msm.common().member_id(member->get_index()); -// msm.common().member_flags().TRY_CONSTRUCT1(false); -// msm.common().member_flags().TRY_CONSTRUCT2(false); -// msm.common().member_flags().IS_EXTERNAL(false); -// msm.common().member_flags().IS_OPTIONAL(member->annotation_is_optional()); -// msm.common().member_flags().IS_MUST_UNDERSTAND(member->annotation_is_must_understand()); -// msm.common().member_flags().IS_KEY(member->annotation_is_key()); -// msm.common().member_flags().IS_DEFAULT(false); - -// // Apply member annotations -// TypeDescriptor member_type_descriptor; -// member->type_->get_descriptor(&member_type_descriptor); -// apply_type_annotations(msm.detail().ann_custom(), &member_type_descriptor); - -// std::map membersMap; -// member->type_->get_all_members(membersMap); -// std::vector innerMembers; -// for (auto it : membersMap) -// { -// innerMembers.push_back(it.second->get_descriptor()); -// } - -// TypeObject memObj; -// build_type_object(member->type_->descriptor_, memObj, &innerMembers); -// const TypeIdentifier* typeId = -// TypeObjectFactory::get_instance()->get_type_identifier_trying_complete(member->type_->get_name()); -// if (typeId == nullptr) -// { -// EPROSIMA_LOG_ERROR(DYN_TYPES, "Member " << member->get_name() << " of struct " -// << descriptor->get_name() << " failed."); -// } -// else -// { -// TypeIdentifier memIdent = *typeId; -// msm.common().member_type_id(memIdent); -// } - -// msm.detail().name(member->get_name()); -// object.complete().struct_type().member_seq().emplace_back(msm); -// } - -// object.complete().struct_type().header().detail().type_name(descriptor->get_name()); -// //object.complete().struct_type().header().detail().ann_builtin()... -// //object.complete().struct_type().header().detail().ann_custom()... - -// if (descriptor->get_base_type().get() != nullptr) -// { -// TypeIdentifier parent; -// build_type_identifier(descriptor->get_base_type(), parent); -// object.complete().struct_type().header().base_type(parent); -// } -// //object.complete().struct_type().header().base_type().equivalence_hash()[0..13]; - -// TypeIdentifier identifier; -// identifier._d(EK_COMPLETE); - -// eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); -// size_t current_alignment {0}; -// eprosima::fastrtps::rtps::SerializedPayload_t payload(static_cast( -// calculator.calculate_serialized_size(object.complete().struct_type(), current_alignment) + 4)); -// // Object that manages the raw buffer. -// eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - -// 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; -// // Serialize encapsulation - -// for (CompleteStructMember& st : object.complete().struct_type().member_seq()) -// { -// ser << st; -// } -// #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(descriptor->get_name(), &identifier, &object); -// } -// else -// { -// object._d(EK_MINIMAL); -// object.minimal()._d(eprosima::fastdds::dds::xtypes::TK_STRUCTURE); - -// object.minimal().struct_type().struct_flags().IS_FINAL(descriptor->annotation_is_final()); -// object.minimal().struct_type().struct_flags().IS_APPENDABLE(descriptor->annotation_is_appendable()); -// object.minimal().struct_type().struct_flags().IS_MUTABLE(descriptor->annotation_is_mutable()); -// object.minimal().struct_type().struct_flags().IS_NESTED(descriptor->annotation_get_nested()); -// object.minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); - -// for (const MemberDescriptor* member : members) -// { -// MinimalStructMember msm; -// msm.common().member_id(member->get_index()); -// msm.common().member_flags().TRY_CONSTRUCT1(false); -// msm.common().member_flags().TRY_CONSTRUCT2(false); -// msm.common().member_flags().IS_EXTERNAL(false); -// msm.common().member_flags().IS_OPTIONAL(member->annotation_is_optional()); -// msm.common().member_flags().IS_MUST_UNDERSTAND(member->annotation_is_must_understand()); -// msm.common().member_flags().IS_KEY(member->annotation_is_key()); -// msm.common().member_flags().IS_DEFAULT(false); -// //TypeIdentifier memIdent; -// //build_type_identifier(member->type_->descriptor_, memIdent); - -// std::map membersMap; -// member->type_->get_all_members(membersMap); -// std::vector innerMembers; -// for (auto it : membersMap) -// { -// innerMembers.push_back(it.second->get_descriptor()); -// } - -// TypeObject memObj; -// build_type_object(member->type_->descriptor_, memObj, &innerMembers, false); -// const TypeIdentifier* typeId = -// TypeObjectFactory::get_instance()->get_type_identifier(member->type_->get_name()); -// if (typeId == nullptr) -// { -// EPROSIMA_LOG_ERROR(DYN_TYPES, "Member " << member->get_name() -// << " of struct " << descriptor->get_name() << " failed."); -// } -// else -// { -// TypeIdentifier memIdent = *typeId; -// msm.common().member_type_id(memIdent); -// } - -// MD5 hash(member->get_name()); -// for (int i = 0; i < 4; ++i) -// { -// msm.detail().name_hash()[i] = hash.digest[i]; -// } -// object.minimal().struct_type().member_seq().emplace_back(msm); -// } - -// if (descriptor->get_base_type().get() != nullptr) -// { -// TypeIdentifier parent; -// build_type_identifier(descriptor->get_base_type(), parent, false); -// object.minimal().struct_type().header().base_type(parent); -// } - -// TypeIdentifier identifier; -// identifier._d(EK_MINIMAL); - -// eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); -// size_t current_alignment {0}; -// eprosima::fastrtps::rtps::SerializedPayload_t payload(static_cast( -// calculator.calculate_serialized_size(object.minimal().struct_type(), current_alignment) + 4)); -// // Object that manages the raw buffer. -// eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - -// 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; -// // Serialize encapsulation - -// for (MinimalStructMember& st : object.minimal().struct_type().member_seq()) -// { -// ser << st; -// } -// #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(descriptor->get_name(), &identifier, &object); -// } -// } - -// void DynamicTypeBuilderFactory::build_union_type_code( -// const TypeDescriptor* descriptor, -// TypeObject& object, -// const std::vector members, -// bool complete) const -// { -// if (complete) -// { -// object._d(EK_COMPLETE); -// object.complete()._d(eprosima::fastdds::dds::xtypes::TK_UNION); - -// object.complete().union_type().union_flags().IS_FINAL(descriptor->annotation_is_final()); -// object.complete().union_type().union_flags().IS_APPENDABLE(descriptor->annotation_is_appendable()); -// object.complete().union_type().union_flags().IS_MUTABLE(descriptor->annotation_is_mutable()); -// object.complete().union_type().union_flags().IS_NESTED(descriptor->annotation_get_nested()); -// object.complete().union_type().union_flags().IS_AUTOID_HASH(false); - -// object.complete().union_type().discriminator().common().member_flags().TRY_CONSTRUCT1(false); -// object.complete().union_type().discriminator().common().member_flags().TRY_CONSTRUCT2(false); -// object.complete().union_type().discriminator().common().member_flags().IS_EXTERNAL(false); -// object.complete().union_type().discriminator().common().member_flags().IS_OPTIONAL(false); -// object.complete().union_type().discriminator().common().member_flags().IS_MUST_UNDERSTAND(false); -// object.complete().union_type().discriminator().common().member_flags().IS_KEY( -// descriptor->discriminator_type_->descriptor_->annotation_get_key()); -// object.complete().union_type().discriminator().common().member_flags().IS_DEFAULT(false); - -// // Apply annotations -// apply_type_annotations(object.complete().struct_type().header().detail().ann_custom(), descriptor); - -// TypeObject discObj; -// build_type_object(descriptor->discriminator_type_->descriptor_, discObj); -// TypeIdentifier discIdent = -// *TypeObjectFactory::get_instance()->get_type_identifier(descriptor->discriminator_type_->get_name()); -// object.complete().union_type().discriminator().common().type_id(discIdent); - -// for (const MemberDescriptor* member : members) -// { -// CompleteUnionMember mum; -// mum.common().member_id(member->get_index()); -// mum.common().member_flags().TRY_CONSTRUCT1(false); -// mum.common().member_flags().TRY_CONSTRUCT2(false); -// mum.common().member_flags().IS_EXTERNAL(false); -// mum.common().member_flags().IS_OPTIONAL(false); -// mum.common().member_flags().IS_MUST_UNDERSTAND(false); -// mum.common().member_flags().IS_KEY(false); -// mum.common().member_flags().IS_DEFAULT(member->is_default_union_value()); - -// // Apply member annotations -// TypeDescriptor member_type_descriptor; -// member->type_->get_descriptor(&member_type_descriptor); -// apply_type_annotations(mum.detail().ann_custom(), &member_type_descriptor); - -// std::map membersMap; -// member->type_->get_all_members(membersMap); -// std::vector innerMembers; -// for (auto it : membersMap) -// { -// innerMembers.push_back(it.second->get_descriptor()); -// } - -// TypeObject memObj; -// build_type_object(member->type_->descriptor_, memObj, &innerMembers); -// const TypeIdentifier* typeId = -// TypeObjectFactory::get_instance()->get_type_identifier_trying_complete(member->type_->get_name()); -// if (typeId == nullptr) -// { -// EPROSIMA_LOG_ERROR(DYN_TYPES, "Member " << member->get_name() -// << " of union " << descriptor->get_name() << " failed."); -// } -// else -// { -// TypeIdentifier memIdent = *typeId; -// mum.common().type_id(memIdent); -// } - -// for (uint64_t lab : member->get_union_labels()) -// { -// mum.common().label_seq().emplace_back(static_cast(lab)); -// } -// mum.detail().name(member->get_name()); -// object.complete().union_type().member_seq().emplace_back(mum); -// } - -// object.complete().union_type().header().detail().type_name(descriptor->get_name()); - -// TypeIdentifier identifier; -// identifier._d(EK_MINIMAL); - -// eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); -// size_t current_alignment {0}; -// eprosima::fastrtps::rtps::SerializedPayload_t payload(static_cast( -// calculator.calculate_serialized_size(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 << 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(descriptor->get_name(), &identifier, &object); -// } -// else -// { -// object._d(EK_MINIMAL); -// object.minimal()._d(eprosima::fastdds::dds::xtypes::TK_UNION); - -// object.minimal().union_type().union_flags().IS_FINAL(descriptor->annotation_is_final()); -// object.minimal().union_type().union_flags().IS_APPENDABLE(descriptor->annotation_is_appendable()); -// object.minimal().union_type().union_flags().IS_MUTABLE(descriptor->annotation_is_mutable()); -// object.minimal().union_type().union_flags().IS_NESTED(descriptor->annotation_get_nested()); -// object.minimal().union_type().union_flags().IS_AUTOID_HASH(false); - -// object.minimal().union_type().discriminator().common().member_flags().TRY_CONSTRUCT1(false); -// object.minimal().union_type().discriminator().common().member_flags().TRY_CONSTRUCT2(false); -// object.minimal().union_type().discriminator().common().member_flags().IS_EXTERNAL(false); -// object.minimal().union_type().discriminator().common().member_flags().IS_OPTIONAL(false); -// object.minimal().union_type().discriminator().common().member_flags().IS_MUST_UNDERSTAND(false); -// object.minimal().union_type().discriminator().common().member_flags().IS_KEY( -// descriptor->discriminator_type_->descriptor_->annotation_get_key()); -// object.minimal().union_type().discriminator().common().member_flags().IS_DEFAULT(false); - -// TypeObject discObj; -// build_type_object(descriptor->discriminator_type_->descriptor_, discObj); -// TypeIdentifier discIdent = -// *TypeObjectFactory::get_instance()->get_type_identifier(descriptor->discriminator_type_->get_name()); -// object.minimal().union_type().discriminator().common().type_id(discIdent); -// //*TypeObjectFactory::get_instance()->get_type_identifier(descriptor->discriminator_type_->get_name())); - -// for (const MemberDescriptor* member : members) -// { -// MinimalUnionMember mum; -// mum.common().member_id(member->get_index()); -// mum.common().member_flags().TRY_CONSTRUCT1(false); -// mum.common().member_flags().TRY_CONSTRUCT2(false); -// mum.common().member_flags().IS_EXTERNAL(false); -// mum.common().member_flags().IS_OPTIONAL(false); -// mum.common().member_flags().IS_MUST_UNDERSTAND(false); -// mum.common().member_flags().IS_KEY(false); -// mum.common().member_flags().IS_DEFAULT(member->is_default_union_value()); - -// //TypeIdentifier memIdent; -// //build_type_identifier(member->type_->descriptor_, memIdent); - -// std::map membersMap; -// member->type_->get_all_members(membersMap); -// std::vector innerMembers; -// for (auto it : membersMap) -// { -// innerMembers.push_back(it.second->get_descriptor()); -// } - -// TypeObject memObj; -// build_type_object(member->type_->descriptor_, memObj, &innerMembers); -// const TypeIdentifier* typeId = -// TypeObjectFactory::get_instance()->get_type_identifier(member->type_->get_name()); -// if (typeId == nullptr) -// { -// EPROSIMA_LOG_ERROR(DYN_TYPES, "Member " << member->get_name() -// << " of union " << descriptor->get_name() << " failed."); -// } -// else -// { -// TypeIdentifier memIdent = *typeId; -// mum.common().type_id(memIdent); -// } - -// for (uint64_t lab : member->get_union_labels()) -// { -// mum.common().label_seq().emplace_back(static_cast(lab)); -// } -// MD5 hash(member->get_name()); -// for (int i = 0; i < 4; ++i) -// { -// mum.detail().name_hash()[i] = hash.digest[i]; -// } -// object.minimal().union_type().member_seq().emplace_back(mum); -// } - -// TypeIdentifier identifier; -// identifier._d(EK_MINIMAL); - -// eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); -// size_t current_alignment {0}; -// eprosima::fastrtps::rtps::SerializedPayload_t payload(static_cast( -// calculator.calculate_serialized_size(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 << 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(descriptor->get_name(), &identifier, &object); -// } -// } - -// void DynamicTypeBuilderFactory::build_bitset_type_code( -// const TypeDescriptor* descriptor, -// TypeObject& object, -// const std::vector members, -// bool complete) const -// { -// if (complete) -// { -// object._d(EK_COMPLETE); -// object.complete()._d(eprosima::fastdds::dds::xtypes::TK_BITSET); - -// object.complete().bitset_type().bitset_flags().IS_FINAL(false); -// object.complete().bitset_type().bitset_flags().IS_APPENDABLE(false); -// object.complete().bitset_type().bitset_flags().IS_MUTABLE(false); -// object.complete().bitset_type().bitset_flags().IS_NESTED(false); -// object.complete().bitset_type().bitset_flags().IS_AUTOID_HASH(false); - -// // Apply annotations -// apply_type_annotations(object.complete().bitset_type().header().detail().ann_custom(), descriptor); - -// for (const MemberDescriptor* member : members) -// { -// CompleteBitfield msm; -// msm.common().position(member->annotation_get_position()); // Position stored as annotation -// // Bitcount stored as bit_bound annotation -// msm.common().bitcount(static_cast(member->annotation_get_bit_bound())); -// msm.common().holder_type(member->type_->get_kind()); -// msm.detail().name(member->get_name()); - -// // Apply member annotations -// TypeDescriptor member_type_descriptor; -// member->type_->get_descriptor(&member_type_descriptor); -// apply_type_annotations(msm.detail().ann_custom(), &member_type_descriptor); - -// object.complete().bitset_type().field_seq().emplace_back(msm); -// } - -// object.complete().bitset_type().header().detail().type_name(descriptor->get_name()); -// //object.complete().bitset_type().header().detail().ann_builtin()... -// //object.complete().bitset_type().header().detail().ann_custom()... - -// if (descriptor->get_base_type().get() != nullptr) -// { -// TypeIdentifier parent; -// build_type_identifier(descriptor->get_base_type(), parent); -// object.complete().bitset_type().header().base_type(parent); -// } -// //object.complete().bitset_type().header().base_type().equivalence_hash()[0..13]; - -// TypeIdentifier identifier; -// identifier._d(EK_COMPLETE); - -// eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); -// size_t current_alignment {0}; -// eprosima::fastrtps::rtps::SerializedPayload_t payload(static_cast( -// calculator.calculate_serialized_size(object.complete().bitset_type(), current_alignment) + 4)); -// // Object that manages the raw buffer. -// eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - -// 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; -// // Serialize encapsulation - -// for (CompleteBitfield& st : object.complete().bitset_type().field_seq()) -// { -// ser << st; -// } -// #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(descriptor->get_name(), &identifier, &object); -// } -// else -// { -// object._d(EK_COMPLETE); -// object.minimal()._d(eprosima::fastdds::dds::xtypes::TK_BITSET); - -// object.minimal().bitset_type().bitset_flags().IS_FINAL(false); -// object.minimal().bitset_type().bitset_flags().IS_APPENDABLE(false); -// object.minimal().bitset_type().bitset_flags().IS_MUTABLE(false); -// object.minimal().bitset_type().bitset_flags().IS_NESTED(false); -// object.minimal().bitset_type().bitset_flags().IS_AUTOID_HASH(false); - -// for (const MemberDescriptor* member : members) -// { -// MinimalBitfield msm; -// msm.common().position(member->annotation_get_position()); // Position stored as annotation -// // Bitcount stored as bit_bound annotation -// msm.common().bitcount(static_cast(member->annotation_get_bit_bound())); -// msm.common().holder_type(member->type_->get_kind()); -// MD5 parent_bitfield_hash(member->get_name()); -// for (int i = 0; i < 4; ++i) -// { -// msm.name_hash()[i] = parent_bitfield_hash.digest[i]; -// } -// object.minimal().bitset_type().field_seq().emplace_back(msm); -// } - -// //object.minimal().bitset_type().header().detail().ann_builtin()... -// //object.minimal().bitset_type().header().detail().ann_custom()... - -// if (descriptor->get_base_type().get() != nullptr) -// { -// TypeIdentifier parent; -// build_type_identifier(descriptor->get_base_type(), parent); -// object.minimal().bitset_type().header().base_type(parent); -// } -// //object.minimal().bitset_type().header().base_type().equivalence_hash()[0..13]; - -// TypeIdentifier identifier; -// identifier._d(EK_COMPLETE); - -// eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); -// size_t current_alignment {0}; -// eprosima::fastrtps::rtps::SerializedPayload_t payload(static_cast( -// calculator.calculate_serialized_size(object.minimal().bitset_type(), current_alignment) + 4)); -// // Object that manages the raw buffer. -// eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - -// 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; -// // Serialize encapsulation - -// for (MinimalBitfield& st : object.minimal().bitset_type().field_seq()) -// { -// ser << st; -// } -// #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(descriptor->get_name(), &identifier, &object); -// } -// } - -// void DynamicTypeBuilderFactory::build_bitmask_type_code( -// const TypeDescriptor* descriptor, -// TypeObject& object, -// const std::vector members, -// bool complete) const -// { -// if (complete) -// { -// object._d(EK_COMPLETE); -// object.complete()._d(eprosima::fastdds::dds::xtypes::TK_BITMASK); - -// object.complete().bitmask_type().bitmask_flags().IS_FINAL(false); -// object.complete().bitmask_type().bitmask_flags().IS_APPENDABLE(false); -// object.complete().bitmask_type().bitmask_flags().IS_MUTABLE(false); -// object.complete().bitmask_type().bitmask_flags().IS_NESTED(false); -// object.complete().bitmask_type().bitmask_flags().IS_AUTOID_HASH(false); - -// // Apply annotations -// apply_type_annotations(object.complete().bitmask_type().header().detail().ann_custom(), descriptor); - -// for (const MemberDescriptor* member : members) -// { -// CompleteBitflag msm; -// msm.common().position(member->annotation_get_position()); // Position stored as annotation -// msm.detail().name(member->get_name()); - -// // Apply member annotations -// TypeDescriptor member_type_descriptor; -// member->type_->get_descriptor(&member_type_descriptor); -// apply_type_annotations(msm.detail().ann_custom(), &member_type_descriptor); - -// object.complete().bitmask_type().flag_seq().emplace_back(msm); -// } - -// object.complete().bitmask_type().header().detail().type_name(descriptor->get_name()); - -// TypeIdentifier identifier; -// identifier._d(EK_COMPLETE); - -// eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); -// size_t current_alignment {0}; -// eprosima::fastrtps::rtps::SerializedPayload_t payload(static_cast( -// calculator.calculate_serialized_size(object.complete().bitmask_type(), current_alignment) + 4)); -// // Object that manages the raw buffer. -// eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - -// 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; -// // Serialize encapsulation - -// for (CompleteBitflag& st : object.complete().bitmask_type().flag_seq()) -// { -// ser << st; -// } -// #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(descriptor->get_name(), &identifier, &object); -// } -// else -// { -// object._d(EK_COMPLETE); -// object.minimal()._d(eprosima::fastdds::dds::xtypes::TK_BITMASK); - -// object.minimal().bitmask_type().bitmask_flags().IS_FINAL(false); -// object.minimal().bitmask_type().bitmask_flags().IS_APPENDABLE(false); -// object.minimal().bitmask_type().bitmask_flags().IS_MUTABLE(false); -// object.minimal().bitmask_type().bitmask_flags().IS_NESTED(false); -// object.minimal().bitmask_type().bitmask_flags().IS_AUTOID_HASH(false); - -// for (const MemberDescriptor* member : members) -// { -// MinimalBitflag msm; -// msm.common().position(member->annotation_get_position()); // Position stored as annotation -// MD5 parent_bitfield_hash(member->get_name()); -// for (int i = 0; i < 4; ++i) -// { -// msm.detail().name_hash()[i] = parent_bitfield_hash.digest[i]; -// } -// object.minimal().bitmask_type().flag_seq().emplace_back(msm); -// } - -// TypeIdentifier identifier; -// identifier._d(EK_COMPLETE); - -// eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); -// size_t current_alignment {0}; -// eprosima::fastrtps::rtps::SerializedPayload_t payload(static_cast( -// calculator.calculate_serialized_size(object.minimal().bitmask_type(), current_alignment) + 4)); -// // Object that manages the raw buffer. -// eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - -// 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; -// // Serialize encapsulation - -// for (MinimalBitflag& st : object.minimal().bitmask_type().flag_seq()) -// { -// ser << st; -// } -// #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(descriptor->get_name(), &identifier, &object); -// } -// } - -// void DynamicTypeBuilderFactory::build_annotation_type_code( -// const TypeDescriptor* descriptor, -// TypeObject& object, -// const std::vector members, -// bool complete) const -// { -// if (complete) -// { -// object._d(EK_COMPLETE); -// object.complete()._d(eprosima::fastdds::dds::xtypes::TK_ANNOTATION); - -// for (const MemberDescriptor* member : members) -// { -// CompleteAnnotationParameter msm; -// msm.name(member->get_name()); - -// if (!member->get_default_value().empty()) -// { -// AnnotationParameterValue apv; -// set_annotation_default_value(apv, member); -// msm.default_value(apv); -// } - -// TypeObject memObj; -// build_type_object(member->type_->descriptor_, memObj); -// const TypeIdentifier* typeId = -// TypeObjectFactory::get_instance()->get_type_identifier(member->type_->get_name()); -// if (typeId == nullptr) -// { -// EPROSIMA_LOG_ERROR(DYN_TYPES, "Member " << member->get_name() -// << " of annotation " << descriptor->get_name() << " failed."); -// } -// else -// { -// TypeIdentifier memIdent = *typeId; -// msm.common().member_type_id(memIdent); -// } - -// object.complete().annotation_type().member_seq().emplace_back(msm); -// } - -// object.complete().annotation_type().header().annotation_name(descriptor->get_name()); - -// TypeIdentifier identifier; -// identifier._d(EK_COMPLETE); - -// eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); -// size_t current_alignment {0}; -// eprosima::fastrtps::rtps::SerializedPayload_t payload(static_cast( -// calculator.calculate_serialized_size(object.complete().annotation_type(), -// current_alignment) + 4)); -// // Object that manages the raw buffer. -// eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - -// 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; -// // Serialize encapsulation - -// for (CompleteAnnotationParameter& st : object.complete().annotation_type().member_seq()) -// { -// ser << st; -// } -// #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(descriptor->get_name(), &identifier, &object); -// } -// else -// { -// object._d(EK_COMPLETE); -// object.minimal()._d(eprosima::fastdds::dds::xtypes::TK_ANNOTATION); - -// for (const MemberDescriptor* member : members) -// { -// MinimalAnnotationParameter msm; -// msm.name(member->get_name()); - -// if (!member->get_default_value().empty()) -// { -// AnnotationParameterValue apv; -// set_annotation_default_value(apv, member); -// msm.default_value(apv); -// } - -// TypeObject memObj; -// build_type_object(member->type_->descriptor_, memObj); -// const TypeIdentifier* typeId = -// TypeObjectFactory::get_instance()->get_type_identifier(member->type_->get_name()); -// if (typeId == nullptr) -// { -// EPROSIMA_LOG_ERROR(DYN_TYPES, "Member " << member->get_name() -// << " of annotation " << descriptor->get_name() << " failed."); -// } -// else -// { -// TypeIdentifier memIdent = *typeId; -// msm.common().member_type_id(memIdent); -// } - -// object.minimal().annotation_type().member_seq().emplace_back(msm); -// } - -// TypeIdentifier identifier; -// identifier._d(EK_COMPLETE); - -// eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); -// size_t current_alignment {0}; -// eprosima::fastrtps::rtps::SerializedPayload_t payload(static_cast( -// calculator.calculate_serialized_size(object.minimal().annotation_type(), -// current_alignment) + 4)); -// // Object that manages the raw buffer. -// eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - -// 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; -// // Serialize encapsulation - -// for (MinimalAnnotationParameter& st : object.minimal().annotation_type().member_seq()) -// { -// ser << st; -// } -// #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(descriptor->get_name(), &identifier, &object); -// } -// } - -void DynamicTypeBuilderFactory::set_annotation_default_value( - AnnotationParameterValue& apv, - const MemberDescriptor* member) const -{ - switch (member->get_kind()) - { - case eprosima::fastdds::dds::xtypes::TK_BOOLEAN: - { - std::string value = member->get_default_value(); - std::transform(value.begin(), value.end(), value.begin(), - [](unsigned char c) - { - return static_cast(std::tolower(c)); - }); - apv.boolean_value(value.compare("0") != 0 || value.compare(CONST_TRUE) == 0); - } - break; - case eprosima::fastdds::dds::xtypes::TK_BYTE: - { - apv.byte_value(static_cast(std::stoul(member->get_default_value()))); - } - break; - case eprosima::fastdds::dds::xtypes::TK_INT16: - { - apv.int16_value(static_cast(std::stoi(member->get_default_value()))); - } - break; - case eprosima::fastdds::dds::xtypes::TK_INT32: - { - apv.int32_value(static_cast(std::stoi(member->get_default_value()))); - } - break; - case eprosima::fastdds::dds::xtypes::TK_INT64: - { - apv.int64_value(static_cast(std::stoll(member->get_default_value()))); - } - break; - case eprosima::fastdds::dds::xtypes::TK_UINT16: - { - apv.uint_16_value(static_cast(std::stoul(member->get_default_value()))); - } - break; - case eprosima::fastdds::dds::xtypes::TK_UINT32: - { - apv.uint32_value(static_cast(std::stoul(member->get_default_value()))); - } - break; - case eprosima::fastdds::dds::xtypes::TK_UINT64: - { - apv.uint64_value(static_cast(std::stoull(member->get_default_value()))); - } - break; - case eprosima::fastdds::dds::xtypes::TK_FLOAT32: - { - apv.float32_value(std::stof(member->get_default_value())); - } - break; - case eprosima::fastdds::dds::xtypes::TK_FLOAT64: - { - apv.float64_value(std::stod(member->get_default_value())); - } - break; - case eprosima::fastdds::dds::xtypes::TK_FLOAT128: - { - apv.float128_value(std::stold(member->get_default_value())); - } - break; - case eprosima::fastdds::dds::xtypes::TK_CHAR8: - { - apv.char_value(member->get_default_value().c_str()[0]); - } - break; - case eprosima::fastdds::dds::xtypes::TK_CHAR16: - { - apv.wchar_value(wstring_from_bytes(member->get_default_value()).c_str()[0]); - } - break; - case eprosima::fastdds::dds::xtypes::TK_STRING8: - { - apv.string8_value(member->get_default_value()); - } - break; - case eprosima::fastdds::dds::xtypes::TK_STRING16: - { - apv.string16_value(wstring_from_bytes(member->get_default_value())); - } - break; - case eprosima::fastdds::dds::xtypes::TK_ENUM: - { - // TODO Translate from enum value name to integer value - apv.enumerated_value(static_cast(std::stoul(member->get_default_value()))); - } - break; - default: - break; - } -} - -DynamicType_ptr DynamicTypeBuilderFactory::create_alias_type( - DynamicTypeBuilder* base_type, - const std::string& sName) -{ - if (base_type != nullptr) - { - DynamicType_ptr pType = create_type(base_type); - if (pType != nullptr) - { - return create_alias_type(pType, sName); - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error creating alias type, Error creating dynamic type"); - } - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error creating alias type, base_type must be valid"); - } - return DynamicType_ptr(nullptr); -} - -DynamicType_ptr DynamicTypeBuilderFactory::create_alias_type( - DynamicType_ptr base_type, - const std::string& sName) -{ - if (base_type != nullptr) - { - TypeDescriptor pDescriptor; - pDescriptor.kind_ = eprosima::fastdds::dds::xtypes::TK_ALIAS; - pDescriptor.base_type_ = base_type; - if (sName.length() > 0) - { - pDescriptor.name_ = sName; - } - else - { - pDescriptor.name_ = base_type->get_name(); - } - - return create_type(&pDescriptor, sName); - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error creating alias type, base_type must be valid"); - } - return DynamicType_ptr(nullptr); -} - -DynamicType_ptr DynamicTypeBuilderFactory::create_int32_type() -{ - TypeDescriptor pInt32Descriptor(GenerateTypeName(get_type_name(eprosima::fastdds::dds::xtypes::TK_INT32)), - eprosima::fastdds::dds::xtypes::TK_INT32); - return DynamicType_ptr(new DynamicType(&pInt32Descriptor)); -} - -DynamicType_ptr DynamicTypeBuilderFactory::create_uint32_type() -{ - TypeDescriptor pUint32Descriptor(GenerateTypeName(get_type_name(eprosima::fastdds::dds::xtypes::TK_UINT32)), - eprosima::fastdds::dds::xtypes::TK_UINT32); - return DynamicType_ptr(new DynamicType(&pUint32Descriptor)); -} - -DynamicType_ptr DynamicTypeBuilderFactory::create_int16_type() -{ - TypeDescriptor pInt16Descriptor(GenerateTypeName(get_type_name(eprosima::fastdds::dds::xtypes::TK_INT16)), - eprosima::fastdds::dds::xtypes::TK_INT16); - return DynamicType_ptr(new DynamicType(&pInt16Descriptor)); -} - -DynamicType_ptr DynamicTypeBuilderFactory::create_uint16_type() -{ - TypeDescriptor pUint16Descriptor(GenerateTypeName(get_type_name(eprosima::fastdds::dds::xtypes::TK_UINT16)), - eprosima::fastdds::dds::xtypes::TK_UINT16); - return DynamicType_ptr(new DynamicType(&pUint16Descriptor)); -} - -DynamicType_ptr DynamicTypeBuilderFactory::create_int64_type() -{ - TypeDescriptor pInt64Descriptor(GenerateTypeName(get_type_name(eprosima::fastdds::dds::xtypes::TK_INT64)), - eprosima::fastdds::dds::xtypes::TK_INT64); - return DynamicType_ptr(new DynamicType(&pInt64Descriptor)); -} - -DynamicType_ptr DynamicTypeBuilderFactory::create_uint64_type() -{ - TypeDescriptor pUint64Descriptor(GenerateTypeName(get_type_name(eprosima::fastdds::dds::xtypes::TK_UINT64)), - eprosima::fastdds::dds::xtypes::TK_UINT64); - return DynamicType_ptr(new DynamicType(&pUint64Descriptor)); -} - -DynamicType_ptr DynamicTypeBuilderFactory::create_float32_type() -{ - TypeDescriptor pFloat32Descriptor(GenerateTypeName(get_type_name(eprosima::fastdds::dds::xtypes::TK_FLOAT32)), - eprosima::fastdds::dds::xtypes::TK_FLOAT32); - return DynamicType_ptr(new DynamicType(&pFloat32Descriptor)); -} - -DynamicType_ptr DynamicTypeBuilderFactory::create_float64_type() -{ - TypeDescriptor pFloat64Descriptor(GenerateTypeName(get_type_name(eprosima::fastdds::dds::xtypes::TK_FLOAT64)), - eprosima::fastdds::dds::xtypes::TK_FLOAT64); - return DynamicType_ptr(new DynamicType(&pFloat64Descriptor)); -} - -DynamicType_ptr DynamicTypeBuilderFactory::create_float128_type() -{ - TypeDescriptor pFloat128Descriptor(GenerateTypeName(get_type_name(eprosima::fastdds::dds::xtypes::TK_FLOAT128)), - eprosima::fastdds::dds::xtypes::TK_FLOAT128); - return DynamicType_ptr(new DynamicType(&pFloat128Descriptor)); -} - -DynamicType_ptr DynamicTypeBuilderFactory::create_char8_type() -{ - TypeDescriptor pChar8Descriptor(GenerateTypeName(get_type_name(eprosima::fastdds::dds::xtypes::TK_CHAR8)), - eprosima::fastdds::dds::xtypes::TK_CHAR8); - return DynamicType_ptr(new DynamicType(&pChar8Descriptor)); -} - -DynamicType_ptr DynamicTypeBuilderFactory::create_char16_type() -{ - TypeDescriptor pChar16Descriptor(GenerateTypeName(get_type_name(eprosima::fastdds::dds::xtypes::TK_CHAR16)), - eprosima::fastdds::dds::xtypes::TK_CHAR16); - return DynamicType_ptr(new DynamicType(&pChar16Descriptor)); -} - -DynamicType_ptr DynamicTypeBuilderFactory::create_bool_type() -{ - TypeDescriptor pBoolDescriptor(GenerateTypeName(get_type_name(eprosima::fastdds::dds::xtypes::TK_BOOLEAN)), - eprosima::fastdds::dds::xtypes::TK_BOOLEAN); - return DynamicType_ptr(new DynamicType(&pBoolDescriptor)); -} - -DynamicType_ptr DynamicTypeBuilderFactory::create_byte_type() -{ - TypeDescriptor pByteDescriptor(GenerateTypeName(get_type_name(eprosima::fastdds::dds::xtypes::TK_BYTE)), - eprosima::fastdds::dds::xtypes::TK_BYTE); - return DynamicType_ptr(new DynamicType(&pByteDescriptor)); -} - -DynamicType_ptr DynamicTypeBuilderFactory::create_string_type( - uint32_t bound /*= MAX_STRING_LENGTH*/) -{ - if (bound == BOUND_UNLIMITED) - { - bound = MAX_STRING_LENGTH; - } - TypeDescriptor pStringDescriptor("", eprosima::fastdds::dds::xtypes::TK_STRING8); - // pStringDescriptor.name_ = TypeNamesGenerator::get_string_type_name(bound, false, true); - pStringDescriptor.element_type_ = create_char8_type(); - pStringDescriptor.bound_.push_back(bound); - - return DynamicType_ptr(new DynamicType(&pStringDescriptor)); -} - -DynamicType_ptr DynamicTypeBuilderFactory::create_wstring_type( - uint32_t bound /*= MAX_STRING_LENGTH*/) -{ - if (bound == BOUND_UNLIMITED) - { - bound = MAX_STRING_LENGTH; - } - - TypeDescriptor pStringDescriptor("", eprosima::fastdds::dds::xtypes::TK_STRING16); - // pStringDescriptor.name_ = TypeNamesGenerator::get_string_type_name(bound, true, true); - pStringDescriptor.element_type_ = create_char16_type(); - pStringDescriptor.bound_.push_back(bound); - - return DynamicType_ptr(new DynamicType(&pStringDescriptor)); -} - -DynamicType_ptr DynamicTypeBuilderFactory::create_bitset_type( - uint32_t bound) -{ - if (bound <= MAX_BITMASK_LENGTH) - { - TypeDescriptor pDescriptor; - pDescriptor.kind_ = eprosima::fastdds::dds::xtypes::TK_BITSET; - pDescriptor.name_ = GenerateTypeName(get_type_name(eprosima::fastdds::dds::xtypes::TK_BITSET)); - pDescriptor.bound_.push_back(bound); - return create_type(&pDescriptor, pDescriptor.name_); - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, - "Error creating bitmask, length exceeds the maximum value '" << MAX_BITMASK_LENGTH << "'"); - } - return DynamicType_ptr(nullptr); -} - -// void DynamicTypeBuilderFactory::apply_type_annotations( -// AppliedAnnotationSeq& annotations, -// const TypeDescriptor* descriptor) const -// { -// for (const AnnotationDescriptor* annotation : descriptor->annotation_) -// { -// AppliedAnnotation ann; -// ann.annotation_typeid( -// *TypeObjectFactory::get_instance()->get_type_identifier_trying_complete(annotation->type_->get_name())); -// std::map values; -// annotation->get_all_value(values); -// for (auto it : values) -// { -// AppliedAnnotationParameter ann_param; -// MD5 message_hash(it.first); -// for (int i = 0; i < 4; ++i) -// { -// ann_param.paramname_hash()[i] = message_hash.digest[i]; -// } -// AnnotationParameterValue param_value; -// param_value._d(annotation->type_->get_kind()); -// param_value.from_string(it.second); -// ann_param.value(param_value); -// ann.param_seq().push_back(ann_param); -// } -// annotations.push_back(ann); -// } -// } - -} // namespace types -} // namespace fastrtps -} // namespace eprosima diff --git a/src/cpp/dynamic-types/DynamicTypeMember.cpp b/src/cpp/dynamic-types/DynamicTypeMember.cpp deleted file mode 100644 index c448db34a6b..00000000000 --- a/src/cpp/dynamic-types/DynamicTypeMember.cpp +++ /dev/null @@ -1,169 +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. - -#include -#include -#include -#include -#include -#include - -namespace eprosima { -namespace fastrtps { -namespace types { - -DynamicTypeMember::DynamicTypeMember() - : parent_(nullptr) - , id_(MEMBER_ID_INVALID) -{ -} - -DynamicTypeMember::DynamicTypeMember( - const MemberDescriptor* descriptor, - MemberId id) - : parent_(nullptr) - , id_(id) -{ - descriptor_.copy_from(descriptor); - descriptor_.set_id(id); -} - -DynamicTypeMember::DynamicTypeMember( - const DynamicTypeMember* other) - : parent_(other->parent_) - , id_(other->id_) -{ - descriptor_.copy_from(&other->descriptor_); -} - -DynamicTypeMember::~DynamicTypeMember() -{ - parent_ = nullptr; -} - -ReturnCode_t DynamicTypeMember::apply_annotation( - AnnotationDescriptor& descriptor) -{ - // Update the annotations on the member Dynamic Type. - return descriptor_.apply_annotation(descriptor); -} - -ReturnCode_t DynamicTypeMember::apply_annotation( - const std::string& annotation_name, - const std::string& key, - const std::string& value) -{ - // Update the annotations on the member Dynamic Type. - return descriptor_.apply_annotation(annotation_name, key, value); -} - -bool DynamicTypeMember::equals( - const DynamicTypeMember* other) const -{ - if (other != nullptr && descriptor_.annotation_.size() == other->descriptor_.annotation_.size()) - { - for (auto it = descriptor_.annotation_.begin(), - it2 = other->descriptor_.annotation_.begin(); - it != descriptor_.annotation_.end(); ++it, ++it2) - { - if (!(*it)->equals(*it2)) - { - return false; - } - } - return true; - } - else - { - return false; - } -} - -ReturnCode_t DynamicTypeMember::get_annotation( - AnnotationDescriptor& descriptor, - uint32_t idx) -{ - if (idx < descriptor_.annotation_.size()) - { - descriptor.copy_from(descriptor_.annotation_[idx]); - return eprosima::fastdds::dds::RETCODE_OK; - } - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; -} - -uint32_t DynamicTypeMember::get_annotation_count() -{ - return static_cast(descriptor_.annotation_.size()); -} - -bool DynamicTypeMember::key_annotation() const -{ - return descriptor_.annotation_is_key(); -} - -std::vector DynamicTypeMember::get_union_labels() const -{ - return descriptor_.get_union_labels(); -} - -ReturnCode_t DynamicTypeMember::get_descriptor( - MemberDescriptor* descriptor) const -{ - if (descriptor != nullptr) - { - descriptor->copy_from(&descriptor_); - return eprosima::fastdds::dds::RETCODE_OK; - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error getting MemberDescriptor, invalid input descriptor"); - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; - } -} - -uint32_t DynamicTypeMember::get_index() const -{ - return descriptor_.get_index(); -} - -std::string DynamicTypeMember::get_name() const -{ - return descriptor_.get_name(); -} - -MemberId DynamicTypeMember::get_id() const -{ - return descriptor_.get_id(); -} - -bool DynamicTypeMember::is_default_union_value() const -{ - return descriptor_.is_default_union_value(); -} - -void DynamicTypeMember::set_index( - uint32_t index) -{ - descriptor_.set_index(index); -} - -void DynamicTypeMember::set_parent( - DynamicType* pType) -{ - parent_ = pType; -} - -} // namespace types -} // namespace fastrtps -} // namespace eprosima diff --git a/src/cpp/dynamic-types/DynamicTypePtr.cpp b/src/cpp/dynamic-types/DynamicTypePtr.cpp deleted file mode 100644 index c5caa57c194..00000000000 --- a/src/cpp/dynamic-types/DynamicTypePtr.cpp +++ /dev/null @@ -1,40 +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. - -#include -#include -#include - -namespace eprosima { -namespace fastrtps { -namespace types { - -DynamicType_ptr::DynamicType_ptr( - DynamicType* pType) - : Base(pType, [](DynamicType* pType) -{ - DynamicTypeBuilderFactory::get_instance()->delete_type(pType); -}) -{ -} - -DynamicType_ptr& DynamicType_ptr::operator =( - DynamicType* ptr) -{ - return operator =(DynamicType_ptr(ptr)); -} - -} // namespace types -} // namespace fastrtps -} // namespace eprosima diff --git a/src/cpp/dynamic-types/MemberDescriptor.cpp b/src/cpp/dynamic-types/MemberDescriptor.cpp deleted file mode 100644 index 7a39b9221c4..00000000000 --- a/src/cpp/dynamic-types/MemberDescriptor.cpp +++ /dev/null @@ -1,784 +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. - -#include -#include -#include -#include -#include -#include - -namespace eprosima { -namespace fastrtps { -namespace types { - -MemberDescriptor::MemberDescriptor() - : name_("") - , id_(MEMBER_ID_INVALID) - , type_(nullptr) - , default_value_("") - , index_(INDEX_INVALID) - , default_label_(false) -{ -} - -MemberDescriptor::MemberDescriptor( - uint32_t index, - const std::string& name) - : name_(name) - , id_(MEMBER_ID_INVALID) - , type_(nullptr) - , default_value_("") - , index_(index) - , default_label_(false) -{ -} - -MemberDescriptor::MemberDescriptor( - const MemberDescriptor* descriptor) - : name_("") - , id_(MEMBER_ID_INVALID) - , type_(nullptr) - , default_value_("") - , index_(INDEX_INVALID) - , default_label_(false) -{ - copy_from(descriptor); -} - -MemberDescriptor::MemberDescriptor( - MemberId id, - const std::string& name, - DynamicType_ptr type_) - : name_(name) - , id_(id) - , type_(type_) - , default_value_("") - , index_(INDEX_INVALID) - , default_label_(false) -{ - -} - -MemberDescriptor::MemberDescriptor( - MemberId id, - const std::string& name, - DynamicType_ptr type_, - const std::string& defaultValue) - : name_(name) - , id_(id) - , type_(type_) - , default_value_(defaultValue) - , index_(INDEX_INVALID) - , default_label_(false) -{ -} - -MemberDescriptor::MemberDescriptor( - MemberId id, - const std::string& name, - DynamicType_ptr type_, - const std::string& defaultValue, - const std::vector& unionLabels, - bool isDefaultLabel) - : name_(name) - , id_(id) - , type_(type_) - , default_value_(defaultValue) - , index_(INDEX_INVALID) - , default_label_(isDefaultLabel) -{ - labels_ = unionLabels; -} - -MemberDescriptor::~MemberDescriptor() -{ - for (auto it = annotation_.begin(); it != annotation_.end(); ++it) - { - delete *it; - } - annotation_.clear(); - type_ = nullptr; -} - -void MemberDescriptor::add_union_case_index( - uint64_t value) -{ - labels_.push_back(value); -} - -bool MemberDescriptor::check_union_labels( - const std::vector& labels) const -{ - for (auto it = labels.begin(); it != labels.end(); ++it) - { - if (std::find(labels_.begin(), labels_.end(), *it) != labels_.end()) - { - return false; - } - } - return true; -} - -ReturnCode_t MemberDescriptor::copy_from( - const MemberDescriptor* other) -{ - if (other != nullptr) - { - try - { - // Clear annotations - for (auto it = annotation_.begin(); it != annotation_.end(); ++it) - { - delete *it; - } - annotation_.clear(); - - // Copy them - for (auto it = other->annotation_.begin(); it != other->annotation_.end(); ++it) - { - AnnotationDescriptor* newDescriptor = new AnnotationDescriptor(*it); - annotation_.push_back(newDescriptor); - } - - type_ = other->type_; - name_ = other->name_; - id_ = other->id_; - default_value_ = other->default_value_; - index_ = other->index_; - default_label_ = other->default_label_; - labels_ = other->labels_; - return eprosima::fastdds::dds::RETCODE_OK; - } - catch (std::exception& /*e*/) - { - return eprosima::fastdds::dds::RETCODE_ERROR; - } - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error copying MemberDescriptor, invalid input descriptor"); - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; - } -} - -bool MemberDescriptor::equals( - const MemberDescriptor* other) const -{ - if (other != nullptr && name_ == other->name_ && id_ == other->id_ && - ((type_ == nullptr && other->type_ == nullptr) || type_->equals(other->type_.get())) && - default_value_ == other->default_value_ && index_ == other->index_ && - default_label_ == other->default_label_ && - labels_.size() == other->labels_.size()) - { - for (auto it = labels_.begin(), it2 = other->labels_.begin(); it != labels_.end(); ++it, ++it2) - { - if (*it != *it2) - { - return false; - } - } - return true; - } - return false; -} - -MemberId MemberDescriptor::get_id() const -{ - return id_; -} - -uint32_t MemberDescriptor::get_index() const -{ - return index_; -} - -TypeKind MemberDescriptor::get_kind() const -{ - if (type_ != nullptr) - { - return type_->get_kind(); - } - return 0; -} - -std::string MemberDescriptor::get_name() const -{ - return name_; -} - -std::vector MemberDescriptor::get_union_labels() const -{ - return labels_; -} - -bool MemberDescriptor::is_consistent( - TypeKind parentKind) const -{ - // The type field is mandatory in every type except bitmasks and enums. - if ((parentKind != eprosima::fastdds::dds::xtypes::TK_BITMASK && - parentKind != eprosima::fastdds::dds::xtypes::TK_ENUM) && type_ == nullptr) - { - return false; - } - - // Only aggregated types must use the ID value. - if (id_ != MEMBER_ID_INVALID && parentKind != eprosima::fastdds::dds::xtypes::TK_UNION && - parentKind != eprosima::fastdds::dds::xtypes::TK_STRUCTURE && - parentKind != eprosima::fastdds::dds::xtypes::TK_BITSET && - parentKind != eprosima::fastdds::dds::xtypes::TK_ANNOTATION) - { - return false; - } - - if (!is_default_value_consistent(default_value_)) - { - return false; - } - - if (type_ != nullptr && !is_type_name_consistent(type_->name_)) // Enums and bitmask don't have type - { - return false; - } - - // Only Unions need the field "label" - if (labels_.size() != 0 && parentKind != eprosima::fastdds::dds::xtypes::TK_UNION) - { - return false; - } - // If the field isn't the default value for the union, it must have a label value. - else if (parentKind == eprosima::fastdds::dds::xtypes::TK_UNION && default_label_ == false && labels_.size() == 0) - { - return false; - } - - return true; -} - -bool MemberDescriptor::is_default_union_value() const -{ - return default_label_; -} - -bool MemberDescriptor::is_default_value_consistent( - const std::string& sDefaultValue) const -{ - if (sDefaultValue.length() > 0) - { - try - { - switch (get_kind()) - { - default: - return true; - case eprosima::fastdds::dds::xtypes::TK_INT32: - { - int32_t value(0); - value = stoi(sDefaultValue); - (void)value; - } - break; - case eprosima::fastdds::dds::xtypes::TK_UINT32: - { - uint32_t value(0); - value = stoul(sDefaultValue); - (void)value; - } - break; - case eprosima::fastdds::dds::xtypes::TK_INT16: - { - int16_t value(0); - value = static_cast(stoi(sDefaultValue)); - (void)value; - } - break; - case eprosima::fastdds::dds::xtypes::TK_UINT16: - { - uint16_t value(0); - value = static_cast(stoul(sDefaultValue)); - (void)value; - } - break; - case eprosima::fastdds::dds::xtypes::TK_INT64: - { - int64_t value(0); - value = stoll(sDefaultValue); - (void)value; - } - break; - case eprosima::fastdds::dds::xtypes::TK_UINT64: - { - uint64_t value(0); - value = stoul(sDefaultValue); - (void)value; - } - break; - case eprosima::fastdds::dds::xtypes::TK_FLOAT32: - { - float value(0.0f); - value = stof(sDefaultValue); - (void)value; - } - break; - case eprosima::fastdds::dds::xtypes::TK_FLOAT64: - { - double value(0.0f); - value = stod(sDefaultValue); - (void)value; - } - break; - case eprosima::fastdds::dds::xtypes::TK_FLOAT128: - { - long double value(0.0f); - value = stold(sDefaultValue); - (void)value; - } - break; - case eprosima::fastdds::dds::xtypes::TK_CHAR8: { - return sDefaultValue.length() >= 1; - } - case eprosima::fastdds::dds::xtypes::TK_CHAR16: - { - std::wstring temp = std::wstring(sDefaultValue.begin(), sDefaultValue.end()); - (void)temp; - } - break; - case eprosima::fastdds::dds::xtypes::TK_BOOLEAN: - { - if (sDefaultValue == CONST_TRUE || sDefaultValue == CONST_FALSE) - { - return true; - } - int value(0); - value = stoi(sDefaultValue); - (void)value; - } - break; - case eprosima::fastdds::dds::xtypes::TK_BYTE: { - return sDefaultValue.length() >= 1; - } - break; - case eprosima::fastdds::dds::xtypes::TK_STRING16: { - return true; - } - case eprosima::fastdds::dds::xtypes::TK_STRING8: { - return true; - } - case eprosima::fastdds::dds::xtypes::TK_ENUM: - { - uint32_t value(0); - value = stoul(sDefaultValue); - (void)value; - } - break; - case eprosima::fastdds::dds::xtypes::TK_BITMASK: - { - int value(0); - value = stoi(sDefaultValue); - (void)value; - } - break; - case eprosima::fastdds::dds::xtypes::TK_ARRAY: { - return true; - } - case eprosima::fastdds::dds::xtypes::TK_SEQUENCE: { - return true; - } - case eprosima::fastdds::dds::xtypes::TK_MAP: { - return true; - } - } - } - catch (...) - { - return false; - } - } - return true; -} - -bool MemberDescriptor::is_type_name_consistent( - const std::string& sName) const -{ - return TypeDescriptor::is_type_name_consistent(sName); -} - -void MemberDescriptor::set_id( - MemberId id) -{ - id_ = id; -} - -void MemberDescriptor::set_index( - uint32_t index) -{ - index_ = index; -} - -void MemberDescriptor::set_name( - const std::string& name) -{ - name_ = name; -} - -void MemberDescriptor::set_type( - DynamicType_ptr type) -{ - type_ = type; -} - -void MemberDescriptor::set_default_union_value( - bool bDefault) -{ - default_label_ = bDefault; -} - -// Annotations application -bool MemberDescriptor::annotation_is_optional() const -{ - AnnotationDescriptor* ann = get_annotation(ANNOTATION_OPTIONAL_ID); - if (ann != nullptr) - { - std::string value; - if (ann->get_value(value) == eprosima::fastdds::dds::RETCODE_OK) - { - return value == CONST_TRUE; - } - } - return false; -} - -bool MemberDescriptor::annotation_is_key() const -{ - return annotation_get_key(); -} - -bool MemberDescriptor::annotation_get_key() const -{ - AnnotationDescriptor* ann = get_annotation(ANNOTATION_KEY_ID); - if (ann == nullptr) - { - ann = get_annotation(ANNOTATION_EPKEY_ID); - } - if (ann != nullptr) - { - std::string value; - if (ann->get_value(value) == eprosima::fastdds::dds::RETCODE_OK) - { - return value == CONST_TRUE; - } - } - return false; -} - -bool MemberDescriptor::annotation_is_must_understand() const -{ - AnnotationDescriptor* ann = get_annotation(ANNOTATION_MUST_UNDERSTAND_ID); - if (ann != nullptr) - { - std::string value; - if (ann->get_value(value) == eprosima::fastdds::dds::RETCODE_OK) - { - return value == CONST_TRUE; - } - } - return false; -} - -bool MemberDescriptor::annotation_is_non_serialized() const -{ - AnnotationDescriptor* ann = get_annotation(ANNOTATION_NON_SERIALIZED_ID); - if (ann != nullptr) - { - std::string value; - if (ann->get_value(value) == eprosima::fastdds::dds::RETCODE_OK) - { - return value == CONST_TRUE; - } - } - return false; -} - -bool MemberDescriptor::annotation_is_value() const -{ - return get_annotation(ANNOTATION_VALUE_ID) != nullptr; -} - -bool MemberDescriptor::annotation_is_default_literal() const -{ - return get_annotation(ANNOTATION_DEFAULT_LITERAL_ID) != nullptr; -} - -bool MemberDescriptor::annotation_is_position() const -{ - return get_annotation(ANNOTATION_OPTIONAL_ID) != nullptr; -} - -// Annotations getters -std::string MemberDescriptor::annotation_get_value() const -{ - AnnotationDescriptor* ann = get_annotation(ANNOTATION_VALUE_ID); - if (ann != nullptr) - { - std::string value; - if (ann->get_value(value) == eprosima::fastdds::dds::RETCODE_OK) - { - return value; - } - } - return ""; -} - -std::string MemberDescriptor::annotation_get_default() const -{ - AnnotationDescriptor* ann = get_annotation(ANNOTATION_DEFAULT_ID); - if (ann != nullptr) - { - std::string value; - if (ann->get_value(value) == eprosima::fastdds::dds::RETCODE_OK) - { - return value; - } - } - return ""; -} - -uint16_t MemberDescriptor::annotation_get_position() const -{ - AnnotationDescriptor* ann = get_annotation(ANNOTATION_POSITION_ID); - if (ann != nullptr) - { - std::string value; - if (ann->get_value(value) == eprosima::fastdds::dds::RETCODE_OK) - { - return static_cast(std::stoi(value)); - } - } - return static_cast(-1); -} - -// Annotations setters -void MemberDescriptor::annotation_set_optional( - bool optional) -{ - AnnotationDescriptor* ann = get_annotation(ANNOTATION_OPTIONAL_ID); - if (ann == nullptr) - { - ann = new AnnotationDescriptor(); - ann->set_type(DynamicTypeBuilderFactory::get_instance()->create_annotation_primitive(ANNOTATION_OPTIONAL_ID)); - apply_annotation(*ann); - delete ann; - ann = get_annotation(ANNOTATION_OPTIONAL_ID); - } - ann->set_value("value", optional ? "true" : "false"); -} - -void MemberDescriptor::annotation_set_key( - bool key) -{ - AnnotationDescriptor* ann = get_annotation(ANNOTATION_KEY_ID); - if (ann == nullptr) - { - ann = new AnnotationDescriptor(); - ann->set_type(DynamicTypeBuilderFactory::get_instance()->create_annotation_primitive(ANNOTATION_KEY_ID)); - apply_annotation(*ann); - delete ann; - ann = get_annotation(ANNOTATION_KEY_ID); - } - ann->set_value("value", key ? "true" : "false"); -} - -void MemberDescriptor::annotation_set_must_understand( - bool must_understand) -{ - AnnotationDescriptor* ann = get_annotation(ANNOTATION_MUST_UNDERSTAND_ID); - if (ann == nullptr) - { - ann = new AnnotationDescriptor(); - ann->set_type( - DynamicTypeBuilderFactory::get_instance()->create_annotation_primitive(ANNOTATION_MUST_UNDERSTAND_ID)); - apply_annotation(*ann); - delete ann; - ann = get_annotation(ANNOTATION_MUST_UNDERSTAND_ID); - } - ann->set_value("value", must_understand ? "true" : "false"); -} - -void MemberDescriptor::annotation_set_non_serialized( - bool non_serialized) -{ - AnnotationDescriptor* ann = get_annotation(ANNOTATION_NON_SERIALIZED_ID); - if (ann == nullptr) - { - ann = new AnnotationDescriptor(); - ann->set_type( - DynamicTypeBuilderFactory::get_instance()->create_annotation_primitive(ANNOTATION_NON_SERIALIZED_ID)); - apply_annotation(*ann); - delete ann; - ann = get_annotation(ANNOTATION_NON_SERIALIZED_ID); - } - ann->set_value("value", non_serialized ? "true" : "false"); -} - -void MemberDescriptor::annotation_set_value( - const std::string& value) -{ - AnnotationDescriptor* ann = get_annotation(ANNOTATION_VALUE_ID); - if (ann == nullptr) - { - ann = new AnnotationDescriptor(); - ann->set_type(DynamicTypeBuilderFactory::get_instance()->create_annotation_primitive(ANNOTATION_VALUE_ID)); - apply_annotation(*ann); - delete ann; - ann = get_annotation(ANNOTATION_VALUE_ID); - } - ann->set_value("value", value); -} - -void MemberDescriptor::annotation_set_default_literal() -{ - AnnotationDescriptor* ann = get_annotation(ANNOTATION_DEFAULT_LITERAL_ID); - if (ann == nullptr) - { - ann = new AnnotationDescriptor(); - ann->set_type( - DynamicTypeBuilderFactory::get_instance()->create_annotation_primitive(ANNOTATION_DEFAULT_LITERAL_ID)); - apply_annotation(*ann); - delete ann; - ann = get_annotation(ANNOTATION_DEFAULT_LITERAL_ID); - } - ann->set_value("value", "true"); -} - -void MemberDescriptor::annotation_set_position( - uint16_t position) -{ - AnnotationDescriptor* ann = get_annotation(ANNOTATION_POSITION_ID); - if (ann == nullptr) - { - ann = new AnnotationDescriptor(); - ann->set_type(DynamicTypeBuilderFactory::get_instance()->create_annotation_primitive(ANNOTATION_POSITION_ID)); - apply_annotation(*ann); - delete ann; - ann = get_annotation(ANNOTATION_POSITION_ID); - } - ann->set_value("value", std::to_string(position)); -} - -void MemberDescriptor::annotation_set_default( - const std::string& default_value) -{ - AnnotationDescriptor* ann = get_annotation(ANNOTATION_DEFAULT_ID); - if (ann == nullptr) - { - ann = new AnnotationDescriptor(); - ann->set_type(DynamicTypeBuilderFactory::get_instance()->create_annotation_primitive(ANNOTATION_DEFAULT_ID)); - apply_annotation(*ann); - delete ann; - ann = get_annotation(ANNOTATION_DEFAULT_ID); - } - ann->set_value("value", default_value); -} - -bool MemberDescriptor::annotation_is_bit_bound() const -{ - return get_annotation(ANNOTATION_BIT_BOUND_ID) != nullptr; -} - -uint16_t MemberDescriptor::annotation_get_bit_bound() const -{ - AnnotationDescriptor* ann = get_annotation(ANNOTATION_BIT_BOUND_ID); - if (ann != nullptr) - { - std::string value; - if (ann->get_value(value) == eprosima::fastdds::dds::RETCODE_OK) - { - return static_cast(std::stoi(value)); - } - } - return 32; // Default value -} - -void MemberDescriptor::annotation_set_bit_bound( - uint16_t bit_bound) -{ - AnnotationDescriptor* ann = get_annotation(ANNOTATION_BIT_BOUND_ID); - if (ann == nullptr) - { - ann = new AnnotationDescriptor(); - ann->set_type(DynamicTypeBuilderFactory::get_instance()->create_annotation_primitive(ANNOTATION_BIT_BOUND_ID)); - apply_annotation(*ann); - delete ann; - ann = get_annotation(ANNOTATION_BIT_BOUND_ID); - } - ann->set_value("value", std::to_string(bit_bound)); -} - -ReturnCode_t MemberDescriptor::apply_annotation( - AnnotationDescriptor& descriptor) -{ - if (descriptor.is_consistent()) - { - AnnotationDescriptor* pNewDescriptor = new AnnotationDescriptor(); - pNewDescriptor->copy_from(&descriptor); - annotation_.push_back(pNewDescriptor); - return eprosima::fastdds::dds::RETCODE_OK; - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error applying annotation. The input descriptor isn't consistent."); - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; - } -} - -ReturnCode_t MemberDescriptor::apply_annotation( - const std::string& annotation_name, - const std::string& key, - const std::string& value) -{ - AnnotationDescriptor* ann = get_annotation(annotation_name); - if (ann != nullptr) - { - ann->set_value(key, value); - } - else - { - AnnotationDescriptor* pNewDescriptor = new AnnotationDescriptor(); - pNewDescriptor->set_type( - DynamicTypeBuilderFactory::get_instance()->create_annotation_primitive(annotation_name)); - pNewDescriptor->set_value(key, value); - annotation_.push_back(pNewDescriptor); - } - return eprosima::fastdds::dds::RETCODE_OK; -} - -AnnotationDescriptor* MemberDescriptor::get_annotation( - const std::string& name) const -{ - auto it = annotation_.begin(); - - for (; it != annotation_.end(); ++it) - { - AnnotationDescriptor* ann = *it; - if (ann->type()->get_name().compare(name) == 0) - { - return ann; - } - } - return nullptr; -} - -} // namespace types -} // namespace fastrtps -} // namespace eprosima diff --git a/src/cpp/dynamic-types/TypeDescriptor.cpp b/src/cpp/dynamic-types/TypeDescriptor.cpp deleted file mode 100644 index a5717448d70..00000000000 --- a/src/cpp/dynamic-types/TypeDescriptor.cpp +++ /dev/null @@ -1,676 +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. - -#include -#include -#include -#include -#include -#include - -namespace eprosima { -namespace fastrtps { -namespace types { - -enum FSM_INPUTS -{ - LETTER = 1, - NUMBER, - UNDERSCORE, - COLON, - OTHER -}; - -enum FSM_STATES -{ - INVALID = 0, - SINGLECOLON, - DOUBLECOLON, - VALID -}; - -static const int stateTable[4][6] = -{ - /* Input: letter, number, underscore, colon, other */ - {INVALID, VALID, INVALID, INVALID, INVALID, INVALID}, - {SINGLECOLON, INVALID, INVALID, INVALID, DOUBLECOLON, INVALID}, - {DOUBLECOLON, VALID, INVALID, INVALID, INVALID, INVALID}, - {VALID, VALID, VALID, VALID, SINGLECOLON, INVALID} -}; - -TypeDescriptor::TypeDescriptor() - : kind_(0) - , name_("") - , base_type_(nullptr) - , discriminator_type_(nullptr) - , element_type_(nullptr) - , key_element_type_(nullptr) -{ -} - -TypeDescriptor::TypeDescriptor( - const std::string& name, - TypeKind kind) - : kind_(kind) - , name_(name) - , base_type_(nullptr) - , discriminator_type_(nullptr) - , element_type_(nullptr) - , key_element_type_(nullptr) -{ -} - -TypeDescriptor::TypeDescriptor( - const TypeDescriptor* other) - : kind_(0) - , name_("") - , base_type_(nullptr) - , discriminator_type_(nullptr) - , element_type_(nullptr) - , key_element_type_(nullptr) -{ - copy_from(other); -} - -TypeDescriptor::~TypeDescriptor() -{ - clean(); -} - -void TypeDescriptor::clean() -{ - for (auto it = annotation_.begin(); it != annotation_.end(); ++it) - { - delete *it; - } - annotation_.clear(); - - base_type_ = nullptr; - discriminator_type_ = nullptr; - element_type_ = nullptr; - key_element_type_ = nullptr; -} - -ReturnCode_t TypeDescriptor::copy_from( - const TypeDescriptor* descriptor) -{ - if (descriptor != nullptr) - { - try - { - clean(); - - for (auto it = descriptor->annotation_.begin(); it != descriptor->annotation_.end(); ++it) - { - AnnotationDescriptor* newDescriptor = new AnnotationDescriptor(*it); - annotation_.push_back(newDescriptor); - } - - kind_ = descriptor->kind_; - name_ = descriptor->name_; - base_type_ = descriptor->base_type_; - discriminator_type_ = descriptor->discriminator_type_; - bound_ = descriptor->bound_; - element_type_ = descriptor->element_type_; - key_element_type_ = descriptor->key_element_type_; - return eprosima::fastdds::dds::RETCODE_OK; - } - catch (std::exception& /*e*/) - { - return eprosima::fastdds::dds::RETCODE_ERROR; - } - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error copying TypeDescriptor, invalid input descriptor"); - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; - } -} - -bool TypeDescriptor::equals( - const TypeDescriptor* descriptor) const -{ - return descriptor != nullptr && name_ == descriptor->name_ && kind_ == descriptor->kind_ && - base_type_ == descriptor->base_type_ && discriminator_type_ == descriptor->discriminator_type_ && - bound_ == descriptor->bound_ && element_type_ == descriptor->element_type_ && - key_element_type_ == descriptor->key_element_type_; -} - -DynamicType_ptr TypeDescriptor::get_base_type() const -{ - return base_type_; -} - -uint32_t TypeDescriptor::get_bounds( - uint32_t index /*=0*/) const -{ - if (index < bound_.size()) - { - return bound_[index]; - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error getting bounds value. Index out of range."); - return BOUND_UNLIMITED; - } -} - -uint32_t TypeDescriptor::get_bounds_size() const -{ - return static_cast(bound_.size()); -} - -DynamicType_ptr TypeDescriptor::get_discriminator_type() const -{ - return discriminator_type_; -} - -DynamicType_ptr TypeDescriptor::get_element_type() const -{ - return element_type_; -} - -DynamicType_ptr TypeDescriptor::get_key_element_type() const -{ - return key_element_type_; -} - -TypeKind TypeDescriptor::get_kind() const -{ - return kind_; -} - -std::string TypeDescriptor::get_name() const -{ - return name_; -} - -uint32_t TypeDescriptor::get_total_bounds() const -{ - if (bound_.size() >= 1) - { - uint32_t bounds = 1; - for (uint32_t i = 0; i < bound_.size(); ++i) - { - bounds *= bound_[i]; - } - return bounds; - } - return BOUND_UNLIMITED; -} - -bool TypeDescriptor::is_consistent() const -{ - // Alias Types need the base type to indicate what type has been aliased. - if (kind_ == eprosima::fastdds::dds::xtypes::TK_ALIAS && base_type_ == nullptr) - { - return false; - } - - // Alias must have base type, and structures and bitsets optionally can have it. - if (base_type_ != nullptr && kind_ != eprosima::fastdds::dds::xtypes::TK_ALIAS && - kind_ != eprosima::fastdds::dds::xtypes::TK_STRUCTURE && - kind_ != eprosima::fastdds::dds::xtypes::TK_BITSET) - { - return false; - } - - // Arrays need one or more bound fields with the lenghts of each dimension. - if (kind_ == eprosima::fastdds::dds::xtypes::TK_ARRAY && bound_.size() == 0) - { - return false; - } - - // These types need one bound with the length of the field. - if (bound_.size() != 1 && - (kind_ == eprosima::fastdds::dds::xtypes::TK_SEQUENCE || - kind_ == eprosima::fastdds::dds::xtypes::TK_MAP || - kind_ == eprosima::fastdds::dds::xtypes::TK_BITMASK || - kind_ == eprosima::fastdds::dds::xtypes::TK_STRING8 || - kind_ == eprosima::fastdds::dds::xtypes::TK_STRING16)) - { - return false; - } - - // Only union types need the discriminator of the union - if ((discriminator_type_ == nullptr) == (kind_ == eprosima::fastdds::dds::xtypes::TK_UNION)) - { - return false; - } - - // ElementType is used by these types to set the "value" type of the element, otherwise it should be null. - if ((element_type_ == nullptr) == - (kind_ == eprosima::fastdds::dds::xtypes::TK_ARRAY || - kind_ == eprosima::fastdds::dds::xtypes::TK_SEQUENCE || - kind_ == eprosima::fastdds::dds::xtypes::TK_STRING8 || - kind_ == eprosima::fastdds::dds::xtypes::TK_STRING16 || kind_ == eprosima::fastdds::dds::xtypes::TK_MAP || - kind_ == eprosima::fastdds::dds::xtypes::TK_BITMASK)) - { - return false; - } - - // For Bitmask types is mandatory that this element is boolean. - if (kind_ == eprosima::fastdds::dds::xtypes::TK_BITMASK && - (element_type_->get_kind() != eprosima::fastdds::dds::xtypes::TK_BOOLEAN)) - { - return false; - } - - // Only map types need the keyElementType to store the "Key" type of the pair. - if ((key_element_type_ == nullptr) == (kind_ == eprosima::fastdds::dds::xtypes::TK_MAP)) - { - return false; - } - - if (!is_type_name_consistent(name_)) - { - return false; - } - - return true; -} - -bool TypeDescriptor::is_type_name_consistent( - const std::string& sName) -{ - // Implement an FSM string parser to deal with both a plain type name - // and a fully qualified name. According to the DDS xtypes standard, - // type's fully qualified name is a concatenation of module names with - // the name of a type inside of those modules. - int currState = INVALID; - for (uint32_t i = 0; i < sName.length(); ++i) - { - int col = 0; - if (std::isalpha(sName[i])) - { - col = LETTER; - } - else if (std::isdigit(sName[i])) - { - col = NUMBER; - } - else if (sName[i] == '_') - { - col = UNDERSCORE; - } - else if (sName[i] == ':') - { - col = COLON; - } - else - { - col = OTHER; - } - currState = stateTable[currState][col]; - if (currState == INVALID) - { - return false; - } - } - return true; -} - -void TypeDescriptor::set_kind( - TypeKind kind) -{ - kind_ = kind; -} - -void TypeDescriptor::set_name( - std::string name) -{ - name_ = name; -} - -ReturnCode_t TypeDescriptor::apply_annotation( - AnnotationDescriptor& descriptor) -{ - if (descriptor.is_consistent()) - { - AnnotationDescriptor* pNewDescriptor = new AnnotationDescriptor(); - pNewDescriptor->copy_from(&descriptor); - annotation_.push_back(pNewDescriptor); - return eprosima::fastdds::dds::RETCODE_OK; - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error applying annotation. The input descriptor isn't consistent."); - return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; - } -} - -ReturnCode_t TypeDescriptor::apply_annotation( - const std::string& annotation_name, - const std::string& key, - const std::string& value) -{ - AnnotationDescriptor* ann = get_annotation(annotation_name); - if (ann != nullptr) - { - ann->set_value(key, value); - } - else - { - AnnotationDescriptor* pNewDescriptor = new AnnotationDescriptor(); - pNewDescriptor->set_type( - DynamicTypeBuilderFactory::get_instance()->create_annotation_primitive(annotation_name)); - pNewDescriptor->set_value(key, value); - annotation_.push_back(pNewDescriptor); - } - return eprosima::fastdds::dds::RETCODE_OK; -} - -AnnotationDescriptor* TypeDescriptor::get_annotation( - const std::string& name) const -{ - auto it = annotation_.begin(); - - for (; it != annotation_.end(); ++it) - { - AnnotationDescriptor* ann = *it; - //if (ann->type()->get_name().compare(name) == 0) - if (ann != nullptr - && ann->type() != nullptr - && ann->type()->kind_ > 0 - && !ann->type()->get_name().empty() - && ann->type()->get_name().compare(name) == 0) - { - return ann; - } - } - return nullptr; -} - -// Annotations application -bool TypeDescriptor::annotation_is_extensibility() const -{ - return get_annotation(ANNOTATION_EXTENSIBILITY_ID) != nullptr; -} - -bool TypeDescriptor::annotation_is_mutable() const -{ - if (get_annotation(ANNOTATION_MUTABLE_ID) != nullptr) - { - return true; - } - else - { - AnnotationDescriptor* ann = get_annotation(ANNOTATION_EXTENSIBILITY_ID); - if (ann != nullptr) - { - std::string value; - if (ann->get_value(value) == eprosima::fastdds::dds::RETCODE_OK) - { - return value.compare(EXTENSIBILITY_MUTABLE) == 0; - } - } - } - return false; -} - -bool TypeDescriptor::annotation_is_final() const -{ - if (get_annotation(ANNOTATION_FINAL_ID) != nullptr) - { - return true; - } - else - { - AnnotationDescriptor* ann = get_annotation(ANNOTATION_EXTENSIBILITY_ID); - if (ann != nullptr) - { - std::string value; - if (ann->get_value(value) == eprosima::fastdds::dds::RETCODE_OK) - { - return value.compare(EXTENSIBILITY_FINAL) == 0; - } - } - } - return false; -} - -bool TypeDescriptor::annotation_is_appendable() const -{ - if (get_annotation(ANNOTATION_APPENDABLE_ID) != nullptr) - { - return true; - } - else - { - AnnotationDescriptor* ann = get_annotation(ANNOTATION_EXTENSIBILITY_ID); - if (ann != nullptr) - { - std::string value; - if (ann->get_value(value) == eprosima::fastdds::dds::RETCODE_OK) - { - return value.compare(EXTENSIBILITY_APPENDABLE) == 0; - } - } - } - return false; -} - -bool TypeDescriptor::annotation_is_nested() const -{ - return get_annotation(ANNOTATION_NESTED_ID) != nullptr; -} - -bool TypeDescriptor::annotation_is_bit_bound() const -{ - return get_annotation(ANNOTATION_BIT_BOUND_ID) != nullptr; -} - -bool TypeDescriptor::annotation_is_key() const -{ - return get_annotation(ANNOTATION_KEY_ID) != nullptr || get_annotation(ANNOTATION_EPKEY_ID) != nullptr; -} - -bool TypeDescriptor::annotation_is_non_serialized() const -{ - AnnotationDescriptor* ann = get_annotation(ANNOTATION_NON_SERIALIZED_ID); - if (ann != nullptr) - { - std::string value; - if (ann->get_value(value) == eprosima::fastdds::dds::RETCODE_OK) - { - return value == CONST_TRUE; - } - } - return false; -} - -// Annotation getters -std::string TypeDescriptor::annotation_get_extensibility() const -{ - AnnotationDescriptor* ann = get_annotation(ANNOTATION_EXTENSIBILITY_ID); - if (ann != nullptr) - { - std::string value; - if (ann->get_value(value) == eprosima::fastdds::dds::RETCODE_OK) - { - return value; - } - } - return ""; -} - -bool TypeDescriptor::annotation_get_nested() const -{ - AnnotationDescriptor* ann = get_annotation(ANNOTATION_NESTED_ID); - if (ann != nullptr) - { - std::string value; - if (ann->get_value(value) == eprosima::fastdds::dds::RETCODE_OK) - { - return value == CONST_TRUE; - } - } - return false; -} - -bool TypeDescriptor::annotation_get_key() const -{ - AnnotationDescriptor* ann = get_annotation(ANNOTATION_KEY_ID); - if (ann == nullptr) - { - ann = get_annotation(ANNOTATION_EPKEY_ID); - } - if (ann != nullptr) - { - std::string value; - if (ann->get_value(value) == eprosima::fastdds::dds::RETCODE_OK) - { - return value == CONST_TRUE; - } - } - return false; -} - -uint16_t TypeDescriptor::annotation_get_bit_bound() const -{ - AnnotationDescriptor* ann = get_annotation(ANNOTATION_BIT_BOUND_ID); - if (ann != nullptr) - { - std::string value; - if (ann->get_value(value) == eprosima::fastdds::dds::RETCODE_OK) - { - return static_cast(std::stoi(value)); - } - } - return 32; // Default value -} - -// Annotation setters -void TypeDescriptor::annotation_set_extensibility( - const std::string& extensibility) -{ - AnnotationDescriptor* ann = get_annotation(ANNOTATION_EXTENSIBILITY_ID); - if (ann == nullptr) - { - ann = new AnnotationDescriptor(); - ann->set_type( - DynamicTypeBuilderFactory::get_instance()->create_annotation_primitive(ANNOTATION_EXTENSIBILITY_ID)); - apply_annotation(*ann); - delete ann; - ann = get_annotation(ANNOTATION_EXTENSIBILITY_ID); - } - ann->set_value("value", extensibility); -} - -void TypeDescriptor::annotation_set_mutable() -{ - AnnotationDescriptor* ann = get_annotation(ANNOTATION_MUTABLE_ID); - if (ann == nullptr) - { - ann = new AnnotationDescriptor(); - ann->set_type(DynamicTypeBuilderFactory::get_instance()->create_annotation_primitive(ANNOTATION_MUTABLE_ID)); - apply_annotation(*ann); - delete ann; - ann = get_annotation(ANNOTATION_MUTABLE_ID); - } - ann->set_value("value", CONST_TRUE); -} - -void TypeDescriptor::annotation_set_final() -{ - AnnotationDescriptor* ann = get_annotation(ANNOTATION_FINAL_ID); - if (ann == nullptr) - { - ann = new AnnotationDescriptor(); - ann->set_type(DynamicTypeBuilderFactory::get_instance()->create_annotation_primitive(ANNOTATION_FINAL_ID)); - apply_annotation(*ann); - delete ann; - ann = get_annotation(ANNOTATION_FINAL_ID); - } - ann->set_value("value", CONST_TRUE); -} - -void TypeDescriptor::annotation_set_appendable() -{ - AnnotationDescriptor* ann = get_annotation(ANNOTATION_APPENDABLE_ID); - if (ann == nullptr) - { - ann = new AnnotationDescriptor(); - ann->set_type(DynamicTypeBuilderFactory::get_instance()->create_annotation_primitive(ANNOTATION_APPENDABLE_ID)); - apply_annotation(*ann); - delete ann; - ann = get_annotation(ANNOTATION_APPENDABLE_ID); - } - ann->set_value("value", CONST_TRUE); -} - -void TypeDescriptor::annotation_set_nested( - bool nested) -{ - AnnotationDescriptor* ann = get_annotation(ANNOTATION_NESTED_ID); - if (ann == nullptr) - { - ann = new AnnotationDescriptor(); - ann->set_type(DynamicTypeBuilderFactory::get_instance()->create_annotation_primitive(ANNOTATION_NESTED_ID)); - apply_annotation(*ann); - delete ann; - ann = get_annotation(ANNOTATION_NESTED_ID); - } - ann->set_value("value", nested ? CONST_TRUE : CONST_FALSE); -} - -void TypeDescriptor::annotation_set_key( - bool key) -{ - AnnotationDescriptor* ann = get_annotation(ANNOTATION_KEY_ID); - if (ann == nullptr) - { - ann = new AnnotationDescriptor(); - ann->set_type(DynamicTypeBuilderFactory::get_instance()->create_annotation_primitive(ANNOTATION_KEY_ID)); - apply_annotation(*ann); - delete ann; - ann = get_annotation(ANNOTATION_KEY_ID); - } - ann->set_value("value", key ? CONST_TRUE : CONST_FALSE); -} - -void TypeDescriptor::annotation_set_bit_bound( - uint16_t bit_bound) -{ - AnnotationDescriptor* ann = get_annotation(ANNOTATION_BIT_BOUND_ID); - if (ann == nullptr) - { - ann = new AnnotationDescriptor(); - ann->set_type(DynamicTypeBuilderFactory::get_instance()->create_annotation_primitive(ANNOTATION_BIT_BOUND_ID)); - apply_annotation(*ann); - delete ann; - ann = get_annotation(ANNOTATION_BIT_BOUND_ID); - } - ann->set_value("value", std::to_string(bit_bound)); -} - -void TypeDescriptor::annotation_set_non_serialized( - bool non_serialized) -{ - AnnotationDescriptor* ann = get_annotation(ANNOTATION_NON_SERIALIZED_ID); - if (ann == nullptr) - { - ann = new AnnotationDescriptor(); - ann->set_type( - DynamicTypeBuilderFactory::get_instance()->create_annotation_primitive(ANNOTATION_NON_SERIALIZED_ID)); - apply_annotation(*ann); - delete ann; - ann = get_annotation(ANNOTATION_NON_SERIALIZED_ID); - } - ann->set_value("value", non_serialized ? CONST_TRUE : CONST_FALSE); -} - -} // namespace types -} // namespace fastrtps -} // namespace eprosima diff --git a/src/cpp/fastdds/builtin/type_lookup_service/TypeLookupRequestListener.cpp b/src/cpp/fastdds/builtin/type_lookup_service/TypeLookupRequestListener.cpp index a1b1ec5921e..dfe39fcb5f8 100644 --- a/src/cpp/fastdds/builtin/type_lookup_service/TypeLookupRequestListener.cpp +++ b/src/cpp/fastdds/builtin/type_lookup_service/TypeLookupRequestListener.cpp @@ -80,7 +80,7 @@ void TypeLookupRequestListener::onNewCacheChangeAdded( // const TypeIdentifier* obj_ident = factory_->typelookup_get_type(type_id, obj); xtypes::TypeIdentifier* obj_ident = nullptr; - if (obj_ident != nullptr && obj._d() != 0) + if (obj_ident != nullptr && obj._d() != fastdds::dds::xtypes::TK_NONE) { xtypes::TypeIdentifierTypeObjectPair pair; pair.type_identifier(type_id); diff --git a/src/cpp/fastdds/core/condition/WaitSetImpl.cpp b/src/cpp/fastdds/core/condition/WaitSetImpl.cpp index ae4e9e091de..5c4e43600a7 100644 --- a/src/cpp/fastdds/core/condition/WaitSetImpl.cpp +++ b/src/cpp/fastdds/core/condition/WaitSetImpl.cpp @@ -21,9 +21,9 @@ #include #include +#include #include #include -#include #include diff --git a/src/cpp/fastdds/domain/DomainParticipantFactory.cpp b/src/cpp/fastdds/domain/DomainParticipantFactory.cpp index bf4b79feb89..34e6d30d3f8 100644 --- a/src/cpp/fastdds/domain/DomainParticipantFactory.cpp +++ b/src/cpp/fastdds/domain/DomainParticipantFactory.cpp @@ -24,11 +24,11 @@ #include #include #include +#include +#include #include #include #include -#include -#include #include #include @@ -77,8 +77,8 @@ DomainParticipantFactory::~DomainParticipantFactory() } // Deletes DynamicTypes and TypeObject factories - fastrtps::types::DynamicTypeBuilderFactory::delete_instance(); - fastrtps::types::DynamicDataFactory::delete_instance(); + fastdds::dds::DynamicDataFactory::delete_instance(); + fastdds::dds::DynamicTypeBuilderFactory::delete_instance(); std::this_thread::sleep_for(std::chrono::milliseconds(100)); eprosima::fastdds::dds::Log::KillThread(); @@ -504,14 +504,13 @@ ReturnCode_t DomainParticipantFactory::set_library_settings( ReturnCode_t DomainParticipantFactory::get_dynamic_type_builder_from_xml_by_name( const std::string& type_name, - fastrtps::types::DynamicTypeBuilder*& type) + DynamicType::_ref_type& type) { if (type_name.empty()) { return RETCODE_BAD_PARAMETER; } - type = XMLProfileManager::getDynamicTypeByName(type_name); - if (nullptr == type) + if (XMLP_ret::XML_OK != XMLProfileManager::getDynamicTypeByName(type, type_name)) { return RETCODE_NO_DATA; } diff --git a/src/cpp/fastdds/domain/DomainParticipantImpl.cpp b/src/cpp/fastdds/domain/DomainParticipantImpl.cpp index f2d3af85d0a..bbfb4ec9ad2 100644 --- a/src/cpp/fastdds/domain/DomainParticipantImpl.cpp +++ b/src/cpp/fastdds/domain/DomainParticipantImpl.cpp @@ -39,6 +39,8 @@ #include #include #include +#include +#include #include #include #include @@ -51,10 +53,6 @@ #include #include #include -#include -#include -#include -#include #include #include @@ -1579,9 +1577,9 @@ ResourceEvent& DomainParticipantImpl::get_resource_event() const } ReturnCode_t DomainParticipantImpl::register_dynamic_type( - fastrtps::types::DynamicType_ptr dyn_type) + DynamicType::_ref_type dyn_type) { - TypeSupport type(new fastrtps::types::DynamicPubSubType(dyn_type)); + TypeSupport type(new DynamicPubSubType(dyn_type)); return get_participant()->register_type(type); } diff --git a/src/cpp/fastdds/domain/DomainParticipantImpl.hpp b/src/cpp/fastdds/domain/DomainParticipantImpl.hpp index b8713be75f6..8b5c3adf01a 100644 --- a/src/cpp/fastdds/domain/DomainParticipantImpl.hpp +++ b/src/cpp/fastdds/domain/DomainParticipantImpl.hpp @@ -25,25 +25,24 @@ #include #include -#include -#include -#include - +#include +#include +#include #include #include -#include #include #include #include #include - #include -#include -#include +#include +#include +#include #include "fastdds/topic/DDSSQLFilter/DDSFilterFactory.hpp" #include + namespace eprosima { namespace fastrtps { @@ -659,7 +658,7 @@ class DomainParticipantImpl InstanceHandle_t& handle); ReturnCode_t register_dynamic_type( - fastrtps::types::DynamicType_ptr dyn_type); + DynamicType::_ref_type dyn_type); virtual PublisherImpl* create_publisher_impl( const PublisherQos& qos, diff --git a/src/cpp/fastdds/log/CMakeLists.txt b/src/cpp/fastdds/log/CMakeLists.txt new file mode 100644 index 00000000000..049b5c622ba --- /dev/null +++ b/src/cpp/fastdds/log/CMakeLists.txt @@ -0,0 +1,39 @@ +# Copyright 2024 Proyectos y Sistemas de Mantenimiento SL (eProsima). +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +#{{{ Interface library for grouping the Log source code + +add_library(fastdds-log INTERFACE) + +add_library(fastdds::log ALIAS fastdds-log) + +target_compile_features(fastdds-log INTERFACE cxx_std_11) + +target_sources(fastdds-log INTERFACE + ${PROJECT_SOURCE_DIR}/include/fastdds/dds/log/Colors.hpp + ${PROJECT_SOURCE_DIR}/include/fastdds/dds/log/FileConsumer.hpp + ${PROJECT_SOURCE_DIR}/include/fastdds/dds/log/Log.hpp + ${PROJECT_SOURCE_DIR}/include/fastdds/dds/log/OStreamConsumer.hpp + ${PROJECT_SOURCE_DIR}/include/fastdds/dds/log/StdoutConsumer.hpp + ${PROJECT_SOURCE_DIR}/include/fastdds/dds/log/StdoutErrConsumer.hpp + + FileConsumer.cpp + Log.cpp + LogResources.hpp + OStreamConsumer.cpp + StdoutConsumer.cpp + StdoutErrConsumer.cpp + ) + +#}}} diff --git a/src/cpp/fastdds/log/Log.cpp b/src/cpp/fastdds/log/Log.cpp index 9063fd4efb9..38ae28e4063 100644 --- a/src/cpp/fastdds/log/Log.cpp +++ b/src/cpp/fastdds/log/Log.cpp @@ -115,6 +115,13 @@ struct LogResources category_filter_.reset(new std::regex(filter)); } + //! Returns a copy of the current category filter or an empty object otherwise + std::regex GetCategoryFilter() + { + std::unique_lock configGuard(config_mutex_); + return category_filter_ ? *category_filter_ : std::regex{}; + } + //! Sets a filter that will pattern-match against filenames_, dropping any unmatched categories. void SetFilenameFilter( const std::regex& filter) @@ -123,6 +130,13 @@ struct LogResources filename_filter_.reset(new std::regex(filter)); } + //! Returns a copy of the current filename filter or an empty object otherwise + std::regex GetFilenameFilter() + { + std::unique_lock configGuard(config_mutex_); + return filename_filter_ ? *filename_filter_: std::regex{}; + } + //! Sets a filter that will pattern-match against the provided error string, dropping any unmatched categories. void SetErrorStringFilter( const std::regex& filter) @@ -139,6 +153,13 @@ struct LogResources thread_settings_ = config; } + //! Returns a copy of the current filename filter or an empty object otherwise + std::regex GetErrorStringFilter() + { + std::unique_lock configGuard(config_mutex_); + return error_string_filter_ ? *error_string_filter_: std::regex{}; + } + //! Returns the logging_ engine to configuration defaults. void Reset() { @@ -453,6 +474,21 @@ void Log::SetThreadConfig( detail::get_log_resources()->SetThreadConfig(config); } +std::regex Log::GetCategoryFilter() +{ + return detail::get_log_resources()->GetCategoryFilter(); +} + +std::regex Log::GetFilenameFilter() +{ + return detail::get_log_resources()->GetFilenameFilter(); +} + +std::regex Log::GetErrorStringFilter() +{ + return detail::get_log_resources()->GetErrorStringFilter(); +} + void LogConsumer::print_timestamp( std::ostream& stream, const Log::Entry& entry, diff --git a/src/cpp/fastdds/publisher/DataWriterImpl.hpp b/src/cpp/fastdds/publisher/DataWriterImpl.hpp index 2c197ad43a1..4d107d47c71 100644 --- a/src/cpp/fastdds/publisher/DataWriterImpl.hpp +++ b/src/cpp/fastdds/publisher/DataWriterImpl.hpp @@ -21,6 +21,7 @@ #include +#include #include #include #include @@ -37,7 +38,6 @@ #include #include #include -#include #include #include diff --git a/src/cpp/fastdds/publisher/PublisherImpl.hpp b/src/cpp/fastdds/publisher/PublisherImpl.hpp index 7e24c53e0d4..44caae68e6b 100644 --- a/src/cpp/fastdds/publisher/PublisherImpl.hpp +++ b/src/cpp/fastdds/publisher/PublisherImpl.hpp @@ -25,13 +25,13 @@ #include #include +#include #include #include #include #include #include #include -#include #ifdef FASTDDS_STATISTICS #include diff --git a/src/cpp/fastdds/subscriber/DataReaderImpl.hpp b/src/cpp/fastdds/subscriber/DataReaderImpl.hpp index 6f6bca0880c..89a238ad991 100644 --- a/src/cpp/fastdds/subscriber/DataReaderImpl.hpp +++ b/src/cpp/fastdds/subscriber/DataReaderImpl.hpp @@ -23,6 +23,7 @@ #include +#include #include #include #include @@ -38,7 +39,6 @@ #include #include #include -#include #include #include diff --git a/src/cpp/fastdds/subscriber/DataReaderImpl/ReadTakeCommand.hpp b/src/cpp/fastdds/subscriber/DataReaderImpl/ReadTakeCommand.hpp index 6599e690f6f..d13487c7754 100644 --- a/src/cpp/fastdds/subscriber/DataReaderImpl/ReadTakeCommand.hpp +++ b/src/cpp/fastdds/subscriber/DataReaderImpl/ReadTakeCommand.hpp @@ -22,13 +22,12 @@ #include #include +#include #include #include #include #include -#include - #include #include #include diff --git a/src/cpp/fastdds/subscriber/DataReaderImpl/SampleInfoPool.hpp b/src/cpp/fastdds/subscriber/DataReaderImpl/SampleInfoPool.hpp index efd7c394544..2ca3d9881c7 100644 --- a/src/cpp/fastdds/subscriber/DataReaderImpl/SampleInfoPool.hpp +++ b/src/cpp/fastdds/subscriber/DataReaderImpl/SampleInfoPool.hpp @@ -27,7 +27,6 @@ #include #include -#include #include #include diff --git a/src/cpp/fastdds/subscriber/DataReaderImpl/SampleLoanManager.hpp b/src/cpp/fastdds/subscriber/DataReaderImpl/SampleLoanManager.hpp index 37ca6a40fba..0e0c3fd5fce 100644 --- a/src/cpp/fastdds/subscriber/DataReaderImpl/SampleLoanManager.hpp +++ b/src/cpp/fastdds/subscriber/DataReaderImpl/SampleLoanManager.hpp @@ -29,7 +29,6 @@ #include #include -#include #include #include diff --git a/src/cpp/fastdds/topic/ContentFilteredTopicImpl.cpp b/src/cpp/fastdds/topic/ContentFilteredTopicImpl.cpp index 0ea6a2b2f6b..42e1b53e365 100644 --- a/src/cpp/fastdds/topic/ContentFilteredTopicImpl.cpp +++ b/src/cpp/fastdds/topic/ContentFilteredTopicImpl.cpp @@ -21,6 +21,7 @@ #include #include +#include #include #include #include @@ -29,7 +30,6 @@ #include #include -#include #include namespace eprosima { diff --git a/src/cpp/fastdds/topic/ContentFilteredTopicImpl.hpp b/src/cpp/fastdds/topic/ContentFilteredTopicImpl.hpp index f76a469312a..897854e7cae 100644 --- a/src/cpp/fastdds/topic/ContentFilteredTopicImpl.hpp +++ b/src/cpp/fastdds/topic/ContentFilteredTopicImpl.hpp @@ -24,6 +24,7 @@ #include #include +#include #include #include #include diff --git a/src/cpp/fastdds/topic/DDSSQLFilter/DDSFilterExpression.cpp b/src/cpp/fastdds/topic/DDSSQLFilter/DDSFilterExpression.cpp index a52450936dd..f516e5ad0a8 100644 --- a/src/cpp/fastdds/topic/DDSSQLFilter/DDSFilterExpression.cpp +++ b/src/cpp/fastdds/topic/DDSSQLFilter/DDSFilterExpression.cpp @@ -15,7 +15,6 @@ /** * @file DDSFilterExpression.cpp */ - #include "DDSFilterExpression.hpp" #include @@ -23,17 +22,15 @@ #include #include -#include -#include -#include -#include - #include #include #include -#include "DDSFilterCondition.hpp" +#include +#include +#include +#include "DDSFilterConditionState.hpp" #include "DDSFilterField.hpp" #include "DDSFilterParameter.hpp" @@ -76,7 +73,7 @@ bool DDSFilterExpression::evaluate( it != fields.end() && DDSFilterConditionState::UNDECIDED == root->get_state(); ++it) { - if (!it->second->set_value(*dyn_data_)) + if (!it->second->set_value(dyn_data_)) { return false; } @@ -87,21 +84,21 @@ bool DDSFilterExpression::evaluate( void DDSFilterExpression::clear() { - dyn_data_.reset(); - dyn_type_.reset(); + DynamicDataFactory::get_instance()->delete_data(dyn_data_); + DynamicTypeBuilderFactory::get_instance()->delete_type(dyn_type_); parameters.clear(); fields.clear(); root.reset(); } void DDSFilterExpression::set_type( - const eprosima::fastrtps::types::DynamicType_ptr& type) + DynamicType::_ref_type type) { dyn_type_ = type; - dyn_data_.reset(eprosima::fastrtps::types::DynamicDataFactory::get_instance()->create_data(type)); + dyn_data_ = traits::narrow(DynamicDataFactory::get_instance()->create_data(type)); } -} // namespace DDSSQLFilter -} // namespace dds -} // namespace fastdds -} // namespace eprosima +} // namespace DDSSQLFilter +} // namespace dds +} // namespace fastdds +} // namespace eprosima diff --git a/src/cpp/fastdds/topic/DDSSQLFilter/DDSFilterExpression.hpp b/src/cpp/fastdds/topic/DDSSQLFilter/DDSFilterExpression.hpp index 00bd1eebed6..10462a5b9c6 100644 --- a/src/cpp/fastdds/topic/DDSSQLFilter/DDSFilterExpression.hpp +++ b/src/cpp/fastdds/topic/DDSSQLFilter/DDSFilterExpression.hpp @@ -25,14 +25,15 @@ #include #include -#include -#include -#include +#include +#include #include "DDSFilterCondition.hpp" #include "DDSFilterField.hpp" #include "DDSFilterParameter.hpp" +#include "../../xtypes/dynamic_types/DynamicDataImpl.hpp" + namespace eprosima { namespace fastdds { namespace dds { @@ -62,7 +63,7 @@ class DDSFilterExpression final : public IContentFilter * @param [in] type The DynamicType to assign. */ void set_type( - const eprosima::fastrtps::types::DynamicType_ptr& type); + DynamicType::_ref_type type); /// The root condition of the expression tree. std::unique_ptr root; @@ -73,23 +74,10 @@ class DDSFilterExpression final : public IContentFilter private: - class DynDataDeleter - { - - public: - - void operator ()( - eprosima::fastrtps::types::DynamicData* ptr) - { - eprosima::fastrtps::types::DynamicDataFactory::get_instance()->delete_data(ptr); - } - - }; - /// The Dynamic type used to deserialize the payloads - eprosima::fastrtps::types::DynamicType_ptr dyn_type_; + DynamicType::_ref_type dyn_type_; /// The Dynamic data used to deserialize the payloads - std::unique_ptr dyn_data_; + traits::ref_type dyn_data_; }; } // namespace DDSSQLFilter diff --git a/src/cpp/fastdds/topic/DDSSQLFilter/DDSFilterExpressionParser.cpp b/src/cpp/fastdds/topic/DDSSQLFilter/DDSFilterExpressionParser.cpp index 746b5bfe9bb..810874d2344 100644 --- a/src/cpp/fastdds/topic/DDSSQLFilter/DDSFilterExpressionParser.cpp +++ b/src/cpp/fastdds/topic/DDSSQLFilter/DDSFilterExpressionParser.cpp @@ -15,7 +15,6 @@ /** * @file DDSFilterExpressionParser.cpp */ - #include "DDSFilterExpressionParser.hpp" #include @@ -27,11 +26,10 @@ #include "pegtl.hpp" #include "pegtl/contrib/parse_tree.hpp" +#include "DDSFilterField.hpp" #include "DDSFilterGrammar.hpp" #include "DDSFilterParseNode.hpp" - #include "DDSFilterValue.hpp" -#include "DDSFilterField.hpp" namespace eprosima { namespace fastdds { diff --git a/src/cpp/fastdds/topic/DDSSQLFilter/DDSFilterExpressionParserImpl/identifiers.hpp b/src/cpp/fastdds/topic/DDSSQLFilter/DDSFilterExpressionParserImpl/identifiers.hpp index 4bb26f1f996..db8e0bd2bf3 100644 --- a/src/cpp/fastdds/topic/DDSSQLFilter/DDSFilterExpressionParserImpl/identifiers.hpp +++ b/src/cpp/fastdds/topic/DDSSQLFilter/DDSFilterExpressionParserImpl/identifiers.hpp @@ -76,9 +76,11 @@ struct identifier_processor out_type = ti.seq_ldefn().element_identifier().get(); max_size = process_bound(ti.seq_ldefn().bound()); return true; + + default: + out_type = &ti; } - out_type = &ti; return false; } @@ -141,59 +143,68 @@ struct identifier_processor const TypeIdentifier& ti, const position& pos) { + DDSFilterValue::ValueKind res{ DDSFilterValue::ValueKind::BOOLEAN}; + switch (ti._d()) { case eprosima::fastdds::dds::xtypes::TK_BOOLEAN: - return DDSFilterValue::ValueKind::BOOLEAN; - + res = DDSFilterValue::ValueKind::BOOLEAN; + break; case eprosima::fastdds::dds::xtypes::TK_CHAR8: - return DDSFilterValue::ValueKind::CHAR; - + res = DDSFilterValue::ValueKind::CHAR; + break; case eprosima::fastdds::dds::xtypes::TK_STRING8: case TI_STRING8_SMALL: case TI_STRING8_LARGE: - return DDSFilterValue::ValueKind::STRING; + res = DDSFilterValue::ValueKind::STRING; + break; case eprosima::fastdds::dds::xtypes::TK_INT8: case eprosima::fastdds::dds::xtypes::TK_INT16: case eprosima::fastdds::dds::xtypes::TK_INT32: case eprosima::fastdds::dds::xtypes::TK_INT64: - return DDSFilterValue::ValueKind::SIGNED_INTEGER; - + res = DDSFilterValue::ValueKind::SIGNED_INTEGER; + break; case eprosima::fastdds::dds::xtypes::TK_BYTE: case eprosima::fastdds::dds::xtypes::TK_UINT8: case eprosima::fastdds::dds::xtypes::TK_UINT16: case eprosima::fastdds::dds::xtypes::TK_UINT32: case eprosima::fastdds::dds::xtypes::TK_UINT64: - return DDSFilterValue::ValueKind::UNSIGNED_INTEGER; - + res = DDSFilterValue::ValueKind::UNSIGNED_INTEGER; + break; case eprosima::fastdds::dds::xtypes::TK_FLOAT32: - return DDSFilterValue::ValueKind::FLOAT_FIELD; - + res = DDSFilterValue::ValueKind::FLOAT_FIELD; + break; case eprosima::fastdds::dds::xtypes::TK_FLOAT64: - return DDSFilterValue::ValueKind::DOUBLE_FIELD; - + res = DDSFilterValue::ValueKind::DOUBLE_FIELD; + break; case eprosima::fastdds::dds::xtypes::TK_FLOAT128: - return DDSFilterValue::ValueKind::LONG_DOUBLE_FIELD; - + res = DDSFilterValue::ValueKind::LONG_DOUBLE_FIELD; + break; case EK_COMPLETE: + { TypeObject type_object; DomainParticipantFactory::get_instance()->type_object_registry().get_type_object(ti, type_object); if (eprosima::fastdds::dds::xtypes::TK_ENUM == type_object.complete()._d()) { - return DDSFilterValue::ValueKind::ENUM; + res = DDSFilterValue::ValueKind::ENUM; + break; } if (eprosima::fastdds::dds::xtypes::TK_ALIAS == type_object.complete()._d()) { const TypeIdentifier& aliasedId = type_object.complete().alias_type().body().common().related_type(); - return get_value_kind(aliasedId, pos); + res = get_value_kind(aliasedId, pos); } - break; + } + break; + default: + throw parse_error("type is not primitive", pos); + break; } - throw parse_error("type is not primitive", pos); + return res; } template< typename ... States > diff --git a/src/cpp/fastdds/topic/DDSSQLFilter/DDSFilterFactory.cpp b/src/cpp/fastdds/topic/DDSSQLFilter/DDSFilterFactory.cpp index 0dea8c3da5a..8a045c15b6b 100644 --- a/src/cpp/fastdds/topic/DDSSQLFilter/DDSFilterFactory.cpp +++ b/src/cpp/fastdds/topic/DDSSQLFilter/DDSFilterFactory.cpp @@ -26,6 +26,8 @@ #include #include #include +#include +#include #include #include @@ -531,7 +533,7 @@ ReturnCode_t DDSFilterFactory::create_content_filter( if (node) { // TODO(XTypes): PENDING implementation DynamicTypeBuilderFactory::create_type_w_type_object - eprosima::fastrtps::types::DynamicType_ptr dyn_type; //= TypeObjectFactory::get_instance()->build_dynamic_type(type_name, type_id, type_object); + DynamicType::_ref_type dyn_type; //= TypeObjectFactory::get_instance()->build_dynamic_type(type_name, type_id, type_object); DDSFilterExpression* expr = get_expression(); expr->set_type(dyn_type); size_t n_params = filter_parameters.length(); diff --git a/src/cpp/fastdds/topic/DDSSQLFilter/DDSFilterField.cpp b/src/cpp/fastdds/topic/DDSSQLFilter/DDSFilterField.cpp index cf60bcf4f66..ebe82c8fec2 100644 --- a/src/cpp/fastdds/topic/DDSSQLFilter/DDSFilterField.cpp +++ b/src/cpp/fastdds/topic/DDSSQLFilter/DDSFilterField.cpp @@ -23,9 +23,9 @@ #include #include +#include #include #include -#include #include "DDSFilterPredicate.hpp" #include "DDSFilterValue.hpp" @@ -36,54 +36,52 @@ namespace dds { namespace DDSSQLFilter { bool DDSFilterField::set_value( - eprosima::fastrtps::types::DynamicData& data, + DynamicData::_ref_type data, size_t n) { - using namespace eprosima::fastrtps::types; - uint32_t index = static_cast(access_path_[n].member_index); - auto member_id = data.get_member_id_at_index(index); + auto member_id = data->get_member_id_at_index(index); bool last_step = access_path_.size() - 1 == n; bool ret = false; - if (access_path_[n].array_index < MEMBER_ID_INVALID) + if (access_path_[n].array_index != MEMBER_ID_INVALID) { - DynamicData* array_data = data.loan_value(member_id); - if (nullptr != array_data) + DynamicData::_ref_type array_data = data->loan_value(member_id); + if (array_data) { member_id = static_cast(access_path_[n].array_index); if (array_data->get_item_count() > member_id) { if (last_step) { - ret = set_value(array_data, member_id); + ret = set_value_using_member_id(array_data, member_id); } else { - DynamicData* struct_data = array_data->loan_value(member_id); - if (nullptr != struct_data) + DynamicData::_ref_type struct_data = array_data->loan_value(member_id); + if (struct_data) { - ret = set_value(*struct_data, n + 1); + ret = set_value(struct_data, n + 1); array_data->return_loaned_value(struct_data); } } } - data.return_loaned_value(array_data); + data->return_loaned_value(array_data); } } else { if (last_step) { - ret = set_value(&data, member_id); + ret = set_value_using_member_id(data, member_id); } else { - DynamicData* struct_data = data.loan_value(member_id); - if (nullptr != struct_data) + DynamicData::_ref_type struct_data = data->loan_value(member_id); + if (struct_data) { - ret = set_value(*struct_data, n + 1); - data.return_loaned_value(struct_data); + ret = set_value(struct_data, n + 1); + data->return_loaned_value(struct_data); } } } @@ -103,98 +101,113 @@ bool DDSFilterField::set_value( return ret; } -bool DDSFilterField::set_value( - const eprosima::fastrtps::types::DynamicData* data, - eprosima::fastrtps::types::MemberId member_id) +bool DDSFilterField::set_value_using_member_id( + DynamicData::_ref_type data, + MemberId member_id) { - using namespace eprosima::fastrtps::types; - - bool ret = true; - try + bool ret = false; + switch (type_id_->_d()) { - switch (type_id_->_d()) + case eprosima::fastdds::dds::xtypes::TK_BOOLEAN: + ret = RETCODE_OK == data->get_boolean_value(boolean_value, member_id); + break; + + case eprosima::fastdds::dds::xtypes::TK_CHAR8: + ret = RETCODE_OK == data->get_char8_value(char_value, member_id); + break; + + case eprosima::fastdds::dds::xtypes::TK_STRING8: + case eprosima::fastdds::dds::xtypes::TI_STRING8_SMALL: + case eprosima::fastdds::dds::xtypes::TI_STRING8_LARGE: { - case eprosima::fastdds::dds::xtypes::TK_BOOLEAN: - boolean_value = data->get_bool_value(member_id); - break; - - case eprosima::fastdds::dds::xtypes::TK_CHAR8: - char_value = data->get_char8_value(member_id); - break; - - case eprosima::fastdds::dds::xtypes::TK_STRING8: - case eprosima::fastdds::dds::xtypes::TI_STRING8_SMALL: - case eprosima::fastdds::dds::xtypes::TI_STRING8_LARGE: - string_value = data->get_string_value(member_id); - break; - - case eprosima::fastdds::dds::xtypes::TK_INT8: - signed_integer_value = data->get_int8_value(member_id); - break; - - case eprosima::fastdds::dds::xtypes::TK_INT16: - signed_integer_value = data->get_int16_value(member_id); - break; - - case eprosima::fastdds::dds::xtypes::TK_INT32: - signed_integer_value = data->get_int32_value(member_id); - break; - - case eprosima::fastdds::dds::xtypes::TK_INT64: - signed_integer_value = data->get_int64_value(member_id); - break; - - case eprosima::fastdds::dds::xtypes::TK_BYTE: - case eprosima::fastdds::dds::xtypes::TK_UINT8: - unsigned_integer_value = data->get_uint8_value(member_id); - break; - - case eprosima::fastdds::dds::xtypes::TK_UINT16: - unsigned_integer_value = data->get_uint16_value(member_id); - break; - - case eprosima::fastdds::dds::xtypes::TK_UINT32: - unsigned_integer_value = data->get_uint32_value(member_id); - break; - - case eprosima::fastdds::dds::xtypes::TK_UINT64: - unsigned_integer_value = data->get_uint64_value(member_id); - break; - - case eprosima::fastdds::dds::xtypes::TK_FLOAT32: - float_value = data->get_float32_value(member_id); - break; - - case eprosima::fastdds::dds::xtypes::TK_FLOAT64: - float_value = data->get_float64_value(member_id); - break; - - case eprosima::fastdds::dds::xtypes::TK_FLOAT128: - float_value = data->get_float128_value(member_id); - break; - - case eprosima::fastdds::dds::xtypes::EK_COMPLETE: - { - uint32_t enum_value; - ret = RETCODE_OK == data->get_enum_value(enum_value, member_id); - signed_integer_value = enum_value; - break; - } + } + break; - default: - ret = false; - break; + case eprosima::fastdds::dds::xtypes::TK_INT16: + { + int16_t value16 {0}; + ret = RETCODE_OK == data->get_int16_value(value16, member_id); + signed_integer_value = value16; } - } - catch (...) - { - ret = false; + break; + + case eprosima::fastdds::dds::xtypes::TK_INT32: + { + int32_t value32 {0}; + ret = RETCODE_OK == data->get_int32_value(value32, member_id); + signed_integer_value = value32; + } + break; + + case eprosima::fastdds::dds::xtypes::TK_INT64: + ret = RETCODE_OK == data->get_int64_value(signed_integer_value, member_id); + break; + + case eprosima::fastdds::dds::xtypes::TK_BYTE: + { + uint8_t valueu8 {0}; + ret = RETCODE_OK == data->get_uint8_value(valueu8, member_id); + unsigned_integer_value = valueu8; + } + break; + + case eprosima::fastdds::dds::xtypes::TK_UINT16: + { + uint16_t valueu16 {0}; + ret = RETCODE_OK == data->get_uint16_value(valueu16, member_id); + unsigned_integer_value = valueu16; + } + break; + + case eprosima::fastdds::dds::xtypes::TK_UINT32: + { + uint32_t valueu32 {0}; + ret = RETCODE_OK == data->get_uint32_value(valueu32, member_id); + unsigned_integer_value = valueu32; + } + break; + + case eprosima::fastdds::dds::xtypes::TK_UINT64: + ret = RETCODE_OK == data->get_uint64_value(unsigned_integer_value, member_id); + break; + + case eprosima::fastdds::dds::xtypes::TK_FLOAT32: + { + float valuef32 {0}; + ret = RETCODE_OK == data->get_float32_value(valuef32, member_id); + float_value = valuef32; + } + break; + + case eprosima::fastdds::dds::xtypes::TK_FLOAT64: + { + double valuef64 {0}; + ret = RETCODE_OK == data->get_float64_value(valuef64, member_id); + float_value = valuef64; + } + break; + + case eprosima::fastdds::dds::xtypes::TK_FLOAT128: + ret = RETCODE_OK == data->get_float128_value(float_value, member_id); + break; + + case eprosima::fastdds::dds::xtypes::EK_COMPLETE: + { + uint32_t valueenum {0}; + ret = RETCODE_OK == data->get_uint32_value(valueenum, member_id); + signed_integer_value = valueenum; + break; + } + + default: + break; } return ret; } } // namespace DDSSQLFilter + } // namespace dds } // namespace fastdds } // namespace eprosima diff --git a/src/cpp/fastdds/topic/DDSSQLFilter/DDSFilterField.hpp b/src/cpp/fastdds/topic/DDSSQLFilter/DDSFilterField.hpp index 20e85700ca7..8304a45c98e 100644 --- a/src/cpp/fastdds/topic/DDSSQLFilter/DDSFilterField.hpp +++ b/src/cpp/fastdds/topic/DDSSQLFilter/DDSFilterField.hpp @@ -24,9 +24,9 @@ #include #include +#include #include #include -#include #include "DDSFilterPredicate.hpp" #include "DDSFilterValue.hpp" @@ -104,7 +104,7 @@ class DDSFilterField final : public DDSFilterValue * @post Method @c has_value returns true. */ inline bool set_value( - eprosima::fastrtps::types::DynamicData& data_value) + DynamicData::_ref_type data_value) { return set_value(data_value, 0); } @@ -120,7 +120,7 @@ class DDSFilterField final : public DDSFilterValue * @post Method @c has_value returns true. */ bool set_value( - eprosima::fastrtps::types::DynamicData& data, + DynamicData::_ref_type data, size_t n); protected: @@ -134,9 +134,9 @@ class DDSFilterField final : public DDSFilterValue private: - bool set_value( - const eprosima::fastrtps::types::DynamicData* data, - eprosima::fastrtps::types::MemberId member_id); + bool set_value_using_member_id( + DynamicData::_ref_type data, + MemberId member_id); bool has_value_ = false; std::vector access_path_; diff --git a/src/cpp/fastdds/topic/TopicImpl.hpp b/src/cpp/fastdds/topic/TopicImpl.hpp index 157ce0564d2..b07c79fae64 100644 --- a/src/cpp/fastdds/topic/TopicImpl.hpp +++ b/src/cpp/fastdds/topic/TopicImpl.hpp @@ -21,11 +21,11 @@ #define _FASTDDS_TOPICIMPL_HPP_ #ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC +#include #include #include #include #include -#include namespace eprosima { namespace fastdds { diff --git a/src/cpp/fastdds/xtypes/CMakeLists.txt b/src/cpp/fastdds/xtypes/CMakeLists.txt new file mode 100644 index 00000000000..79f2199205e --- /dev/null +++ b/src/cpp/fastdds/xtypes/CMakeLists.txt @@ -0,0 +1,114 @@ +# Copyright 2024 Proyectos y Sistemas de Mantenimiento SL (eProsima). +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +#{{{ Interface library for grouping the Dynamic Language Binding source code. + +#{{{ API + +add_library(fastdds-xtypes-dynamic-types-api INTERFACE) + +add_library(fastdds::xtypes::dynamic-types::api ALIAS fastdds-xtypes-dynamic-types-api) + +target_compile_features(fastdds-xtypes-dynamic-types-api INTERFACE cxx_std_11) + +target_sources(fastdds-xtypes-dynamic-types-api INTERFACE + ${PROJECT_SOURCE_DIR}/include/fastdds/dds/xtypes/dynamic_types/AnnotationDescriptor.hpp + ${PROJECT_SOURCE_DIR}/include/fastdds/dds/xtypes/dynamic_types/DynamicData.hpp + ${PROJECT_SOURCE_DIR}/include/fastdds/dds/xtypes/dynamic_types/DynamicDataFactory.hpp + ${PROJECT_SOURCE_DIR}/include/fastdds/dds/xtypes/dynamic_types/DynamicType.hpp + ${PROJECT_SOURCE_DIR}/include/fastdds/dds/xtypes/dynamic_types/DynamicTypeBuilder.hpp + ${PROJECT_SOURCE_DIR}/include/fastdds/dds/xtypes/dynamic_types/DynamicTypeBuilderFactory.hpp + ${PROJECT_SOURCE_DIR}/include/fastdds/dds/xtypes/dynamic_types/DynamicTypeMember.hpp + ${PROJECT_SOURCE_DIR}/include/fastdds/dds/xtypes/dynamic_types/MemberDescriptor.hpp + ${PROJECT_SOURCE_DIR}/include/fastdds/dds/xtypes/dynamic_types/type_traits.hpp + ${PROJECT_SOURCE_DIR}/include/fastdds/dds/xtypes/dynamic_types/TypeDescriptor.hpp + ${PROJECT_SOURCE_DIR}/include/fastdds/dds/xtypes/dynamic_types/Types.hpp + ${PROJECT_SOURCE_DIR}/include/fastdds/dds/xtypes/dynamic_types/VerbatimTextDescriptor.hpp + + ${PROJECT_SOURCE_DIR}/include/fastdds/dds/xtypes/dynamic_types/detail/dynamic_language_binding.hpp + ${PROJECT_SOURCE_DIR}/include/fastdds/dds/xtypes/dynamic_types/detail/type_traits.hpp + + dynamic_types/DynamicDataFactory.cpp + dynamic_types/DynamicTypeBuilderFactory.cpp + ) + +#}}} + +#{{{ Implementation + +add_library(fastdds-xtypes-dynamic-types-impl INTERFACE) + +add_library(fastdds::xtypes::dynamic-types::impl ALIAS fastdds-xtypes-dynamic-types-impl) + +target_compile_features(fastdds-xtypes-dynamic-types-impl INTERFACE cxx_std_11) + +target_sources(fastdds-xtypes-dynamic-types-impl INTERFACE + ${PROJECT_SOURCE_DIR}/include/fastdds/dds/xtypes/dynamic_types/DynamicPubSubType.hpp + dynamic_types/AnnotationDescriptorImpl.cpp + dynamic_types/AnnotationDescriptorImpl.hpp + dynamic_types/DynamicDataImpl.cpp + dynamic_types/DynamicDataImpl.hpp + dynamic_types/DynamicDataFactoryImpl.cpp + dynamic_types/DynamicDataFactoryImpl.hpp + dynamic_types/DynamicPubSubType.cpp + dynamic_types/DynamicTypeImpl.cpp + dynamic_types/DynamicTypeImpl.hpp + dynamic_types/DynamicTypeBuilderImpl.cpp + dynamic_types/DynamicTypeBuilderImpl.hpp + dynamic_types/DynamicTypeBuilderFactoryImpl.cpp + dynamic_types/DynamicTypeBuilderFactoryImpl.hpp + dynamic_types/DynamicTypeMemberImpl.cpp + dynamic_types/DynamicTypeMemberImpl.hpp + dynamic_types/MemberDescriptorImpl.cpp + dynamic_types/MemberDescriptorImpl.hpp + dynamic_types/TypeDescriptorImpl.cpp + dynamic_types/TypeDescriptorImpl.hpp + dynamic_types/VerbatimTextDescriptorImpl.cpp + dynamic_types/VerbatimTextDescriptorImpl.hpp + ) + +target_link_libraries(fastdds-xtypes-dynamic-types-impl INTERFACE fastdds-xtypes-dynamic-types-api) + +#}}} + +#}}} + +#{{{ Interface library for grouping the TypeObject Representation source code. + +add_library(fastdds-xtypes-type-representation INTERFACE) + +add_library(fastdds::xtypes::type-representation ALIAS fastdds-xtypes-type-representation) + +target_compile_features(fastdds-xtypes-type-representation INTERFACE cxx_std_11) + +target_sources(fastdds-xtypes-type-representation INTERFACE + ${PROJECT_SOURCE_DIR}/include/fastdds/dds/xtypes/exception/Exception.hpp + ${PROJECT_SOURCE_DIR}/include/fastdds/dds/xtypes/type_representation/ITypeObjectRegistry.hpp + ${PROJECT_SOURCE_DIR}/include/fastdds/dds/xtypes/type_representation/TypeObject.hpp + ${PROJECT_SOURCE_DIR}/include/fastdds/dds/xtypes/type_representation/TypeObjectUtils.hpp + + ${PROJECT_SOURCE_DIR}/include/fastdds/dds/xtypes/type_representation/detail/dds_xtypes_typeobject.hpp + ${PROJECT_SOURCE_DIR}/include/fastdds/dds/xtypes/type_representation/detail/dds_xtypes_typeobjectCdrAux.hpp + ${PROJECT_SOURCE_DIR}/include/fastdds/dds/xtypes/type_representation/detail/dds_xtypes_typeobjectPubSubTypes.h + + exception/Exception.cpp + type_representation/dds_xtypes_typeobjectCdrAux.ipp + type_representation/dds_xtypes_typeobjectPubSubTypes.cxx + type_representation/TypeIdentifierWithSizeHashSpecialization.h + type_representation/TypeObjectRegistry.cpp + type_representation/TypeObjectRegistry.hpp + type_representation/TypeObjectUtils.cpp + ) + +#}}} diff --git a/src/cpp/fastdds/xtypes/dynamic_types/AnnotationDescriptorImpl.cpp b/src/cpp/fastdds/xtypes/dynamic_types/AnnotationDescriptorImpl.cpp new file mode 100644 index 00000000000..1dbc0f849a2 --- /dev/null +++ b/src/cpp/fastdds/xtypes/dynamic_types/AnnotationDescriptorImpl.cpp @@ -0,0 +1,141 @@ +// 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. + +#include "AnnotationDescriptorImpl.hpp" + +#include +#include + +#include "DynamicTypeImpl.hpp" +#include "TypeValueConverter.hpp" + +namespace eprosima { +namespace fastdds { +namespace dds { + +template<> +traits::ref_type traits::make_shared() +{ + return std::make_shared(); +} + +ReturnCode_t AnnotationDescriptorImpl::get_value( + ObjectName& value, + const ObjectName& key) noexcept +{ + auto it = value_.find(key); + + if (it != value_.end()) + { + value = it->second; + return RETCODE_OK; + } + + return RETCODE_BAD_PARAMETER; +} + +ReturnCode_t AnnotationDescriptorImpl::get_all_value( + Parameters& value) noexcept +{ + value = value_; + return RETCODE_OK; +} + +ReturnCode_t AnnotationDescriptorImpl::set_value( + const ObjectName& key, + const ObjectName& value) noexcept +{ + value_[key] = value; + return RETCODE_OK; +} + +ReturnCode_t AnnotationDescriptorImpl::copy_from( + traits::ref_type descriptor) noexcept +{ + if (!descriptor) + { + return RETCODE_BAD_PARAMETER; + } + + return copy_from(*traits::narrow(descriptor)); +} + +ReturnCode_t AnnotationDescriptorImpl::copy_from( + const AnnotationDescriptorImpl& descriptor) noexcept +{ + type_ = descriptor.type_; + value_.clear(); + value_ = descriptor.value_; + return RETCODE_OK; +} + +bool AnnotationDescriptorImpl::equals( + traits::ref_type descriptor) noexcept +{ + return equals(*traits::narrow(descriptor)); +} + +bool AnnotationDescriptorImpl::equals( + AnnotationDescriptorImpl& descriptor) noexcept +{ + return (type_ && type_->equals(descriptor.type_)) && + value_ == descriptor.value_; +} + +bool AnnotationDescriptorImpl::is_consistent() noexcept +{ + if (!type_ || type_->get_kind() != TK_ANNOTATION) + { + return false; + } + + auto type_impl {traits::narrow(type_)}; + + for (const auto& param : value_) + { + //{{{ Check the annotation parameter name is valid because it exits in the annotation type descriptor. + const ObjectName* ann_param_value {nullptr}; + traits::ref_type ann_param_type; + for (auto member{type_impl->get_all_members_by_index().cbegin()}; + !ann_param_value && member != type_impl->get_all_members_by_index().cend(); + ++member) + { + if (0 == member->get()->get_name().compare(param.first)) + { + ann_param_value = ¶m.second; + ann_param_type = traits::narrow(member->get()->get_descriptor().type()); + } + } + + if (!ann_param_value) + { + return false; + } + //}}} + + //{{{ Check the parameter value is convertible to its type. + if (!TypeValueConverter::is_string_consistent(ann_param_type->get_kind(), + ann_param_type->get_all_members_by_index(), ann_param_value->to_string())) + { + return false; + } + //}}} + } + + return true; +} + +} // namespace dds +} // namespace fastdds +} // namespace eprosima diff --git a/src/cpp/dynamic-types/DynamicTypeBuilderPtr.cpp b/src/cpp/fastdds/xtypes/dynamic_types/DynamicDataFactory.cpp similarity index 54% rename from src/cpp/dynamic-types/DynamicTypeBuilderPtr.cpp rename to src/cpp/fastdds/xtypes/dynamic_types/DynamicDataFactory.cpp index d0e7477ac19..bc76d3e8545 100644 --- a/src/cpp/dynamic-types/DynamicTypeBuilderPtr.cpp +++ b/src/cpp/fastdds/xtypes/dynamic_types/DynamicDataFactory.cpp @@ -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,25 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include -#include -#include +#include + +#include "DynamicDataFactoryImpl.hpp" namespace eprosima { -namespace fastrtps { -namespace types { +namespace fastdds { +namespace dds { -DynamicTypeBuilder_ptr::DynamicTypeBuilder_ptr(DynamicTypeBuilder* pType) - : Base(pType, [](DynamicTypeBuilder* pType) +traits::ref_type DynamicDataFactory::get_instance() { - DynamicTypeBuilderFactory::get_instance()->delete_builder(pType); -}) + return DynamicDataFactoryImpl::get_instance(); +} + +ReturnCode_t DynamicDataFactory::delete_instance() { + // Delegate into the implementation class + return DynamicDataFactoryImpl::delete_instance(); } -} // namespace types -} // namespace fastrtps +} // namespace dds +} // namespace fastdds } // namespace eprosima diff --git a/src/cpp/fastdds/xtypes/dynamic_types/DynamicDataFactoryImpl.cpp b/src/cpp/fastdds/xtypes/dynamic_types/DynamicDataFactoryImpl.cpp new file mode 100644 index 00000000000..f1b7a1b7b7f --- /dev/null +++ b/src/cpp/fastdds/xtypes/dynamic_types/DynamicDataFactoryImpl.cpp @@ -0,0 +1,60 @@ +// 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. + +#include "DynamicDataFactoryImpl.hpp" + +#include "DynamicDataImpl.hpp" + +namespace eprosima { +namespace fastdds { +namespace dds { + +traits::ref_type DynamicDataFactoryImpl::instance_; + +traits::ref_type DynamicDataFactoryImpl::get_instance() noexcept +{ + if (!instance_) + { + instance_ = std::make_shared(); + } + + return instance_; +} + +ReturnCode_t DynamicDataFactoryImpl::delete_instance() noexcept +{ + if (!instance_) + { + return RETCODE_BAD_PARAMETER; + } + instance_.reset(); + return RETCODE_OK; +} + +traits::ref_type DynamicDataFactoryImpl::create_data( + traits::ref_type type) noexcept +{ + return std::make_shared(type); +} + +ReturnCode_t DynamicDataFactoryImpl::delete_data( + traits::ref_type data) noexcept +{ + data.reset(); + return RETCODE_OK; +} + +} // namespace dds +} // namespace fastdds +} // namespace eprosima diff --git a/src/cpp/fastdds/xtypes/dynamic_types/DynamicDataFactoryImpl.hpp b/src/cpp/fastdds/xtypes/dynamic_types/DynamicDataFactoryImpl.hpp index 4132af45f71..0025dc8afad 100644 --- a/src/cpp/fastdds/xtypes/dynamic_types/DynamicDataFactoryImpl.hpp +++ b/src/cpp/fastdds/xtypes/dynamic_types/DynamicDataFactoryImpl.hpp @@ -35,6 +35,8 @@ class DynamicDataFactoryImpl : public traits::base_type ReturnCode_t delete_data( traits::ref_type data) noexcept override; + virtual ~DynamicDataFactoryImpl() = default; + private: static traits::ref_type instance_; diff --git a/src/cpp/fastdds/xtypes/dynamic_types/DynamicDataImpl.cpp b/src/cpp/fastdds/xtypes/dynamic_types/DynamicDataImpl.cpp new file mode 100644 index 00000000000..7ceb9651d0c --- /dev/null +++ b/src/cpp/fastdds/xtypes/dynamic_types/DynamicDataImpl.cpp @@ -0,0 +1,7083 @@ +// 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. + +#include "DynamicDataImpl.hpp" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include + +#include "common.hpp" +#include "DynamicTypeMemberImpl.hpp" +#include "TypeValueConverter.hpp" + +namespace eprosima { + +namespace fastcdr { + +//{{{ Specialization templates used by Fast CDR to work with DynamicData. + +template<> +FASTDDS_EXPORTED_API size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const fastdds::dds::traits::ref_type& data, + size_t& current_alignment) +{ + return data->calculate_serialized_size(calculator, current_alignment); +} + +template<> +FASTDDS_EXPORTED_API void serialize( + eprosima::fastcdr::Cdr& scdr, + const fastdds::dds::traits::ref_type& data) +{ + return data->serialize(scdr); +} + +template<> +FASTDDS_EXPORTED_API void deserialize( + eprosima::fastcdr::Cdr& cdr, + fastdds::dds::traits::ref_type& data) +{ + data->deserialize(cdr); +} + +//}}} + +} // namespace fastcdr + +namespace fastdds { +namespace dds { + + +bool is_complex_kind( + TypeKind kind) +{ + switch (kind) + { + case TK_ANNOTATION: + case TK_ARRAY: + case TK_BITMASK: + case TK_BITSET: + case TK_MAP: + case TK_SEQUENCE: + case TK_STRUCTURE: + case TK_UNION: + return true; + default: + return false; + } +} + +void fill_vector_with_dynamic_data( + std::shared_ptr::ref_type>>& vector, + const traits::ref_type& sequence_type) +{ + for (size_t pos = 0; pos < vector->size(); ++pos) + { + if (!vector->at(pos)) + { + vector->at(pos) = traits::narrow( + DynamicDataFactory::get_instance()->create_data(sequence_type)); + } + } +} + +template +ReturnCode_t clear_sequence_typed_element( + std::shared_ptr& sequence, + TypeKind type_kind, + MemberId id) +{ + ReturnCode_t ret_value = RETCODE_BAD_PARAMETER; + if (sequence->size() > id) + { + auto it = sequence->erase(sequence->begin() + id); + if (TK_ARRAY == type_kind) + { + sequence->emplace(it); + } + ret_value = RETCODE_OK; + } + return ret_value; +} + +template<> +ReturnCode_t clear_sequence_typed_element( + std::shared_ptr>& sequence, + TypeKind type_kind, + MemberId id) +{ + ReturnCode_t ret_value = RETCODE_BAD_PARAMETER; + if (sequence->size() > id) + { + auto it = sequence->erase(sequence->begin() + id); + if (TK_ARRAY == type_kind) + { + sequence->insert(it, false); + } + ret_value = RETCODE_OK; + } + return ret_value; +} + +//{{{ Public functions + +DynamicDataImpl::DynamicDataImpl( + traits::ref_type type) noexcept + : type_(traits::narrow(type)) + , enclosing_type_(get_enclosing_type(type_)) +{ + TypeKind type_kind = enclosing_type_->get_kind(); + + if (TK_ANNOTATION == type_kind || + TK_BITSET == type_kind || + TK_STRUCTURE == type_kind || + TK_UNION == type_kind) + { + for (auto& member : enclosing_type_->get_all_members_by_index()) + { + traits::ref_type data = DynamicDataFactory::get_instance()->create_data( + member->get_descriptor().type()); + traits::ref_type data_impl = traits::narrow(data); + + set_default_value(member, data_impl); + + value_.emplace(member->get_id(), data); + } + } + else if (TK_ARRAY == type_kind || + TK_SEQUENCE == type_kind) + { + uint32_t sequence_size {calculate_array_max_elements(type_kind)}; + auto sequence_type = get_enclosing_type( + traits::narrow(enclosing_type_->get_descriptor().element_type())); + + add_sequence_value(sequence_type, sequence_size); + } + else if (TK_BITMASK == type_kind) + { + assert(1 == enclosing_type_->get_descriptor().bound().size()); + value_.emplace(MEMBER_ID_INVALID, + std::make_shared>(enclosing_type_->get_descriptor().bound().at(0), false)); + } + else if (TK_MAP != type_kind) // Primitives + { + add_value(type_kind, MEMBER_ID_INVALID); + } +} + +ReturnCode_t DynamicDataImpl::clear_all_values() noexcept +{ + return clear_all_values(false); +} + +ReturnCode_t DynamicDataImpl::clear_nonkey_values() noexcept +{ + return clear_all_values(true); +} + +ReturnCode_t DynamicDataImpl::clear_value( + MemberId id) noexcept +{ + ReturnCode_t ret_val = RETCODE_BAD_PARAMETER; + TypeKind type_kind = enclosing_type_->get_kind(); + + if (TK_ARRAY == type_kind || TK_SEQUENCE == type_kind) + { + ret_val = clear_sequence_element(type_kind, id); + } + else if (TK_MAP == type_kind) + { + auto key_it = std::find_if(key_to_id_.begin(), key_to_id_.end(), [id]( + const decltype(key_to_id_)::value_type& value) + { + return value.second == id; + }); + + if (key_to_id_.end() != key_it) + { + auto value_it = value_.find(id); + assert(value_it != value_.end()); + + key_to_id_.erase(key_it); + value_.erase(value_it); + ret_val = RETCODE_OK; + } + else + { + assert(value_.end() == value_.find(id)); + } + } + else if (TK_BITMASK == type_kind) + { + assert(1 == value_.size()); + assert(1 == enclosing_type_->get_descriptor().bound().size()); + auto sequence = std::static_pointer_cast>(value_.begin()->second); + assert(sequence->size() == enclosing_type_->get_descriptor().bound().at(0)); + + if (sequence->size() > id) + { + sequence->at(id) = false; + ret_val = RETCODE_OK; + } + } + else if (TK_ANNOTATION == type_kind || + TK_BITSET == type_kind || + TK_STRUCTURE == type_kind || + TK_UNION == type_kind) + { + if (TK_UNION != type_kind || 0 == id || selected_union_member_ == id) + { + const auto& members = enclosing_type_->get_all_members(); + auto it_value = value_.find(id); + + if (it_value != value_.end()) + { + const auto it = members.find(it_value->first); + assert(members.end() != it); + auto member = traits::narrow(it->second); + auto data = std::static_pointer_cast(it_value->second); + + data->clear_all_values(); + set_default_value(member, data); + ret_val = RETCODE_OK; + } + } + } + else + { + if (MEMBER_ID_INVALID == id) + { + set_value(""); + ret_val = RETCODE_OK; + } + } + + return ret_val; +} + +traits::ref_type DynamicDataImpl::clone() noexcept +{ + traits::ref_type ret_value = std::make_shared(); + ret_value->type_ = type_; + ret_value->enclosing_type_ = enclosing_type_; + + TypeKind type_kind = enclosing_type_->get_kind(); + + if (TK_ANNOTATION == type_kind || + TK_BITSET == type_kind || + TK_STRUCTURE == type_kind || + TK_UNION == type_kind) + { + ret_value->selected_union_member_ = selected_union_member_; + for (const auto& value : value_) + { + ret_value->value_.emplace(value.first, std::static_pointer_cast(value.second)->clone()); + + } + } + else if (TK_ARRAY == type_kind || + TK_SEQUENCE == type_kind) + { + TypeKind element_kind = + get_enclosing_typekind(traits::narrow( + enclosing_type_->get_descriptor().element_type())); + + ret_value->value_.emplace(value_.cbegin()->first, clone_sequence(element_kind, value_.cbegin()->second)); + } + else if (TK_MAP == type_kind) + { + ret_value->key_to_id_ = key_to_id_; + ret_value->next_map_member_id_ = next_map_member_id_; + + TypeKind element_kind = + get_enclosing_typekind(traits::narrow( + enclosing_type_->get_descriptor().element_type())); + + for (const auto& value : value_) + { + if (is_complex_kind(element_kind)) + { + ret_value->value_.emplace(value.first, + std::static_pointer_cast(value.second)->clone()); + } + else + { + ret_value->value_.emplace(value.first, clone_primitive(element_kind, value.second)); + } + } + } + else if (TK_BITMASK == type_kind) + { + ret_value->value_.emplace(value_.cbegin()->first, + std::make_shared>(*std::static_pointer_cast>( + value_.cbegin()->second))); + } + else // Primitives + { + ret_value->value_.emplace(value_.cbegin()->first, clone_primitive(type_kind, value_.cbegin()->second)); + } + + return ret_value; +} + +bool DynamicDataImpl::equals( + traits::ref_type other) noexcept +{ + auto other_data = traits::narrow(other); + + if (type_ && other_data->type_ && type_->equals(other_data->type_)) + { + TypeKind type_kind = enclosing_type_->get_kind(); + + if (TK_ANNOTATION == type_kind || + TK_BITSET == type_kind || + TK_STRUCTURE == type_kind) + { + return value_.size() == other_data->value_.size() && + std::equal( + value_.begin(), + value_.end(), + other_data->value_.begin(), + [](const decltype(value_)::value_type& l, const decltype(value_)::value_type& r) + { + return l.first == r.first && std::static_pointer_cast(l.second)->equals( + std::static_pointer_cast(r.second)); + }); + } + else if (TK_UNION == type_kind) + { + return std::static_pointer_cast(value_.at(0))->equals( + std::static_pointer_cast(other_data->value_.at(0))) && + (MEMBER_ID_INVALID == selected_union_member_ || + std::static_pointer_cast(value_.at(selected_union_member_))->equals( + std::static_pointer_cast(other_data->value_.at(selected_union_member_)))); + } + else if (TK_ARRAY == type_kind || + TK_SEQUENCE == type_kind) + { + TypeKind element_kind = + get_enclosing_typekind(traits::narrow( + enclosing_type_->get_descriptor().element_type())); + return compare_sequence_values(element_kind, value_.begin()->second, + other_data->value_.begin()->second); + } + else if (TK_MAP == type_kind) + { + TypeKind element_kind = + get_enclosing_typekind(traits::narrow( + enclosing_type_->get_descriptor().element_type())); + assert(key_to_id_.size() == value_.size() && other_data->key_to_id_.size() == other_data->value_.size()); + + return key_to_id_.size() == other_data->key_to_id_.size() && + std::equal( + key_to_id_.begin(), + key_to_id_.end(), + other_data->key_to_id_.begin(), + [&](const decltype(key_to_id_)::value_type& l, const decltype(key_to_id_)::value_type& r) + { + return 0 == l.first.compare(r.first) && + 1 == value_.count(l.second) && + 1 == other_data->value_.count(r.second) && + (is_complex_kind(element_kind) ? + std::static_pointer_cast(value_.at(l.second))->equals( + std::static_pointer_cast(other_data->value_.at(r.second))) : + compare_values(element_kind, value_.at(l.second), other_data->value_.at(r.second))); + }); + } + else if (TK_BITMASK == type_kind) + { + return *(std::static_pointer_cast>(value_.begin()->second)) == + *(std::static_pointer_cast>(other_data->value_.begin()->second)); + } + else // primitives + { + // primitives + return compare_values(type_kind, value_.begin()->second, other_data->value_.begin()->second); + } + } + + return false; +} + +ReturnCode_t DynamicDataImpl::get_descriptor( + traits::ref_type& value, + MemberId id) noexcept +{ + traits::ref_type member; + + if (RETCODE_OK == type_->get_member(member, id)) + { + return member->get_descriptor(value); + } + + return RETCODE_BAD_PARAMETER; +} + +uint32_t DynamicDataImpl::get_item_count() noexcept +{ + uint32_t ret_value {0}; + + TypeKind type_kind = enclosing_type_->get_kind(); + if (TK_ARRAY == type_kind || TK_SEQUENCE == type_kind) + { + ret_value = get_sequence_length(); + } + else if (TK_STRING8 == type_kind) + { + assert(1 == value_.size()); + ret_value = static_cast( + std::static_pointer_cast>(value_.begin()->second)->length()); + } + else if (TK_STRING16 == type_kind) + { + assert(1 == value_.size()); + ret_value = static_cast( + std::static_pointer_cast>(value_.begin()->second)->length()); + } + else if (TK_UNION == type_kind) + { + ret_value = 1 + (MEMBER_ID_INVALID == selected_union_member_ ? 0 : 1); + } + else if (TK_BITMASK == type_kind) + { + auto bits = std::static_pointer_cast>(value_.begin()->second); + ret_value = static_cast(std::count_if(bits->begin(), bits->end(), [](bool bit) + { + return bit; + })); + } + else + { + ret_value = static_cast(value_.size()); + } + + return ret_value; +} + +MemberId DynamicDataImpl::get_member_id_at_index( + uint32_t index) noexcept +{ + MemberId ret_value {MEMBER_ID_INVALID}; + TypeKind type_kind = enclosing_type_->get_kind(); + + if (TK_ANNOTATION == type_kind || + TK_BITMASK == type_kind || + TK_BITSET == type_kind || + TK_STRUCTURE == type_kind || + TK_UNION == type_kind) + { + traits::ref_type member; + if (RETCODE_OK == enclosing_type_->get_member_by_index(member, index)) + { + ret_value = member->get_id(); + } + } + else if (TK_ARRAY == type_kind || + TK_SEQUENCE == type_kind || + TK_STRING8 == type_kind || + TK_STRING16 == type_kind) + { + assert(1 == value_.size()); + if (index < get_item_count()) + { + ret_value = index; + } + } + else if (TK_MAP == type_kind) + { + if (index < key_to_id_.size()) + { + ret_value = std::next(key_to_id_.begin(), index)->second; + } + } + + return ret_value; +} + +MemberId DynamicDataImpl::get_member_id_by_name( + const ObjectName& name) noexcept +{ + MemberId ret_value {MEMBER_ID_INVALID}; + TypeKind type_kind = enclosing_type_->get_kind(); + + if (TK_ANNOTATION == type_kind || + TK_BITMASK == type_kind || + TK_BITSET == type_kind || + TK_STRUCTURE == type_kind || + TK_UNION == type_kind) + { + traits::ref_type member; + if (RETCODE_OK == enclosing_type_->get_member_by_name(member, name)) + { + ret_value = member->get_id(); + } + } + else if (TK_MAP == type_kind) + { + assert(enclosing_type_->get_descriptor().key_element_type()); + auto key_type = traits::narrow( + enclosing_type_->get_descriptor().key_element_type())->resolve_alias_enclosed_type(); + if (TypeValueConverter::is_string_consistent(key_type->get_kind(), key_type->get_all_members_by_index(), + name.to_string())) + { + auto it = key_to_id_.find(name.to_string()); + + if (key_to_id_.end() == it) + { + if (static_cast(LENGTH_UNLIMITED) == enclosing_type_->get_descriptor().bound().at(0) || + enclosing_type_->get_descriptor().bound().at(0) > key_to_id_.size()) + { + ret_value = next_map_member_id_++; + key_to_id_[name.to_string()] = ret_value; + + TypeKind element_kind = + get_enclosing_typekind(traits::narrow( + enclosing_type_->get_descriptor().element_type())); + + if (!is_complex_kind(element_kind)) + { + add_value(element_kind, ret_value); + } + else + { + traits::ref_type data = DynamicDataFactory::get_instance()->create_data( + type_->get_descriptor().element_type()); + value_.emplace(ret_value, data); + } + } + } + else + { + ret_value = it->second; + } + } + } + + return ret_value; +} + +//{{{ Getters + +//{{{ Primitive getters + +ReturnCode_t DynamicDataImpl::get_int32_value( + int32_t& value, + MemberId id) noexcept +{ + return get_value(value, id); +} + +ReturnCode_t DynamicDataImpl::get_uint32_value( + uint32_t& value, + MemberId id) noexcept +{ + return get_value(value, id); +} + +ReturnCode_t DynamicDataImpl::get_int8_value( + int8_t& value, + MemberId id) noexcept +{ + return get_value(value, id); +} + +ReturnCode_t DynamicDataImpl::get_uint8_value( + uint8_t& value, + MemberId id) noexcept +{ + return get_value(value, id); +} + +ReturnCode_t DynamicDataImpl::get_int16_value( + int16_t& value, + MemberId id) noexcept +{ + return get_value(value, id); +} + +ReturnCode_t DynamicDataImpl::get_uint16_value( + uint16_t& value, + MemberId id) noexcept +{ + return get_value(value, id); +} + +ReturnCode_t DynamicDataImpl::get_int64_value( + int64_t& value, + MemberId id) noexcept +{ + return get_value(value, id); +} + +ReturnCode_t DynamicDataImpl::get_uint64_value( + uint64_t& value, + MemberId id) noexcept +{ + return get_value(value, id); +} + +ReturnCode_t DynamicDataImpl::get_float32_value( + float& value, + MemberId id) noexcept +{ + return get_value(value, id); +} + +ReturnCode_t DynamicDataImpl::get_float64_value( + double& value, + MemberId id) noexcept +{ + return get_value(value, id); +} + +ReturnCode_t DynamicDataImpl::get_float128_value( + long double& value, + MemberId id) noexcept +{ + return get_value(value, id); +} + +ReturnCode_t DynamicDataImpl::get_char8_value( + char& value, + MemberId id) noexcept +{ + return get_value(value, id); +} + +ReturnCode_t DynamicDataImpl::get_char16_value( + wchar_t& value, + MemberId id) noexcept +{ + return get_value(value, id); +} + +ReturnCode_t DynamicDataImpl::get_byte_value( + eprosima::fastrtps::rtps::octet& value, + MemberId id) noexcept +{ + return get_value(value, id); +} + +ReturnCode_t DynamicDataImpl::get_boolean_value( + bool& value, + MemberId id) noexcept +{ + return get_value(value, id); +} + +ReturnCode_t DynamicDataImpl::get_string_value( + std::string& value, + MemberId id) noexcept +{ + return get_value(value, id); +} + +ReturnCode_t DynamicDataImpl::get_wstring_value( + std::wstring& value, + MemberId id) noexcept +{ + return get_value(value, id); +} + +//}}} + +ReturnCode_t DynamicDataImpl::get_complex_value( + traits::ref_type& value, + MemberId id) noexcept +{ + TypeKind type_kind = enclosing_type_->get_kind(); + + if (MEMBER_ID_INVALID != id) + { + if (TK_ANNOTATION == type_kind || + TK_BITSET == type_kind || + TK_STRUCTURE == type_kind || + TK_UNION == type_kind) + { + if (TK_UNION != type_kind || selected_union_member_ == id) + { + auto it = value_.find(id); + if (it != value_.end()) + { + value = std::static_pointer_cast(it->second)->clone(); + return RETCODE_OK; + } + else + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Error getting complex value. MemberId not found."); + } + } + } + else if (TK_ARRAY == type_kind || + TK_SEQUENCE == type_kind) + { + auto element_type = + get_enclosing_type(traits::narrow( + enclosing_type_->get_descriptor().element_type())); + + if (is_complex_kind(element_type->get_kind())) + { + auto it = value_.cbegin(); + assert(value_.cend() != it && MEMBER_ID_INVALID == it->first); + auto sequence = + std::static_pointer_cast::ref_type>>(it->second); + assert(sequence); + if ((TK_ARRAY == type_kind && sequence->size() > id) || + (TK_SEQUENCE == type_kind && + (static_cast(LENGTH_UNLIMITED) == + enclosing_type_->get_descriptor().bound().at(0) || + enclosing_type_->get_descriptor().bound().at(0) > id))) + { + if (sequence->size() < id + 1) + { + auto last_pos = sequence->size(); + sequence->resize(id + 1); + + for (auto pos = last_pos; pos < sequence->size(); ++pos) + { + sequence->at(pos) = traits::narrow( + DynamicDataFactory::get_instance()->create_data(element_type)); + } + } + + value = std::static_pointer_cast(sequence->at(id))->clone(); + return RETCODE_OK; + } + } + else + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Error loaning a collection of primitives"); + } + } + else if (TK_MAP == type_kind) + { + auto element_type = + get_enclosing_type(traits::narrow( + enclosing_type_->get_descriptor().element_type())); + + if (is_complex_kind(element_type->get_kind())) + { + auto it = value_.find(id); + if (it != value_.end()) + { + value = std::static_pointer_cast(it->second)->clone(); + return RETCODE_OK; + } + else + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Error getting complex value. MemberId not found."); + } + } + } + } + else + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Error getting complex value. Invalid MemberId."); + } + + return RETCODE_BAD_PARAMETER; +} + +//{{{ Array getters + +ReturnCode_t DynamicDataImpl::get_int32_values( + Int32Seq& value, + MemberId id) noexcept +{ + return get_sequence_values(value, id); +} + +ReturnCode_t DynamicDataImpl::get_uint32_values( + UInt32Seq& value, + MemberId id) noexcept +{ + return get_sequence_values(value, id); +} + +ReturnCode_t DynamicDataImpl::get_int8_values( + Int8Seq& value, + MemberId id) noexcept +{ + return get_sequence_values(value, id); +} + +ReturnCode_t DynamicDataImpl::get_uint8_values( + UInt8Seq& value, + MemberId id) noexcept +{ + return get_sequence_values(value, id); +} + +ReturnCode_t DynamicDataImpl::get_int16_values( + Int16Seq& value, + MemberId id) noexcept +{ + return get_sequence_values(value, id); +} + +ReturnCode_t DynamicDataImpl::get_uint16_values( + UInt16Seq& value, + MemberId id) noexcept +{ + return get_sequence_values(value, id); +} + +ReturnCode_t DynamicDataImpl::get_int64_values( + Int64Seq& value, + MemberId id) noexcept +{ + return get_sequence_values(value, id); +} + +ReturnCode_t DynamicDataImpl::get_uint64_values( + UInt64Seq& value, + MemberId id) noexcept +{ + return get_sequence_values(value, id); +} + +ReturnCode_t DynamicDataImpl::get_float32_values( + Float32Seq& value, + MemberId id) noexcept +{ + return get_sequence_values(value, id); +} + +ReturnCode_t DynamicDataImpl::get_float64_values( + Float64Seq& value, + MemberId id) noexcept +{ + return get_sequence_values(value, id); +} + +ReturnCode_t DynamicDataImpl::get_float128_values( + Float128Seq& value, + MemberId id) noexcept +{ + return get_sequence_values< TK_FLOAT128>(value, id); +} + +ReturnCode_t DynamicDataImpl::get_char8_values( + CharSeq& value, + MemberId id) noexcept +{ + return get_sequence_values(value, id); +} + +ReturnCode_t DynamicDataImpl::get_char16_values( + WcharSeq& value, + MemberId id) noexcept +{ + return get_sequence_values(value, id); +} + +ReturnCode_t DynamicDataImpl::get_byte_values( + ByteSeq& value, + MemberId id) noexcept +{ + return get_sequence_values(value, id); +} + +ReturnCode_t DynamicDataImpl::get_boolean_values( + BooleanSeq& value, + MemberId id) noexcept +{ + return get_sequence_values(value, id); +} + +ReturnCode_t DynamicDataImpl::get_string_values( + StringSeq& value, + MemberId id) noexcept +{ + return get_sequence_values(value, id); +} + +ReturnCode_t DynamicDataImpl::get_wstring_values( + WstringSeq& value, + MemberId id) noexcept +{ + return get_sequence_values(value, id); +} + +//}}} + +//}}} + +traits::ref_type DynamicDataImpl::loan_value( + MemberId id) noexcept +{ + if (MEMBER_ID_INVALID != id) + { + TypeKind type_kind = enclosing_type_->get_kind(); + + if (std::find(loaned_values_.begin(), loaned_values_.end(), id) == loaned_values_.end()) + { + if (TK_ANNOTATION == type_kind || + TK_STRUCTURE == type_kind || + TK_UNION == type_kind) + { + auto it = value_.find(id); + if (it != value_.end()) + { + auto sp = std::static_pointer_cast(it->second); + + if (TK_UNION == type_kind && 0 != id) // Set new discriminator. + { + set_discriminator_value(id); + } + + loaned_values_.push_back(id); + return sp; + } + else + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Error loaning value. MemberId not found."); + } + } + else if (TK_ARRAY == type_kind || + TK_SEQUENCE == type_kind) + { + auto element_type = + get_enclosing_type(traits::narrow( + enclosing_type_->get_descriptor().element_type())); + + if (is_complex_kind(element_type->get_kind())) + { + auto it = value_.cbegin(); + assert(value_.cend() != it && MEMBER_ID_INVALID == it->first); + auto sequence = + std::static_pointer_cast::ref_type>>(it->second); + assert(sequence); + if ((TK_ARRAY == type_kind && sequence->size() > id) || + (TK_SEQUENCE == type_kind && + (static_cast(LENGTH_UNLIMITED) == + enclosing_type_->get_descriptor().bound().at(0) || + enclosing_type_->get_descriptor().bound().at(0) > id))) + { + if (sequence->size() < id + 1) + { + auto last_pos = sequence->size(); + sequence->resize(id + 1); + + for (auto pos = last_pos; pos < sequence->size(); ++pos) + { + sequence->at(pos) = traits::narrow( + DynamicDataFactory::get_instance()->create_data(element_type)); + } + } + + loaned_values_.push_back(id); + return sequence->at(id); + } + } + else + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Error loaning a collection of primitives"); + } + } + else if (TK_MAP == type_kind) + { + auto element_type = + get_enclosing_type(traits::narrow( + enclosing_type_->get_descriptor().element_type())); + + if (is_complex_kind(element_type->get_kind())) + { + auto it = value_.find(id); + if (it != value_.end()) + { + auto sp = std::static_pointer_cast(it->second); + loaned_values_.push_back(id); + return sp; + } + else + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Error loaning value. MemberId not found."); + } + } + } + } + else + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Error loaning value. The value has been loaned previously."); + } + } + else + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Error loaning value. Invalid MemberId."); + } + + return {}; +} + +ReturnCode_t DynamicDataImpl::return_loaned_value( + traits::ref_type value) noexcept +{ + TypeKind type_kind = enclosing_type_->get_kind(); + + for (auto loan_it {loaned_values_.begin()}; loan_it != loaned_values_.end(); ++loan_it) + { + if (TK_ANNOTATION == type_kind || + TK_MAP == type_kind || + TK_STRUCTURE == type_kind || + TK_UNION == type_kind) + { + auto it = value_.find(*loan_it); + if (it != value_.end() && std::static_pointer_cast(it->second) == value) + { + loaned_values_.erase(loan_it); + return RETCODE_OK; + } + } + else if (TK_ARRAY == type_kind || + TK_SEQUENCE == type_kind) + { + auto it = value_.cbegin(); + assert(value_.cend() != it && MEMBER_ID_INVALID == it->first); + auto sequence = + std::static_pointer_cast::ref_type>>(it->second); + assert((TK_ARRAY == type_kind && sequence->size() > *loan_it) || + (TK_SEQUENCE == type_kind && + (static_cast(LENGTH_UNLIMITED) == enclosing_type_->get_descriptor().bound().at(0) || + enclosing_type_->get_descriptor().bound().at(0) > *loan_it))); + if (sequence->size() >= *loan_it + 1) + { + if (sequence->at(*loan_it) == value) + { + loaned_values_.erase(loan_it); + return RETCODE_OK; + } + } + } + } + + EPROSIMA_LOG_ERROR(DYN_TYPES, "Error returning loaned Value. The value hasn't been loaned."); + return RETCODE_PRECONDITION_NOT_MET; +} + +//{{{ Setters + +//{{{ Primitive setters + +ReturnCode_t DynamicDataImpl::set_int32_value( + MemberId id, + int32_t value) noexcept +{ + return set_value(id, value); +} + +ReturnCode_t DynamicDataImpl::set_uint32_value( + MemberId id, + uint32_t value) noexcept +{ + return set_value(id, value); +} + +ReturnCode_t DynamicDataImpl::set_int8_value( + MemberId id, + int8_t value) noexcept +{ + return set_value(id, value); +} + +ReturnCode_t DynamicDataImpl::set_uint8_value( + MemberId id, + uint8_t value) noexcept +{ + return set_value(id, value); +} + +ReturnCode_t DynamicDataImpl::set_int16_value( + MemberId id, + int16_t value) noexcept +{ + return set_value(id, value); +} + +ReturnCode_t DynamicDataImpl::set_uint16_value( + MemberId id, + uint16_t value) noexcept +{ + return set_value(id, value); +} + +ReturnCode_t DynamicDataImpl::set_int64_value( + MemberId id, + int64_t value) noexcept +{ + return set_value(id, value); +} + +ReturnCode_t DynamicDataImpl::set_uint64_value( + MemberId id, + uint64_t value) noexcept +{ + return set_value(id, value); +} + +ReturnCode_t DynamicDataImpl::set_float32_value( + MemberId id, + float value) noexcept +{ + return set_value(id, value); +} + +ReturnCode_t DynamicDataImpl::set_float64_value( + MemberId id, + double value) noexcept +{ + return set_value(id, value); +} + +ReturnCode_t DynamicDataImpl::set_float128_value( + MemberId id, + long double value) noexcept +{ + return set_value(id, value); +} + +ReturnCode_t DynamicDataImpl::set_char8_value( + MemberId id, + char value) noexcept +{ + return set_value(id, value); +} + +ReturnCode_t DynamicDataImpl::set_char16_value( + MemberId id, + wchar_t value) noexcept +{ + return set_value(id, value); +} + +ReturnCode_t DynamicDataImpl::set_byte_value( + MemberId id, + eprosima::fastrtps::rtps::octet value) noexcept +{ + return set_value(id, value); +} + +ReturnCode_t DynamicDataImpl::set_boolean_value( + MemberId id, + bool value) noexcept +{ + return set_value(id, value); +} + +ReturnCode_t DynamicDataImpl::set_string_value( + MemberId id, + const std::string& value) noexcept +{ + if (TK_STRING8 == enclosing_type_->get_kind()) + { + assert(1 == enclosing_type_->get_descriptor().bound().size()); + auto bound = enclosing_type_->get_descriptor().bound().at(0); + if (static_cast(LENGTH_UNLIMITED) != bound && value.length() > bound) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, + "Error setting string value. The given string is greater than the length limit."); + return RETCODE_BAD_PARAMETER; + } + } + + return set_value(id, value); +} + +ReturnCode_t DynamicDataImpl::set_wstring_value( + MemberId id, + const std::wstring& value) noexcept +{ + if (TK_STRING16 == enclosing_type_->get_kind()) + { + assert(1 == enclosing_type_->get_descriptor().bound().size()); + auto bound = enclosing_type_->get_descriptor().bound().at(0); + if (static_cast(LENGTH_UNLIMITED) != bound && value.length() > bound) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, + "Error setting string value. The given string is greater than the length limit."); + return RETCODE_BAD_PARAMETER; + } + } + + return set_value(id, value); +} + +//}}} + +ReturnCode_t DynamicDataImpl::set_complex_value( + MemberId id, + traits::ref_type value) noexcept +{ + ReturnCode_t ret_value = RETCODE_BAD_PARAMETER; + + if (value && id != MEMBER_ID_INVALID) + { + TypeKind type_kind = enclosing_type_->get_kind(); + + if (TK_ANNOTATION == type_kind || + TK_BITSET == type_kind || + TK_STRUCTURE == type_kind || + TK_UNION == type_kind) + { + if (TK_UNION != type_kind || 0 != id) + { + auto it = value_.find(id); + if (it != value_.end()) + { + auto data = std::static_pointer_cast(it->second); + + if (data->type_->equals(value->type())) + { + value_.erase(it); + value_.emplace(id, value->clone()); + ret_value = RETCODE_OK; + } + else + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Error setting due to the fact that types are different."); + } + } + else + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Error setting complex value. MemberId not found."); + } + + if (RETCODE_OK == ret_value && TK_UNION == type_kind) // Set new discriminator. + { + set_discriminator_value(id); + } + } + } + else if (TK_ARRAY == type_kind || + TK_SEQUENCE == type_kind) + { + TypeKind element_kind = + get_enclosing_typekind(traits::narrow( + enclosing_type_->get_descriptor().element_type())); + if (enclosing_type_->get_descriptor().element_type()->equals(value->type()) && + is_complex_kind(element_kind)) + { + auto it = value_.cbegin(); + assert(value_.cend() != it && MEMBER_ID_INVALID == it->first); + auto sequence = + std::static_pointer_cast::ref_type>>(it->second); + assert(sequence); + if ((TK_ARRAY == type_kind && sequence->size() > id) || + (TK_SEQUENCE == type_kind && + (static_cast(LENGTH_UNLIMITED) == + enclosing_type_->get_descriptor().bound().at(0) || + enclosing_type_->get_descriptor().bound().at(0) > id))) + { + if (sequence->size() < id + 1) + { + sequence->resize(id + 1); + } + + auto pos = sequence->begin() + id; + pos = sequence->erase(pos); + sequence->emplace(pos, value->clone()); + ret_value = RETCODE_OK; + } + } + else + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Error setting due to the fact that types are different."); + } + } + else if (TK_MAP == type_kind) + { + TypeKind element_kind = + get_enclosing_typekind(traits::narrow( + enclosing_type_->get_descriptor().element_type())); + if (enclosing_type_->get_descriptor().element_type()->equals(value->type()) && + is_complex_kind(element_kind)) + { + auto it = value_.find(id); + if (it != value_.end()) + { + value_.erase(it); + value_.emplace(id, value->clone()); + ret_value = RETCODE_OK; + } + else + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Error setting complex value. MemberId not found."); + } + } + else + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Error setting due to the fact that types are different."); + } + } + } + else + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Error setting complex value. Invalid MemberId."); + } + + return ret_value; +} + +//{{{ Array setters + +ReturnCode_t DynamicDataImpl::set_int32_values( + MemberId id, + const Int32Seq& value) noexcept +{ + return set_sequence_values(id, value); +} + +ReturnCode_t DynamicDataImpl::set_uint32_values( + MemberId id, + const UInt32Seq& value) noexcept +{ + return set_sequence_values(id, value); +} + +ReturnCode_t DynamicDataImpl::set_int8_values( + MemberId id, + const Int8Seq& value) noexcept +{ + return set_sequence_values(id, value); +} + +ReturnCode_t DynamicDataImpl::set_uint8_values( + MemberId id, + const UInt8Seq& value) noexcept +{ + return set_sequence_values(id, value); +} + +ReturnCode_t DynamicDataImpl::set_int16_values( + MemberId id, + const Int16Seq& value) noexcept +{ + return set_sequence_values(id, value); +} + +ReturnCode_t DynamicDataImpl::set_uint16_values( + MemberId id, + const UInt16Seq& value) noexcept +{ + return set_sequence_values(id, value); +} + +ReturnCode_t DynamicDataImpl::set_int64_values( + MemberId id, + const Int64Seq& value) noexcept +{ + return set_sequence_values(id, value); +} + +ReturnCode_t DynamicDataImpl::set_uint64_values( + MemberId id, + const UInt64Seq& value) noexcept +{ + return set_sequence_values(id, value); +} + +ReturnCode_t DynamicDataImpl::set_float32_values( + MemberId id, + const Float32Seq& value) noexcept +{ + return set_sequence_values(id, value); +} + +ReturnCode_t DynamicDataImpl::set_float64_values( + MemberId id, + const Float64Seq& value) noexcept +{ + return set_sequence_values(id, value); +} + +ReturnCode_t DynamicDataImpl::set_float128_values( + MemberId id, + const Float128Seq& value) noexcept +{ + return set_sequence_values(id, value); +} + +ReturnCode_t DynamicDataImpl::set_char8_values( + MemberId id, + const CharSeq& value) noexcept +{ + return set_sequence_values(id, value); +} + +ReturnCode_t DynamicDataImpl::set_char16_values( + MemberId id, + const WcharSeq& value) noexcept +{ + return set_sequence_values(id, value); +} + +ReturnCode_t DynamicDataImpl::set_byte_values( + MemberId id, + const ByteSeq& value) noexcept +{ + return set_sequence_values(id, value); +} + +ReturnCode_t DynamicDataImpl::set_boolean_values( + MemberId id, + const BooleanSeq& value) noexcept +{ + return set_sequence_values(id, value); +} + +ReturnCode_t DynamicDataImpl::set_string_values( + MemberId id, + const StringSeq& value) noexcept +{ + TypeKind type_kind = enclosing_type_->get_kind(); + + if (TK_ARRAY == type_kind || + TK_SEQUENCE == type_kind) + { + auto element_type = + get_enclosing_type(traits::narrow( + enclosing_type_->get_descriptor().element_type())); + if (TK_STRING8 == element_type->get_kind()) + { + assert(1 == element_type->get_descriptor().bound().size()); + auto bound = element_type->get_descriptor().bound().at(0); + if (static_cast(LENGTH_UNLIMITED) != bound && + value.end() != std::find_if(value.begin(), value.end(), [bound](const std::string& str) + { + return str.length() > bound; + })) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, + "Error setting an array with a string value. The string is greater than the length limit."); + return RETCODE_BAD_PARAMETER; + } + } + else + { + EPROSIMA_LOG_ERROR(DYN_TYPES, + "Error setting an array with a string value when element_type is not STRING8."); + return RETCODE_BAD_PARAMETER; + } + } + + return set_sequence_values(id, value); +} + +ReturnCode_t DynamicDataImpl::set_wstring_values( + MemberId id, + const WstringSeq& value) noexcept +{ + TypeKind type_kind = enclosing_type_->get_kind(); + + if (TK_ARRAY == type_kind || + TK_SEQUENCE == type_kind) + { + auto element_type = + get_enclosing_type(traits::narrow( + enclosing_type_->get_descriptor().element_type())); + if (TK_STRING16 == element_type->get_kind()) + { + assert(1 == element_type->get_descriptor().bound().size()); + auto bound = element_type->get_descriptor().bound().at(0); + if (static_cast(LENGTH_UNLIMITED) != bound && + value.end() != std::find_if(value.begin(), value.end(), [bound](const std::wstring& str) + { + return str.length() > bound; + })) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, + "Error setting an array with a string value. The string is greater than the length limit."); + return RETCODE_BAD_PARAMETER; + } + } + else + { + EPROSIMA_LOG_ERROR(DYN_TYPES, + "Error setting an array with a string value when element_type is not STRING16."); + return RETCODE_BAD_PARAMETER; + } + } + + return set_sequence_values(id, value); +} + +//}}} + +//}}} + +traits::ref_type DynamicDataImpl::type() noexcept +{ + return type_; +} + +traits::ref_type DynamicDataImpl::_this() +{ + return shared_from_this(); +} + +//{{{ Encoding/decoding functions + +size_t DynamicDataImpl::calculate_key_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + size_t& current_alignment) const noexcept +{ + size_t calculated_size {0}; + + TypeKind type_kind = enclosing_type_->get_kind(); + + switch (type_kind) + { + default: + calculated_size = calculate_serialized_size(calculator, current_alignment); + break; + case TK_STRUCTURE: + { + bool there_is_keyed_member {false}; + for (auto& member : enclosing_type_->get_all_members()) + { + auto member_impl {traits::narrow(member.second)}; + if (member_impl->get_descriptor().is_key()) + { + there_is_keyed_member = true; + auto it = value_.find(member.first); + + if (it != value_.end()) + { + auto member_data {std::static_pointer_cast(it->second)}; + + calculated_size += calculator.calculate_member_serialized_size( + member.first, member_data, current_alignment); + } + else + { + EPROSIMA_LOG_ERROR(DYN_TYPES, + "Error calculating structure member size because it is not found on DynamicData"); + } + } + } + + if (!there_is_keyed_member) + { + for (auto& member : enclosing_type_->get_all_members()) + { + auto member_impl {traits::narrow(member.second)}; + auto member_type {traits::narrow(member_impl->get_descriptor().type())}; + + //TODO(richiware) For the future support of optionals. Optional member cannot be a keyed member. + if (TK_MAP != member_type->resolve_alias_enclosed_type()->get_kind()) + { + auto it = value_.find(member.first); + + if (it != value_.end()) + { + auto member_data {std::static_pointer_cast(it->second)}; + + calculated_size += calculator.calculate_member_serialized_size( + member.first, member_data, current_alignment); + } + else + { + EPROSIMA_LOG_ERROR(DYN_TYPES, + "Error calculating structure member size because it is not found on DynamicData"); + } + } + } + } + + break; + } + case TK_UNION: + { + // The union_id_ must be serialized as a discriminator_type_ + auto discriminator_data {std::static_pointer_cast(value_.at(0))}; + calculated_size += calculator.calculate_member_serialized_size( + 0, discriminator_data, current_alignment); + break; + } + } + + return calculated_size; +} + +size_t DynamicDataImpl::calculate_max_serialized_size( + traits::ref_type type, + size_t current_alignment) +{ + size_t initial_alignment {current_alignment}; + + auto type_impl = get_enclosing_type(traits::narrow(type)); + + switch (type_impl->get_kind()) + { + case TK_FLOAT128: + current_alignment += 16 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + break; + case TK_FLOAT64: + case TK_INT64: + case TK_UINT64: + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + break; + case TK_FLOAT32: + case TK_INT32: + case TK_UINT32: + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + break; + case TK_INT16: + case TK_UINT16: + case TK_CHAR16: + current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); + break; + case TK_CHAR8: + case TK_BYTE: + case TK_BOOLEAN: + case TK_INT8: + case TK_UINT8: + current_alignment += 1; + break; + case TK_STRING8: + { + size_t max_size = type_impl->get_descriptor().bound().at(0); + if (static_cast(LENGTH_UNLIMITED) == max_size) + { + max_size = 255; + } + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + max_size + 1; + break; + } + case TK_STRING16: + { + size_t max_size = type_impl->get_descriptor().bound().at(0); + if (static_cast(LENGTH_UNLIMITED) == max_size) + { + max_size = 255; + } + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + (max_size * 2); + break; + } + case TK_UNION: + { + size_t reset_alignment {0}; + size_t union_max_size_serialized {0}; + if (ExtensibilityKind::FINAL != type_impl->get_descriptor().extensibility_kind()) + { + // For APPENDABLE and MUTABLE, the maximum is the XCDR2 header (DHEADER(0) : Int32). + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + } + + current_alignment += calculate_max_serialized_size( + type_impl->get_descriptor().discriminator_type(), current_alignment); + + for (auto& member : type_impl->get_all_members_by_index()) + { + + auto member_impl = traits::narrow(member); + reset_alignment = current_alignment; + + if (ExtensibilityKind::MUTABLE == type_impl->get_descriptor().extensibility_kind() || + member->get_descriptor().is_optional()) + { + // If member is from a MUTABLE type (or it is optional member) the maximum is XCDR1 LongMemberHeader. + // << ALIGN(4) + // << { FLAG_I + FLAG_M + PID_EXTENDED : UInt16 } + // << { slength=8 : UInt16 } + // << { M.id : <<: UInt32 } + // << { M.value.ssize : UInt32 } + reset_alignment += 2 + 2 + 4 + 4 + eprosima::fastcdr::Cdr::alignment(reset_alignment, 4); + } + + reset_alignment += calculate_max_serialized_size( + member_impl->get_descriptor().type(), reset_alignment); + + if (union_max_size_serialized < reset_alignment) + { + union_max_size_serialized = reset_alignment; + } + } + + current_alignment = union_max_size_serialized; + + if (ExtensibilityKind::MUTABLE == type_impl->get_descriptor().extensibility_kind()) + { + // For MUTABLE, extra alignment for the PID_SENTINAL. + current_alignment += eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + } + break; + } + case TK_BITSET: + { + assert(0 < type_impl->get_all_members_by_index().size()); + auto sum {type_impl->get_all_members_by_index().rbegin()->get()->get_id() + + *type_impl->get_descriptor().bound().rbegin()}; + + if (9 > sum) + { + current_alignment += 1; + } + else if (17 > sum) + { + current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); + } + else if (33 > sum) + { + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + } + else + { + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + } + break; + } + case TK_STRUCTURE: + { + if (ExtensibilityKind::FINAL != type_impl->get_descriptor().extensibility_kind()) + { + // For APPENDABLE and MUTABLE, the maximum is the XCDR2 header (DHEADER(0) : Int32). + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + } + + for (auto& member : type_impl->get_all_members_by_index()) + { + auto member_impl = traits::narrow(member); + + if (ExtensibilityKind::MUTABLE == type_impl->get_descriptor().extensibility_kind() || + member->get_descriptor().is_optional()) + { + // If member is from a MUTABLE type (or it is optional member) the maximum is XCDR1 LongMemberHeader. + // << ALIGN(4) + // << { FLAG_I + FLAG_M + PID_EXTENDED : UInt16 } + // << { slength=8 : UInt16 } + // << { M.id : <<: UInt32 } + // << { M.value.ssize : UInt32 } + current_alignment += 2 + 2 + 4 + 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + } + + current_alignment += calculate_max_serialized_size( + member_impl->get_descriptor().type(), current_alignment); + } + + if (ExtensibilityKind::MUTABLE == type_impl->get_descriptor().extensibility_kind()) + { + // For MUTABLE, extra alignment for the PID_SENTINAL. + current_alignment += eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + } + break; + } + case TK_ARRAY: + { + TypeKind element_kind = + get_enclosing_typekind(traits::narrow( + type_impl->get_descriptor().element_type())); + + if (is_complex_kind(element_kind) || + TK_STRING8 == element_kind || + TK_STRING16 == element_kind) + { + // DHEADER if XCDRv2 + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + } + + auto dimension {std::accumulate(type_impl->get_descriptor().bound().begin(), + type_impl->get_descriptor().bound().end(), 1, std::multiplies())}; + + assert(0 < dimension); + current_alignment += calculate_max_serialized_size( + type_impl->get_descriptor().element_type(), current_alignment); + + if (1 < dimension) + { + auto element_size_after_first = calculate_max_serialized_size( + type_impl->get_descriptor().element_type(), current_alignment); + current_alignment += element_size_after_first * (dimension - 1); + } + + break; + } + case TK_SEQUENCE: + { + TypeKind element_kind = + get_enclosing_typekind(traits::narrow( + type_impl->get_descriptor().element_type())); + + if (is_complex_kind(element_kind) || + TK_STRING8 == element_kind || + TK_STRING16 == element_kind) + { + // DHEADER if XCDRv2 + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + } + + // Sequence length. + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + auto bound {type_impl->get_descriptor().bound().at(0)}; + + if (static_cast(LENGTH_UNLIMITED) != bound) + { + current_alignment += calculate_max_serialized_size( + type_impl->get_descriptor().element_type(), current_alignment); + + if (1 < bound) + { + auto element_size_after_first = calculate_max_serialized_size( + type_impl->get_descriptor().element_type(), current_alignment); + current_alignment += element_size_after_first * (bound - 1); + } + } + + + break; + } + case TK_MAP: + { + TypeKind element_kind { get_enclosing_typekind(traits::narrow( + type_impl->get_descriptor().element_type()))}; + + if (is_complex_kind(element_kind) || + TK_STRING8 == element_kind || + TK_STRING16 == element_kind) + { + // DHEADER if XCDRv2 + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + } + + // Map length + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + auto bound {type_impl->get_descriptor().bound().at(0)}; + + if (static_cast(LENGTH_UNLIMITED) != bound) + { + current_alignment += calculate_max_serialized_size( + type_impl->get_descriptor().key_element_type(), current_alignment); + current_alignment += calculate_max_serialized_size( + type_impl->get_descriptor().element_type(), current_alignment); + + if (1 < bound) + { + auto element_size_after_first = calculate_max_serialized_size( + type_impl->get_descriptor().key_element_type(), current_alignment); + element_size_after_first += calculate_max_serialized_size( + type_impl->get_descriptor().element_type(), current_alignment); + current_alignment += element_size_after_first * (bound - 1); + } + } + + break; + } + case TK_BITMASK: + { + assert(1 == type_impl->get_descriptor().bound().size()); + auto bound = type_impl->get_descriptor().bound().at(0); + + if (9 > bound) + { + current_alignment += 1; + } + else if (17 > bound) + { + current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); + } + else if (33 > bound) + { + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + } + else + { + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + } + } + break; + default: + break; + } + + return current_alignment - initial_alignment; +} + +size_t DynamicDataImpl::calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + size_t& current_alignment) const noexcept +{ + return calculate_serialized_size(calculator, enclosing_type_, current_alignment); +} + +bool DynamicDataImpl::deserialize( + eprosima::fastcdr::Cdr& cdr) +{ + return deserialize(cdr, enclosing_type_); +} + +void DynamicDataImpl::serialize( + eprosima::fastcdr::Cdr& cdr) const +{ + serialize(cdr, enclosing_type_); +} + +void DynamicDataImpl::serialize_key( + eprosima::fastcdr::Cdr& cdr) const noexcept +{ + TypeKind type_kind = enclosing_type_->get_kind(); + + switch (type_kind) + { + default: + serialize(cdr); + break; + case TK_STRUCTURE: + { + bool there_is_keyed_member {false}; + for (auto& member : enclosing_type_->get_all_members()) + { + auto member_impl {traits::narrow(member.second)}; + if (member_impl->get_descriptor().is_key()) + { + there_is_keyed_member = true; + auto it = value_.find(member.first); + + if (it != value_.end()) + { + auto member_data {std::static_pointer_cast(it->second)}; + + member_data->serialize_key(cdr); + } + else + { + EPROSIMA_LOG_ERROR(DYN_TYPES, + "Error serializing structure member because it is not found on DynamicData"); + } + } + } + + if (!there_is_keyed_member) + { + for (auto& member : enclosing_type_->get_all_members()) + { + auto member_impl {traits::narrow(member.second)}; + auto member_type {traits::narrow(member_impl->get_descriptor().type())}; + + if (TK_MAP != member_type->resolve_alias_enclosed_type()->get_kind()) + { + auto it = value_.find(member.first); + + if (it != value_.end()) + { + auto member_data {std::static_pointer_cast(it->second)}; + + member_data->serialize_key(cdr); + } + else + { + EPROSIMA_LOG_ERROR(DYN_TYPES, + "Error serializing structure member because it is not found on DynamicData"); + } + } + } + } + + break; + } + case TK_UNION: + { + // The union_id_ must be serialized as a discriminator_type_ + auto discriminator_data {std::static_pointer_cast(value_.at(0))}; + discriminator_data->serialize_key(cdr); + break; + } + } +} + +//}}} + +//}}} + +//{{{ Auxiliary functions + +template +void DynamicDataImpl::apply_bitset_mask( + MemberId member_id, + TypeForKind& value) const noexcept +{ + // Get member index. + assert(enclosing_type_->get_all_members().end() != enclosing_type_->get_all_members().find(member_id)); + const auto member_impl {traits::narrow( + enclosing_type_->get_all_members().at(member_id))}; + const auto member_index {member_impl->get_descriptor().index()}; + const auto bound {enclosing_type_->get_descriptor().bound().at(member_index)}; + uint64_t mask {0XFFFFFFFFFFFFFFFFllu << bound}; + value &= static_cast>(~mask); +} + +template<> +void DynamicDataImpl::apply_bitset_mask( + MemberId, + TypeForKind&) const noexcept +{ + assert(false); +} + +template<> +void DynamicDataImpl::apply_bitset_mask( + MemberId, + TypeForKind&) const noexcept +{ + assert(false); +} + +template<> +void DynamicDataImpl::apply_bitset_mask( + MemberId, + TypeForKind&) const noexcept +{ + assert(false); +} + +template<> +void DynamicDataImpl::apply_bitset_mask( + MemberId, + TypeForKind&) const noexcept +{ + assert(false); +} + +template<> +void DynamicDataImpl::apply_bitset_mask( + MemberId, + TypeForKind&) const noexcept +{ + assert(false); +} + +template<> +void DynamicDataImpl::apply_bitset_mask( + MemberId, + TypeForKind&) const noexcept +{ + assert(false); +} + +template<> +void DynamicDataImpl::apply_bitset_mask( + MemberId, + TypeForKind&) const noexcept +{ + assert(false); +} + +void DynamicDataImpl::add_sequence_value( + const traits::ref_type& sequence_type, + uint32_t sequence_size) noexcept +{ + if (is_complex_kind(sequence_type->get_kind())) + { + value_.emplace(MEMBER_ID_INVALID, + std::make_shared::ref_type>>(sequence_size)); + auto vector = std::static_pointer_cast ::ref_type >> ( + value_.begin()->second); + fill_vector_with_dynamic_data(vector, sequence_type); + } + else + { + switch (sequence_type->get_kind()) + { + case TK_INT32: + { + value_.emplace(MEMBER_ID_INVALID, std::make_shared>(sequence_size)); + } + break; + case TK_UINT32: + { + value_.emplace(MEMBER_ID_INVALID, std::make_shared>(sequence_size)); + } + break; + case TK_INT8: + { + value_.emplace(MEMBER_ID_INVALID, std::make_shared>(sequence_size)); + } + break; + case TK_INT16: + { + value_.emplace(MEMBER_ID_INVALID, std::make_shared>(sequence_size)); + } + break; + case TK_UINT16: + { + value_.emplace(MEMBER_ID_INVALID, std::make_shared>(sequence_size)); + } + break; + case TK_INT64: + { + value_.emplace(MEMBER_ID_INVALID, std::make_shared>(sequence_size)); + } + break; + case TK_UINT64: + { + value_.emplace(MEMBER_ID_INVALID, std::make_shared>(sequence_size)); + } + break; + case TK_FLOAT32: + { + value_.emplace(MEMBER_ID_INVALID, std::make_shared>(sequence_size)); + } + break; + case TK_FLOAT64: + { + value_.emplace(MEMBER_ID_INVALID, std::make_shared>(sequence_size)); + } + break; + case TK_FLOAT128: + { + value_.emplace(MEMBER_ID_INVALID, + std::make_shared>(sequence_size)); + } + break; + case TK_CHAR8: + { + value_.emplace(MEMBER_ID_INVALID, std::make_shared>(sequence_size)); + } + break; + case TK_CHAR16: + { + value_.emplace(MEMBER_ID_INVALID, std::make_shared>(sequence_size)); + } + break; + case TK_BOOLEAN: + { + value_.emplace(MEMBER_ID_INVALID, std::make_shared>(sequence_size)); + } + break; + case TK_BYTE: + { + value_.emplace(MEMBER_ID_INVALID, std::make_shared>(sequence_size)); + } + break; + case TK_UINT8: + { + value_.emplace(MEMBER_ID_INVALID, std::make_shared>(sequence_size)); + } + break; + case TK_STRING8: + { + value_.emplace(MEMBER_ID_INVALID, std::make_shared>(sequence_size)); + } + break; + case TK_STRING16: + { + value_.emplace(MEMBER_ID_INVALID, std::make_shared>(sequence_size)); + } + break; + default: + break; + } + } +} + +std::map>::iterator DynamicDataImpl::add_value( + TypeKind kind, + MemberId id) noexcept +{ + std::map>::iterator ret_value {value_.end()}; + + switch (kind) + { + case TK_INT32: + { + ret_value = value_.emplace(id, std::make_shared>()).first; + } + break; + case TK_UINT32: + { + ret_value = value_.emplace(id, std::make_shared>()).first; + } + break; + case TK_INT8: + { + ret_value = value_.emplace(id, std::make_shared>()).first; + } + break; + case TK_INT16: + { + ret_value = value_.emplace(id, std::make_shared>()).first; + } + break; + case TK_UINT16: + { + ret_value = value_.emplace(id, std::make_shared>()).first; + } + break; + case TK_INT64: + { + ret_value = value_.emplace(id, std::make_shared>()).first; + } + break; + case TK_UINT64: + { + ret_value = value_.emplace(id, std::make_shared>()).first; + } + break; + case TK_FLOAT32: + { + ret_value = value_.emplace(id, std::make_shared>()).first; + } + break; + case TK_FLOAT64: + { + ret_value = value_.emplace(id, std::make_shared>()).first; + } + break; + case TK_FLOAT128: + { + ret_value = value_.emplace(id, std::make_shared>()).first; + } + break; + case TK_CHAR8: + { + ret_value = value_.emplace(id, std::make_shared>()).first; + } + break; + case TK_CHAR16: + { + ret_value = value_.emplace(id, std::make_shared>()).first; + } + break; + case TK_BOOLEAN: + { + ret_value = value_.emplace(id, std::make_shared>()).first; + } + break; + case TK_BYTE: + { + ret_value = value_.emplace(id, std::make_shared>()).first; + } + break; + case TK_UINT8: + { + ret_value = value_.emplace(id, std::make_shared>()).first; + } + break; + case TK_STRING8: + { + ret_value = value_.emplace(id, std::make_shared>()).first; + } + break; + case TK_STRING16: + { + ret_value = value_.emplace(id, std::make_shared>()).first; + } + break; + default: + break; + } + + return ret_value; +} + +uint32_t DynamicDataImpl::calculate_array_max_elements( + TypeKind type_kind) noexcept +{ + uint32_t ret_value {0}; + + assert(TK_ARRAY == type_kind || TK_SEQUENCE == type_kind); + + if (TK_ARRAY == type_kind) + { + auto bounds_it {enclosing_type_->get_descriptor().bound().cbegin()}; + assert(bounds_it != enclosing_type_->get_descriptor().bound().cend()); + ret_value = *bounds_it; + + while (++bounds_it != enclosing_type_->get_descriptor().bound().cend()) + { + ret_value *= *bounds_it; + } + } + + return ret_value; +} + +ReturnCode_t DynamicDataImpl::clear_all_sequence( + TypeKind type_kind) noexcept +{ + ReturnCode_t ret_value = RETCODE_OK; + + assert(TK_ARRAY == type_kind || TK_SEQUENCE == type_kind); + auto element_type = + get_enclosing_type(traits::narrow( + enclosing_type_->get_descriptor().element_type())); + + uint32_t sequence_size {calculate_array_max_elements(type_kind)}; + + switch (element_type->get_kind()) + { + case TK_INT32: + std::static_pointer_cast>(value_.begin()->second)->clear(); + std::static_pointer_cast>(value_.begin()->second)->resize(sequence_size); + break; + case TK_UINT32: + std::static_pointer_cast>(value_.begin()->second)->clear(); + std::static_pointer_cast>(value_.begin()->second)->resize(sequence_size); + break; + case TK_INT8: + std::static_pointer_cast>(value_.begin()->second)->clear(); + std::static_pointer_cast>(value_.begin()->second)->resize(sequence_size); + break; + case TK_INT16: + std::static_pointer_cast>(value_.begin()->second)->clear(); + std::static_pointer_cast>(value_.begin()->second)->resize(sequence_size); + break; + case TK_UINT16: + std::static_pointer_cast>(value_.begin()->second)->clear(); + std::static_pointer_cast>(value_.begin()->second)->resize(sequence_size); + break; + case TK_INT64: + std::static_pointer_cast>(value_.begin()->second)->clear(); + std::static_pointer_cast>(value_.begin()->second)->resize(sequence_size); + break; + case TK_UINT64: + std::static_pointer_cast>(value_.begin()->second)->clear(); + std::static_pointer_cast>(value_.begin()->second)->resize(sequence_size); + break; + case TK_FLOAT32: + std::static_pointer_cast>(value_.begin()->second)->clear(); + std::static_pointer_cast>(value_.begin()->second)->resize(sequence_size); + break; + case TK_FLOAT64: + std::static_pointer_cast>(value_.begin()->second)->clear(); + std::static_pointer_cast>(value_.begin()->second)->resize(sequence_size); + break; + case TK_FLOAT128: + std::static_pointer_cast>(value_.begin()->second)->clear(); + std::static_pointer_cast>(value_.begin()->second)->resize(sequence_size); + break; + case TK_CHAR8: + std::static_pointer_cast>(value_.begin()->second)->clear(); + std::static_pointer_cast>(value_.begin()->second)->resize(sequence_size); + break; + case TK_CHAR16: + std::static_pointer_cast>(value_.begin()->second)->clear(); + std::static_pointer_cast>(value_.begin()->second)->resize(sequence_size); + break; + case TK_BOOLEAN: + std::static_pointer_cast>(value_.begin()->second)->clear(); + std::static_pointer_cast>(value_.begin()->second)->resize(sequence_size); + break; + case TK_BYTE: + std::static_pointer_cast>(value_.begin()->second)->clear(); + std::static_pointer_cast>(value_.begin()->second)->resize(sequence_size); + break; + case TK_UINT8: + std::static_pointer_cast>(value_.begin()->second)->clear(); + std::static_pointer_cast>(value_.begin()->second)->resize(sequence_size); + break; + case TK_STRING8: + std::static_pointer_cast>(value_.begin()->second)->clear(); + std::static_pointer_cast>(value_.begin()->second)->resize(sequence_size); + break; + case TK_STRING16: + std::static_pointer_cast>(value_.begin()->second)->clear(); + std::static_pointer_cast>(value_.begin()->second)->resize(sequence_size); + break; + default: + auto vector = std::static_pointer_cast ::ref_type >> ( + value_.begin()->second); + vector->clear(); + vector->resize(sequence_size); + fill_vector_with_dynamic_data(vector, element_type); + break; + } + + return ret_value; +} + +ReturnCode_t DynamicDataImpl::clear_all_values( + bool only_non_keyed) noexcept +{ + ReturnCode_t ret_val = RETCODE_OK; + TypeKind type_kind = enclosing_type_->get_kind(); + + if (TK_ARRAY == type_kind || + TK_SEQUENCE == type_kind) + { + ret_val = clear_all_sequence(type_kind); + } + else if (TK_MAP == type_kind) + { + next_map_member_id_ = 0; + key_to_id_.clear(); + value_.clear(); + } + else if (TK_BITMASK == type_kind) + { + assert(1 == value_.size()); + assert(1 == enclosing_type_->get_descriptor().bound().size()); + auto sequence = std::static_pointer_cast>(value_.begin()->second); + assert(sequence->size() == enclosing_type_->get_descriptor().bound().at(0)); + sequence->assign(sequence->size(), false); + } + else if (TK_ANNOTATION == type_kind || + TK_BITSET == type_kind || + TK_STRUCTURE == type_kind || + TK_UNION == type_kind) + { + const auto& members = enclosing_type_->get_all_members(); + for (auto& value_element : value_) + { + const auto it = members.find(value_element.first); + assert(members.end() != it); + auto member = traits::narrow(it->second); + if (!only_non_keyed || !member->get_descriptor().is_key()) + { + auto data = std::static_pointer_cast(value_element.second); + + data->clear_all_values(); + set_default_value(member, data); + } + } + } + else + { + set_value(""); + } + + return ret_val; +} + +ReturnCode_t DynamicDataImpl::clear_sequence_element( + TypeKind type_kind, + MemberId id) noexcept +{ + ReturnCode_t ret_value = RETCODE_BAD_PARAMETER; + + assert(TK_ARRAY == type_kind || TK_SEQUENCE == type_kind); + + auto element_type = + get_enclosing_type(traits::narrow( + enclosing_type_->get_descriptor().element_type())); + + switch (element_type->get_kind()) + { + case TK_INT32: + { + auto seq = std::static_pointer_cast>(value_.begin()->second); + ret_value = clear_sequence_typed_element(seq, type_kind, id); + break; + } + case TK_UINT32: + { + auto seq = std::static_pointer_cast>(value_.begin()->second); + ret_value = clear_sequence_typed_element(seq, type_kind, id); + break; + } + case TK_INT8: + { + auto seq = std::static_pointer_cast>(value_.begin()->second); + ret_value = clear_sequence_typed_element(seq, type_kind, id); + break; + } + case TK_INT16: + { + auto seq = std::static_pointer_cast>(value_.begin()->second); + ret_value = clear_sequence_typed_element(seq, type_kind, id); + break; + } + case TK_UINT16: + { + auto seq = std::static_pointer_cast>(value_.begin()->second); + ret_value = clear_sequence_typed_element(seq, type_kind, id); + break; + } + case TK_INT64: + { + auto seq = std::static_pointer_cast>(value_.begin()->second); + ret_value = clear_sequence_typed_element(seq, type_kind, id); + break; + } + case TK_UINT64: + { + auto seq = std::static_pointer_cast>(value_.begin()->second); + ret_value = clear_sequence_typed_element(seq, type_kind, id); + break; + } + case TK_FLOAT32: + { + auto seq = std::static_pointer_cast>(value_.begin()->second); + ret_value = clear_sequence_typed_element(seq, type_kind, id); + break; + } + case TK_FLOAT64: + { + auto seq = std::static_pointer_cast>(value_.begin()->second); + ret_value = clear_sequence_typed_element(seq, type_kind, id); + break; + } + case TK_FLOAT128: + { + auto seq = std::static_pointer_cast>(value_.begin()->second); + ret_value = clear_sequence_typed_element(seq, type_kind, id); + break; + } + case TK_CHAR8: + { + auto seq = std::static_pointer_cast>(value_.begin()->second); + ret_value = clear_sequence_typed_element(seq, type_kind, id); + break; + } + case TK_CHAR16: + { + auto seq = std::static_pointer_cast>(value_.begin()->second); + ret_value = clear_sequence_typed_element(seq, type_kind, id); + break; + } + case TK_BOOLEAN: + { + auto seq = std::static_pointer_cast>(value_.begin()->second); + ret_value = clear_sequence_typed_element(seq, type_kind, id); + break; + } + case TK_BYTE: + { + auto seq = std::static_pointer_cast>(value_.begin()->second); + ret_value = clear_sequence_typed_element(seq, type_kind, id); + break; + } + case TK_UINT8: + { + auto seq = std::static_pointer_cast>(value_.begin()->second); + ret_value = clear_sequence_typed_element(seq, type_kind, id); + break; + } + case TK_STRING8: + { + auto seq = std::static_pointer_cast>(value_.begin()->second); + ret_value = clear_sequence_typed_element(seq, type_kind, id); + break; + } + case TK_STRING16: + { + auto seq = std::static_pointer_cast>(value_.begin()->second); + ret_value = clear_sequence_typed_element(seq, type_kind, id); + break; + } + default: + auto seq = std::static_pointer_cast::ref_type>>( + value_.begin()->second); + if (seq->size() > id) + { + auto it = seq->erase(seq->begin() + id); + if (TK_ARRAY == type_kind) + { + it = seq->emplace(it); + *it = traits::narrow( + DynamicDataFactory::get_instance()->create_data(element_type)); + } + ret_value = RETCODE_OK; + } + break; + } + + return ret_value; +} + +std::shared_ptr DynamicDataImpl::clone_primitive( + TypeKind type_kind, + const std::shared_ptr& primitive) const noexcept +{ + switch (type_kind) + { + case TK_INT32: { + return std::make_shared>(*std::static_pointer_cast>( + primitive)); + } + case TK_UINT32: { + return std::make_shared>(*std::static_pointer_cast>( + primitive)); + } + case TK_INT8: { + return std::make_shared>(*std::static_pointer_cast>( + primitive)); + } + case TK_INT16: { + return std::make_shared>(*std::static_pointer_cast>( + primitive)); + } + case TK_UINT16: { + return std::make_shared>(*std::static_pointer_cast>( + primitive)); + } + case TK_INT64: { + return std::make_shared>(*std::static_pointer_cast>( + primitive)); + } + case TK_UINT64: { + return std::make_shared>(*std::static_pointer_cast>( + primitive)); + } + case TK_FLOAT32: { + return std::make_shared>(*std::static_pointer_cast>( + primitive)); + } + case TK_FLOAT64: { + return std::make_shared>(*std::static_pointer_cast>( + primitive)); + } + case TK_FLOAT128: { + return std::make_shared>(*std::static_pointer_cast>( + primitive)); + } + case TK_CHAR8: { + return std::make_shared>(*std::static_pointer_cast>( + primitive)); + } + case TK_CHAR16: { + return std::make_shared>(*std::static_pointer_cast>( + primitive)); + } + case TK_BOOLEAN: { + return std::make_shared>(*std::static_pointer_cast>( + primitive)); + } + case TK_BYTE: { + return std::make_shared>(*std::static_pointer_cast>( + primitive)); + } + case TK_UINT8: { + return std::make_shared>(*std::static_pointer_cast>( + primitive)); + } + case TK_STRING8: { + return std::make_shared>(*std::static_pointer_cast>( + primitive)); + } + case TK_STRING16: { + return std::make_shared>(*std::static_pointer_cast>( + primitive)); + } + default: { + assert(false); + break; + } + } + return {}; +} + +std::shared_ptr DynamicDataImpl::clone_sequence( + TypeKind element_kind, + const std::shared_ptr& sequence) const noexcept +{ + switch (element_kind) + { + case TK_INT32: { + return std::make_shared>(*std::static_pointer_cast>( + sequence)); + } + case TK_UINT32: { + return std::make_shared>(*std::static_pointer_cast>( + sequence)); + } + case TK_INT8: { + return std::make_shared>(*std::static_pointer_cast>( + sequence)); + } + case TK_INT16: { + return std::make_shared>(*std::static_pointer_cast>( + sequence)); + } + case TK_UINT16: { + return std::make_shared>(*std::static_pointer_cast>( + sequence)); + } + case TK_INT64: { + return std::make_shared>(*std::static_pointer_cast>( + sequence)); + } + case TK_UINT64: { + return std::make_shared>(*std::static_pointer_cast>( + sequence)); + } + case TK_FLOAT32: { + return std::make_shared>(*std::static_pointer_cast>( + sequence)); + } + case TK_FLOAT64: { + return std::make_shared>(*std::static_pointer_cast>( + sequence)); + } + case TK_FLOAT128: { + return std::make_shared>(*std::static_pointer_cast>( + sequence)); + } + case TK_CHAR8: { + return std::make_shared>(*std::static_pointer_cast>( + sequence)); + } + case TK_CHAR16: { + return std::make_shared>(*std::static_pointer_cast>( + sequence)); + } + case TK_BOOLEAN: { + return std::make_shared>(*std::static_pointer_cast>( + sequence)); + } + case TK_BYTE: { + return std::make_shared>(*std::static_pointer_cast>( + sequence)); + } + case TK_UINT8: { + return std::make_shared>(*std::static_pointer_cast>( + sequence)); + } + case TK_STRING8: { + return std::make_shared>(*std::static_pointer_cast>( + sequence)); + } + case TK_STRING16: { + return std::make_shared>(*std::static_pointer_cast>( + sequence)); + } + default: { + auto ret_value = std::make_shared::ref_type>>(); + const auto& sequence_complex = + *std::static_pointer_cast::ref_type>>(sequence); + + for (const auto& element : sequence_complex) + { + ret_value->push_back(element->clone()); + } + + return ret_value; + } + break; + } +} + +bool DynamicDataImpl::compare_sequence_values( + TypeKind kind, + std::shared_ptr l, + std::shared_ptr r) const noexcept +{ + void* left = l.get(); + void* right = r.get(); + + switch (kind) + { + case TK_INT32: { + return *(reinterpret_cast*>(left)) == + *(reinterpret_cast*>(right)); + } + case TK_UINT32: { + return *(reinterpret_cast*>(left)) == + *(reinterpret_cast*>(right)); + } + case TK_INT8: { + return *(reinterpret_cast*>(left)) == + *(reinterpret_cast*>(right)); + } + case TK_INT16: { + return *(reinterpret_cast*>(left)) == + *(reinterpret_cast*>(right)); + } + case TK_UINT16: { + return *(reinterpret_cast*>(left)) == + *(reinterpret_cast*>(right)); + } + case TK_INT64: { + return *(reinterpret_cast*>(left)) == + *(reinterpret_cast*>(right)); + } + case TK_UINT64: { + return *(reinterpret_cast*>(left)) == + *(reinterpret_cast*>(right)); + } + case TK_FLOAT32: { + return *(reinterpret_cast*>(left)) == + *(reinterpret_cast*>(right)); + } + case TK_FLOAT64: { + return *(reinterpret_cast*>(left)) == + *(reinterpret_cast*>(right)); + } + case TK_FLOAT128: { + return *(reinterpret_cast*>(left)) == + *(reinterpret_cast*>(right)); + } + case TK_CHAR8: { + return *(reinterpret_cast*>(left)) == + *(reinterpret_cast*>(right)); + } + case TK_CHAR16: { + return *(reinterpret_cast*>(left)) == + *(reinterpret_cast*>(right)); + } + case TK_BOOLEAN: { + return *(reinterpret_cast*>(left)) == + *(reinterpret_cast*>(right)); + } + case TK_BYTE: { + return *(reinterpret_cast*>(left)) == + *(reinterpret_cast*>(right)); + } + case TK_UINT8: { + return *(reinterpret_cast*>(left)) == + *(reinterpret_cast*>(right)); + } + case TK_STRING8: { + return *(reinterpret_cast*>(left)) == + *(reinterpret_cast*>(right)); + } + case TK_STRING16: { + return *(reinterpret_cast*>(left)) == + *(reinterpret_cast*>(right)); + } + default: { + auto* dl = (std::vector::ref_type>*)left; + auto* dr = (std::vector::ref_type>*)right; + return dl->size() == dr->size() && std::equal(dl->begin(), dl->end(), dr->begin(), + [](traits::ref_type& x, traits::ref_type& y) + { + return x->equals(y); + }); + } + break; + } + return false; +} + +bool DynamicDataImpl::compare_values( + TypeKind kind, + std::shared_ptr l, + std::shared_ptr r) const noexcept +{ + void* left = l.get(); + void* right = r.get(); + + switch (kind) + { + case TK_INT32: { + return *(reinterpret_cast*>(left)) == + *(reinterpret_cast*>(right)); + } + case TK_UINT32: { + return *(reinterpret_cast*>(left)) == + *(reinterpret_cast*>(right)); + } + case TK_INT8: { + return *(reinterpret_cast*>(left)) == + *(reinterpret_cast*>(right)); + } + case TK_INT16: { + return *(reinterpret_cast*>(left)) == + *(reinterpret_cast*>(right)); + } + case TK_UINT16: { + return *(reinterpret_cast*>(left)) == + *(reinterpret_cast*>(right)); + } + case TK_INT64: { + return *(reinterpret_cast*>(left)) == + *(reinterpret_cast*>(right)); + } + case TK_UINT64: { + return *(reinterpret_cast*>(left)) == + *(reinterpret_cast*>(right)); + } + case TK_FLOAT32: { + return *(reinterpret_cast*>(left)) == + *(reinterpret_cast*>(right)); + } + case TK_FLOAT64: { + return *(reinterpret_cast*>(left)) == + *(reinterpret_cast*>(right)); + } + case TK_FLOAT128: { + return *(reinterpret_cast*>(left)) == + *(reinterpret_cast*>(right)); + } + case TK_CHAR8: { + return *(reinterpret_cast*>(left)) == + *(reinterpret_cast*>(right)); + } + case TK_CHAR16: { + return *(reinterpret_cast*>(left)) == + *(reinterpret_cast*>(right)); + } + case TK_BOOLEAN: { + return *(reinterpret_cast*>(left)) == + *(reinterpret_cast*>(right)); + } + case TK_BYTE: { + return *(reinterpret_cast*>(left)) == + *(reinterpret_cast*>(right)); + } + case TK_UINT8: { + return *(reinterpret_cast*>(left)) == + *(reinterpret_cast*>(right)); + } + case TK_STRING8: { + return *(reinterpret_cast*>(left)) == + *(reinterpret_cast*>(right)); + } + case TK_STRING16: { + return *(reinterpret_cast*>(left)) == + *(reinterpret_cast*>(right)); + } + default: + break; + } + return false; +} + +template +ReturnCode_t DynamicDataImpl::get_bitmask_bit( + TypeForKind& value, + MemberId id) noexcept +{ + ReturnCode_t ret_value = RETCODE_BAD_PARAMETER; + auto sequence = std::static_pointer_cast>(value_.begin()->second); + assert(sequence); + + if (MEMBER_ID_INVALID != id) + { + // Check MemberId was defined as a BITMASK member and retrieve the value. + if (enclosing_type_->get_all_members().end() != enclosing_type_->get_all_members().find(id)) + { + if (sequence->size() > id && (TK_BOOLEAN == TK || TypePromotion::value)) + { + value = static_cast>(sequence->at(id)); + ret_value = RETCODE_OK; + } + } + } + else + { + auto bound {enclosing_type_->get_descriptor().bound().at(0)}; + bool valid_promotion {false}; + + if (9 > bound && TypePromotion::value) + { + valid_promotion = true; + } + else if (17 > bound && TypePromotion::value) + { + valid_promotion = true; + } + else if (33 > bound && TypePromotion::value) + { + valid_promotion = true; + } + else if (TypePromotion::value) + { + valid_promotion = true; + } + + if (valid_promotion) + { + uint64_t value_set {0}; + for (size_t pos {0}; pos < sequence->size(); ++pos) + { + if (sequence->at(pos)) + { + value_set |= 0x1ull << pos; + } + } + + value = static_cast>(value_set); + ret_value = RETCODE_OK; + } + } + + return ret_value; +} + +template<> +ReturnCode_t DynamicDataImpl::get_bitmask_bit( + TypeForKind&, + MemberId) noexcept +{ + return RETCODE_BAD_PARAMETER; +} + +template<> +ReturnCode_t DynamicDataImpl::get_bitmask_bit( + TypeForKind&, + MemberId) noexcept +{ + return RETCODE_BAD_PARAMETER; +} + +traits::ref_type DynamicDataImpl::get_enclosing_type( + traits::ref_type type) noexcept +{ + traits::ref_type ret_value = type->resolve_alias_enclosed_type(); + + if (TK_ENUM == ret_value->get_kind()) // If enum, get enclosing type. + { + assert(0 < ret_value->get_all_members_by_index().size()); + ret_value = traits::narrow(ret_value->get_all_members_by_index().at( + 0)->get_descriptor().type()); + } + + return ret_value; +} + +TypeKind DynamicDataImpl::get_enclosing_typekind( + traits::ref_type type) noexcept +{ + return get_enclosing_type(type)->get_kind(); +} + +template +ReturnCode_t DynamicDataImpl::get_primitive_value( + TypeKind element_kind, + std::map>::iterator value_iterator, + TypeForKind& value, + MemberId member_id) noexcept +{ + ReturnCode_t ret_value = RETCODE_BAD_PARAMETER; + + if (TK == element_kind) + { + value = *std::static_pointer_cast>(value_iterator->second); + ret_value = RETCODE_OK; + } + else + { + switch (element_kind) + { + case TK_INT8: + if (TypePromotion::value) + { + assert(MEMBER_ID_INVALID == member_id); + value = + static_cast>(*std::static_pointer_cast>( + value_iterator->second)); + ret_value = RETCODE_OK; + } + break; + case TK_UINT8: + if (TypePromotion::value) + { + assert(MEMBER_ID_INVALID == member_id); + value = + static_cast>(*std::static_pointer_cast>( + value_iterator->second)); + ret_value = RETCODE_OK; + } + break; + case TK_INT16: + if (TypePromotion::value) + { + assert(MEMBER_ID_INVALID == member_id); + value = + static_cast>(*std::static_pointer_cast>( + value_iterator->second)); + ret_value = RETCODE_OK; + } + break; + case TK_UINT16: + if (TypePromotion::value) + { + assert(MEMBER_ID_INVALID == member_id); + value = + static_cast>(*std::static_pointer_cast>( + value_iterator->second)); + ret_value = RETCODE_OK; + } + break; + case TK_INT32: + if (TypePromotion::value) + { + assert(MEMBER_ID_INVALID == member_id); + value = + static_cast>(*std::static_pointer_cast>( + value_iterator->second)); + ret_value = RETCODE_OK; + } + break; + case TK_UINT32: + if (TypePromotion::value) + { + assert(MEMBER_ID_INVALID == member_id); + value = + static_cast>(*std::static_pointer_cast>( + value_iterator->second)); + ret_value = RETCODE_OK; + } + break; + case TK_INT64: + if (TypePromotion::value) + { + assert(MEMBER_ID_INVALID == member_id); + value = + static_cast>(*std::static_pointer_cast>( + value_iterator->second)); + ret_value = RETCODE_OK; + } + break; + case TK_UINT64: + if (TypePromotion::value) + { + assert(MEMBER_ID_INVALID == member_id); + value = + static_cast>(*std::static_pointer_cast>( + value_iterator->second)); + ret_value = RETCODE_OK; + } + break; + case TK_FLOAT32: + if (TypePromotion::value) + { + assert(MEMBER_ID_INVALID == member_id); + value = + static_cast>(*std::static_pointer_cast>( + value_iterator->second)); + ret_value = RETCODE_OK; + } + break; + case TK_FLOAT64: + if (TypePromotion::value) + { + assert(MEMBER_ID_INVALID == member_id); + value = + static_cast>(*std::static_pointer_cast>( + value_iterator->second)); + ret_value = RETCODE_OK; + } + break; + case TK_FLOAT128: + if (TypePromotion::value) + { + assert(MEMBER_ID_INVALID == member_id); + value = + static_cast>(*std::static_pointer_cast>( + value_iterator->second)); + ret_value = RETCODE_OK; + } + break; + case TK_CHAR8: + if (TypePromotion::value) + { + assert(MEMBER_ID_INVALID == member_id); + value = + static_cast>(*std::static_pointer_cast>( + value_iterator->second)); + ret_value = RETCODE_OK; + } + break; + case TK_CHAR16: + if (TypePromotion::value) + { + assert(MEMBER_ID_INVALID == member_id); + value = + static_cast>(*std::static_pointer_cast>( + value_iterator->second)); + ret_value = RETCODE_OK; + } + break; + case TK_BYTE: + if (TypePromotion::value) + { + assert(MEMBER_ID_INVALID == member_id); + value = + static_cast>(*std::static_pointer_cast>( + value_iterator->second)); + ret_value = RETCODE_OK; + } + break; + case TK_BOOLEAN: + if (TypePromotion::value) + { + assert(MEMBER_ID_INVALID == member_id); + value = + static_cast>(*std::static_pointer_cast>( + value_iterator->second)); + ret_value = RETCODE_OK; + } + break; + case TK_STRING8: + if (MEMBER_ID_INVALID != member_id && (TK == TK_CHAR8 || TypePromotion::value)) + { + auto str = std::static_pointer_cast>(value_iterator->second); + if (member_id < str->length()) + { + value = str->at(member_id); + ret_value = RETCODE_OK; + } + + } + break; + case TK_STRING16: + if (MEMBER_ID_INVALID != member_id && (TK == TK_CHAR16 || TypePromotion::value)) + { + auto str = std::static_pointer_cast>(value_iterator->second); + if (member_id < str->length()) + { + value = static_cast>(str->at(member_id)); + ret_value = RETCODE_OK; + } + + } + break; + default: + break; + } + } + + return ret_value; +} + +/*! + * Specialization for TK_STRING8. + * @param[in] member_id Indicates the position of the character to be returned. MEMBER_ID_INVALID can be used to + * return all the string instead of a single character. + */ +template<> +ReturnCode_t DynamicDataImpl::get_primitive_value( + TypeKind element_kind, + std::map>::iterator value_iterator, + TypeForKind& value, + MemberId member_id) noexcept +{ + ReturnCode_t ret_value = RETCODE_BAD_PARAMETER; + + if (TK_STRING8 == element_kind) + { + auto str = std::static_pointer_cast>(value_iterator->second); + + if (MEMBER_ID_INVALID == member_id) + { + value = *str; + ret_value = RETCODE_OK; + } + else if (member_id < str->length()) + { + value = str->at(member_id); + ret_value = RETCODE_OK; + } + } + + return ret_value; +} + +/*! + * Specialization for TK_STRING16. + * @param[in] member_id Indicates the position of the character to be returned. MEMBER_ID_INVALID can be used to + * return all the string instead of a single character. + */ +template<> +ReturnCode_t DynamicDataImpl::get_primitive_value( + TypeKind element_kind, + std::map>::iterator value_iterator, + TypeForKind& value, + MemberId member_id) noexcept +{ + ReturnCode_t ret_value = RETCODE_BAD_PARAMETER; + + if (TK_STRING16 == element_kind) + { + auto str = std::static_pointer_cast>(value_iterator->second); + + if (MEMBER_ID_INVALID == member_id) + { + value = *str; + ret_value = RETCODE_OK; + } + else if (member_id < str->length()) + { + value = str->at(member_id); + ret_value = RETCODE_OK; + } + } + + return ret_value; +} + +uint32_t DynamicDataImpl::get_sequence_length() +{ + assert(TK_ARRAY == enclosing_type_->get_kind() || TK_SEQUENCE == enclosing_type_->get_kind()); + assert(enclosing_type_->get_descriptor().element_type()); + assert(1 == value_.size()); + + size_t ret_value {0}; + TypeKind type_kind = + get_enclosing_typekind(traits::narrow( + enclosing_type_->get_descriptor().element_type())); + + switch (type_kind) + { + case TK_INT32: + { + ret_value = std::static_pointer_cast>(value_.begin()->second)->size(); + } + break; + case TK_UINT32: + { + ret_value = std::static_pointer_cast>(value_.begin()->second)->size(); + } + break; + case TK_INT8: + { + ret_value = std::static_pointer_cast>(value_.begin()->second)->size(); + } + break; + case TK_INT16: + { + ret_value = std::static_pointer_cast>(value_.begin()->second)->size(); + } + break; + case TK_UINT16: + { + ret_value = std::static_pointer_cast>(value_.begin()->second)->size(); + } + break; + case TK_INT64: + { + ret_value = std::static_pointer_cast>(value_.begin()->second)->size(); + } + break; + case TK_UINT64: + { + ret_value = std::static_pointer_cast>(value_.begin()->second)->size(); + } + break; + case TK_FLOAT32: + { + ret_value = std::static_pointer_cast>(value_.begin()->second)->size(); + } + break; + case TK_FLOAT64: + { + ret_value = std::static_pointer_cast>(value_.begin()->second)->size(); + } + break; + case TK_FLOAT128: + { + ret_value = std::static_pointer_cast>(value_.begin()->second)->size(); + } + break; + case TK_CHAR8: + { + ret_value = std::static_pointer_cast>(value_.begin()->second)->size(); + } + break; + case TK_CHAR16: + { + ret_value = std::static_pointer_cast>(value_.begin()->second)->size(); + } + break; + case TK_BOOLEAN: + { + ret_value = std::static_pointer_cast>(value_.begin()->second)->size(); + } + break; + case TK_BYTE: + { + ret_value = + std::static_pointer_cast>(value_.begin()->second)-> + size(); + } + break; + case TK_UINT8: + { + ret_value = + std::static_pointer_cast>(value_.begin()->second)-> + size(); + } + break; + case TK_STRING8: + { + ret_value = std::static_pointer_cast>(value_.begin()->second)->size(); + } + break; + case TK_STRING16: + { + ret_value = std::static_pointer_cast>(value_.begin()->second)->size(); + } + break; + default: + ret_value = + std::static_pointer_cast::ref_type>>(value_.begin()->second) + ->size(); + } + + return static_cast(ret_value); +} + +template +ReturnCode_t DynamicDataImpl::get_sequence_values( + SequenceTypeForKind& value, + MemberId id) noexcept +{ + ReturnCode_t ret_value = RETCODE_BAD_PARAMETER; + TypeKind type_kind = enclosing_type_->get_kind(); + + if (TK_ANNOTATION == type_kind || + TK_MAP == type_kind || + TK_STRUCTURE == type_kind || + TK_UNION == type_kind) + { + if (MEMBER_ID_INVALID != id && (TK_UNION != type_kind || 0 == id || selected_union_member_ == id)) + { + auto it = value_.find(id); + if (it != value_.end()) + { + ret_value = std::static_pointer_cast(it->second)->get_sequence_values( + value, 0); + + ret_value = RETCODE_OK; + } + else + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Cannot find MemberId " << id); + } + } + else + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Error getting value. Invalid MemberId."); + } + + } + else if (TK_ARRAY == type_kind || + TK_SEQUENCE == type_kind) + { + TypeKind element_kind = + get_enclosing_typekind(traits::narrow( + enclosing_type_->get_descriptor().element_type())); + auto it = value_.cbegin(); + assert(value_.cend() != it && MEMBER_ID_INVALID == it->first); + + if (TK_ARRAY == element_kind || + TK_SEQUENCE == element_kind) + { + if (MEMBER_ID_INVALID != id) + { + auto sequence = + std::static_pointer_cast::ref_type>>(it->second); + assert(sequence); + + if (sequence->size() > id) + { + ret_value = sequence->at(id)->get_sequence_values(value, 0); + } + } + else + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Error getting value. Invalid MemberId."); + } + } + else if (TK_BITMASK == element_kind) + { + ret_value = get_sequence_values_bitmask(id, it, value, 0); + } + else + { + ret_value = get_sequence_values_primitive(id, element_kind, it, value, 0); + } + } + else + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Unsupported type kind"); + } + + return ret_value; +} + +template +ReturnCode_t DynamicDataImpl::get_sequence_values_bitmask( + MemberId id, + std::map>::const_iterator value_iterator, + SequenceTypeForKind& value, + size_t number_of_elements) noexcept +{ + auto sequence = + std::static_pointer_cast::ref_type>>(value_iterator->second); + assert(sequence); + + if (0 == number_of_elements && 0 == sequence->size()) + { + value.clear(); + return RETCODE_OK; + } + if (sequence->size() > id) + { + auto initial_pos = sequence->begin() + id; + auto final_pos = sequence->end(); + if (0 != number_of_elements && + static_cast::difference_type>(number_of_elements) < + std::distance(initial_pos, final_pos)) + { + final_pos = std::next(initial_pos, number_of_elements); + } + value.clear(); + for (auto it = initial_pos; it != final_pos; ++it) + { + TypeForKind element_value {0}; + (*it)->get_bitmask_bit(element_value, MEMBER_ID_INVALID); + value.push_back(element_value); + } + return RETCODE_OK; + } + + return RETCODE_BAD_PARAMETER; +} + +template<> +ReturnCode_t DynamicDataImpl::get_sequence_values_bitmask( + MemberId, + std::map>::const_iterator, + SequenceTypeForKind&, + size_t) noexcept +{ + return RETCODE_BAD_PARAMETER; +} + +template<> +ReturnCode_t DynamicDataImpl::get_sequence_values_bitmask( + MemberId, + std::map>::const_iterator, + SequenceTypeForKind&, + size_t) noexcept +{ + return RETCODE_BAD_PARAMETER; +} + +template +ReturnCode_t DynamicDataImpl::get_sequence_values_primitive( + MemberId id, + TypeKind element_kind, + std::map>::const_iterator value_iterator, + SequenceTypeForKind& value, + size_t number_of_elements) noexcept +{ + ReturnCode_t ret_value {RETCODE_BAD_PARAMETER}; + + switch (element_kind) + { + case TK_INT8: + ret_value = get_sequence_values_promoting(id, value_iterator, value, number_of_elements); + break; + case TK_UINT8: + ret_value = get_sequence_values_promoting(id, value_iterator, value, number_of_elements); + break; + case TK_INT16: + ret_value = get_sequence_values_promoting(id, value_iterator, value, number_of_elements); + break; + case TK_UINT16: + ret_value = get_sequence_values_promoting(id, value_iterator, value, number_of_elements); + break; + case TK_INT32: + ret_value = get_sequence_values_promoting(id, value_iterator, value, number_of_elements); + break; + case TK_UINT32: + ret_value = get_sequence_values_promoting(id, value_iterator, value, number_of_elements); + break; + case TK_INT64: + ret_value = get_sequence_values_promoting(id, value_iterator, value, number_of_elements); + break; + case TK_UINT64: + ret_value = get_sequence_values_promoting(id, value_iterator, value, number_of_elements); + break; + case TK_FLOAT32: + ret_value = get_sequence_values_promoting(id, value_iterator, value, number_of_elements); + break; + case TK_FLOAT64: + ret_value = get_sequence_values_promoting(id, value_iterator, value, number_of_elements); + break; + case TK_FLOAT128: + ret_value = get_sequence_values_promoting(id, value_iterator, value, number_of_elements); + break; + case TK_CHAR8: + ret_value = get_sequence_values_promoting(id, value_iterator, value, number_of_elements); + break; + case TK_CHAR16: + ret_value = get_sequence_values_promoting(id, value_iterator, value, number_of_elements); + break; + case TK_BYTE: + ret_value = get_sequence_values_promoting(id, value_iterator, value, number_of_elements); + break; + case TK_BOOLEAN: + ret_value = get_sequence_values_promoting(id, value_iterator, value, number_of_elements); + break; + } + + return ret_value; +} + +template<> +ReturnCode_t DynamicDataImpl::get_sequence_values_primitive( + MemberId id, + TypeKind element_kind, + std::map>::const_iterator value_iterator, + SequenceTypeForKind& value, + size_t number_of_elements) noexcept +{ + if (TK_STRING8 == element_kind) + { + auto sequence = std::static_pointer_cast>(value_iterator->second); + assert(sequence); + + if (0 == number_of_elements && 0 == sequence->size()) + { + value.clear(); + return RETCODE_OK; + } + if (sequence->size() > id) + { + auto initial_pos = sequence->begin() + id; + auto final_pos = sequence->end(); + if (0 != number_of_elements && + static_cast::difference_type>(number_of_elements) < + std::distance(initial_pos, final_pos)) + { + final_pos = std::next(initial_pos, number_of_elements); + } + value.clear(); + value.insert(value.begin(), initial_pos, final_pos); + return RETCODE_OK; + } + } + + return RETCODE_BAD_PARAMETER; +} + +template<> +ReturnCode_t DynamicDataImpl::get_sequence_values_primitive( + MemberId id, + TypeKind element_kind, + std::map>::const_iterator value_iterator, + SequenceTypeForKind& value, + size_t number_of_elements) noexcept +{ + if (TK_STRING16 == element_kind) + { + auto sequence = std::static_pointer_cast>(value_iterator->second); + assert(sequence); + + if (0 == number_of_elements && 0 == sequence->size()) + { + value.clear(); + return RETCODE_OK; + } + if (sequence->size() > id) + { + auto initial_pos = sequence->begin() + id; + auto final_pos = sequence->end(); + if (0 != number_of_elements && + static_cast::difference_type>(number_of_elements) < + std::distance(initial_pos, final_pos)) + { + final_pos = std::next(initial_pos, number_of_elements); + } + value.clear(); + value.insert(value.begin(), initial_pos, final_pos); + return RETCODE_OK; + } + } + + return RETCODE_BAD_PARAMETER; +} + +template +ReturnCode_t DynamicDataImpl::get_sequence_values_promoting( + MemberId id, + std::map>::const_iterator value_iterator, + SequenceTypeForKind& value, + size_t number_of_elements) noexcept +{ + auto sequence = std::static_pointer_cast>(value_iterator->second); + assert(sequence); + + if (0 == number_of_elements && 0 == sequence->size()) + { + value.clear(); + return RETCODE_OK; + } + if (sequence->size() > id && (TK == ToTK || TypePromotion::value)) + { + auto initial_pos = sequence->begin() + id; + auto final_pos = sequence->end(); + if (0 != number_of_elements && + static_cast::difference_type>(number_of_elements) < + std::distance(initial_pos, final_pos)) + { + final_pos = std::next(initial_pos, number_of_elements); + } + value.clear(); + for (auto it = initial_pos; it != final_pos; ++it) + { + value.push_back(static_cast>(*it)); + } + return RETCODE_OK; + } + + return RETCODE_BAD_PARAMETER; +} + +template +ReturnCode_t DynamicDataImpl::get_value( + TypeForKind& value, + MemberId id) noexcept +{ + ReturnCode_t ret_value = RETCODE_BAD_PARAMETER; + auto type_kind = enclosing_type_->get_kind(); + + if (TK_ANNOTATION == type_kind || + TK_BITSET == type_kind || + TK_STRUCTURE == type_kind || + TK_UNION == type_kind) + { + if (MEMBER_ID_INVALID != id && (TK_UNION != type_kind || 0 == id || selected_union_member_ == id)) + { + auto it = value_.find(id); + if (it != value_.end()) + { + ret_value = std::static_pointer_cast(it->second)->get_value( + value, + MEMBER_ID_INVALID); + } + else + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Error getting value. MemberId not found."); + } + } + else + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Error getting value. Invalid MemberId."); + } + } + else if (TK_ARRAY == type_kind || + TK_SEQUENCE == type_kind) + { + TypeKind element_kind = + get_enclosing_typekind(traits::narrow( + enclosing_type_->get_descriptor().element_type())); + if (MEMBER_ID_INVALID != id) + { + auto it = value_.cbegin(); + assert(value_.cend() != it && MEMBER_ID_INVALID == it->first); + SequenceTypeForKind tmp; + + if (TK_BITMASK == element_kind) + { + ret_value = get_sequence_values_bitmask(id, it, tmp, 1); + } + else + { + ret_value = get_sequence_values_primitive(id, element_kind, it, tmp, 1); + } + + if (RETCODE_OK == ret_value) + { + assert(1 == tmp.size()); + value = tmp.at(0); + } + } + else + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Error getting value. Invalid MemberId."); + } + } + else if (TK_MAP == type_kind) + { + if (MEMBER_ID_INVALID != id) + { + auto it = value_.find(id); + if (it != value_.end()) + { + TypeKind element_kind = + get_enclosing_typekind(traits::narrow( + enclosing_type_->get_descriptor().element_type())); + + if (TK_BITMASK == element_kind) + { + ret_value = std::static_pointer_cast(it->second)->get_bitmask_bit(value, + MEMBER_ID_INVALID); + } + else + { + ret_value = get_primitive_value(element_kind, it, value, MEMBER_ID_INVALID); + } + } + else + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Error getting value. MemberId not found."); + } + } + else + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Error getting value. Invalid MemberId."); + } + } + else if (TK_BITMASK == type_kind) + { + ret_value = get_bitmask_bit(value, id); + } + else // Primitives + { + if (MEMBER_ID_INVALID == id || TK_STRING8 == type_kind || TK_STRING16 == type_kind) + { + assert(1 == value_.size() && MEMBER_ID_INVALID == value_.begin()->first); + ret_value = get_primitive_value(type_kind, value_.begin(), value, id); + } + } + + return ret_value; +} + +template +ReturnCode_t DynamicDataImpl::set_bitmask_bit( + MemberId id, + const TypeForKind& value) noexcept +{ + ReturnCode_t ret_value = RETCODE_BAD_PARAMETER; + auto sequence = std::static_pointer_cast>(value_.begin()->second); + assert(sequence); + + if (MEMBER_ID_INVALID != id) + { + // Check MemberId was defined as a BITMASK member. + if (enclosing_type_->get_all_members().end() != enclosing_type_->get_all_members().find(id)) + { + if (sequence->size() > id && (TK_BOOLEAN == TK || TypePromotion::value)) + { + sequence->at(id) = static_cast>(value); + ret_value = RETCODE_OK; + } + } + } + else + { + auto bound {enclosing_type_->get_descriptor().bound().at(0)}; + bool valid_promotion {false}; + + if (9 > bound && TypePromotion::value) + { + valid_promotion = true; + } + else if (17 > bound && TypePromotion::value) + { + valid_promotion = true; + } + else if (33 > bound && TypePromotion::value) + { + valid_promotion = true; + } + else if (TypePromotion::value) + { + valid_promotion = true; + } + + if (valid_promotion) + { + for (size_t pos {0}; pos < sequence->size(); ++pos) + { + uint64_t check_value = static_cast(value); + if (check_value & (0x1ull << pos)) + { + sequence->at(pos) = true; + } + else + { + sequence->at(pos) = false; + } + } + ret_value = RETCODE_OK; + } + } + + return ret_value; +} + +template<> +ReturnCode_t DynamicDataImpl::set_bitmask_bit( + MemberId, + const TypeForKind&) noexcept +{ + return RETCODE_BAD_PARAMETER; +} + +template<> +ReturnCode_t DynamicDataImpl::set_bitmask_bit( + MemberId, + const TypeForKind&) noexcept +{ + return RETCODE_BAD_PARAMETER; +} + +void DynamicDataImpl::set_default_value( + const traits::ref_type member, + traits::ref_type data) noexcept +{ + traits::ref_type member_type = traits::narrow( + member->get_descriptor().type()); + TypeKind member_kind = get_enclosing_typekind(member_type); + + // In case of TK_UNION and member's index 0, set discrimiantor. + if (TK_UNION == enclosing_type_->get_kind() && 0 == member->get_descriptor().index()) + { + // Set default discriminator value. + set_discriminator_value(enclosing_type_->default_value(), member_type, data); + selected_union_member_ = enclosing_type_->default_union_member(); + } + // Other case, set member with default value. + else if (TK_BITSET != member_kind && + TK_STRUCTURE != member_kind && + TK_UNION != member_kind && + TK_SEQUENCE != member_kind && + TK_ARRAY != member_kind && + TK_MAP != member_kind) + { + if (0 < member->get_descriptor().default_value().length()) + { + data->set_value(member->get_descriptor().default_value()); + } + } +} + +void DynamicDataImpl::set_discriminator_value( + MemberId id) noexcept +{ + assert(TK_UNION == enclosing_type_->get_kind()); + + traits::ref_type member; + enclosing_type_->get_member(member, id); + assert(member); + auto m_impl = traits::narrow(member); + int32_t label {0}; + + if (m_impl->get_descriptor().is_default_label()) + { + label = enclosing_type_->default_value(); + } + else + { + assert(0 < m_impl->get_descriptor().label().size()); + label = m_impl->get_descriptor().label().at(0); + } + + assert(value_.find(0) != value_.end()); + traits::ref_type data_impl = std::static_pointer_cast(value_.at(0)); + + // Set new discriminator value. + set_discriminator_value(label, + traits::narrow(enclosing_type_->get_descriptor().discriminator_type()), + data_impl); + + selected_union_member_ = id; +} + +void DynamicDataImpl::set_discriminator_value( + int32_t new_discriminator_value, + const traits::ref_type& discriminator_type, + traits::ref_type& data) noexcept +{ + assert(TK_UNION == enclosing_type_->get_kind()); + TypeKind discriminator_kind = get_enclosing_typekind(discriminator_type); + + switch (discriminator_kind) + { + case TK_INT32: + data->set_int32_value(MEMBER_ID_INVALID, new_discriminator_value); + break; + case TK_UINT32: + data->set_uint32_value(MEMBER_ID_INVALID, static_cast(new_discriminator_value)); + break; + case TK_INT8: + data->set_int8_value(MEMBER_ID_INVALID, static_cast(new_discriminator_value)); + break; + case TK_INT16: + data->set_int16_value(MEMBER_ID_INVALID, static_cast(new_discriminator_value)); + break; + case TK_UINT16: + data->set_uint16_value(MEMBER_ID_INVALID, static_cast(new_discriminator_value)); + break; + case TK_INT64: + data->set_int64_value(MEMBER_ID_INVALID, static_cast(new_discriminator_value)); + break; + case TK_UINT64: + data->set_uint64_value(MEMBER_ID_INVALID, static_cast(new_discriminator_value)); + break; + case TK_CHAR8: + data->set_char8_value(MEMBER_ID_INVALID, static_cast(new_discriminator_value)); + break; + case TK_CHAR16: + data->set_char16_value(MEMBER_ID_INVALID, static_cast(new_discriminator_value)); + break; + case TK_BOOLEAN: + data->set_boolean_value(MEMBER_ID_INVALID, 0 == new_discriminator_value ? false : true); + break; + case TK_BYTE: + data->set_byte_value(MEMBER_ID_INVALID, static_cast(new_discriminator_value)); + break; + case TK_UINT8: + data->set_uint8_value(MEMBER_ID_INVALID, static_cast(new_discriminator_value)); + break; + default: + break; + } +} + +template +ReturnCode_t DynamicDataImpl::set_primitive_value( + const traits::ref_type& element_type, + std::map>::iterator value_iterator, + const TypeForKind& value) noexcept +{ + ReturnCode_t ret_value = RETCODE_BAD_PARAMETER; + TypeKind element_kind = element_type->get_kind(); + + if (TK == element_kind) + { + *std::static_pointer_cast>(value_iterator->second) = value; + ret_value = RETCODE_OK; + } + else + { + switch (element_kind) + { + case TK_INT8: + if (TypePromotion::value) + { + *std::static_pointer_cast>(value_iterator->second) = + static_cast>(value); + ret_value = RETCODE_OK; + } + break; + case TK_UINT8: + if (TypePromotion::value) + { + *std::static_pointer_cast>(value_iterator->second) = + static_cast>(value); + ret_value = RETCODE_OK; + } + break; + case TK_INT16: + if (TypePromotion::value) + { + *std::static_pointer_cast>(value_iterator->second) = + static_cast>(value); + ret_value = RETCODE_OK; + } + break; + case TK_UINT16: + if (TypePromotion::value) + { + *std::static_pointer_cast>(value_iterator->second) = + static_cast>(value); + ret_value = RETCODE_OK; + } + break; + case TK_INT32: + if (TypePromotion::value) + { + *std::static_pointer_cast>(value_iterator->second) = + static_cast>(value); + ret_value = RETCODE_OK; + } + break; + case TK_UINT32: + if (TypePromotion::value) + { + *std::static_pointer_cast>(value_iterator->second) = + static_cast>(value); + ret_value = RETCODE_OK; + } + break; + case TK_INT64: + if (TypePromotion::value) + { + *std::static_pointer_cast>(value_iterator->second) = + static_cast>(value); + ret_value = RETCODE_OK; + } + break; + case TK_UINT64: + if (TypePromotion::value) + { + *std::static_pointer_cast>(value_iterator->second) = + static_cast>(value); + ret_value = RETCODE_OK; + } + break; + case TK_FLOAT32: + if (TypePromotion::value) + { + *std::static_pointer_cast>(value_iterator->second) = + static_cast>(value); + ret_value = RETCODE_OK; + } + break; + case TK_FLOAT64: + if (TypePromotion::value) + { + *std::static_pointer_cast>(value_iterator->second) = + static_cast>(value); + ret_value = RETCODE_OK; + } + break; + case TK_FLOAT128: + if (TypePromotion::value) + { + *std::static_pointer_cast>(value_iterator->second) = + static_cast>(value); + ret_value = RETCODE_OK; + } + break; + case TK_CHAR8: + if (TypePromotion::value) + { + *std::static_pointer_cast>(value_iterator->second) = + static_cast>(value); + ret_value = RETCODE_OK; + } + break; + case TK_CHAR16: + if (TypePromotion::value) + { + *std::static_pointer_cast>(value_iterator->second) = + static_cast>(value); + ret_value = RETCODE_OK; + } + break; + case TK_BYTE: + if (TypePromotion::value) + { + *std::static_pointer_cast>(value_iterator->second) = + static_cast>(value); + ret_value = RETCODE_OK; + } + break; + case TK_BOOLEAN: + if (TypePromotion::value) + { + *std::static_pointer_cast>(value_iterator->second) = + static_cast>(value); + ret_value = RETCODE_OK; + } + break; + default: + break; + } + } + + return ret_value; +} + +template<> +ReturnCode_t DynamicDataImpl::set_primitive_value( + const traits::ref_type& element_type, + std::map>::iterator value_iterator, + const TypeForKind& value) noexcept +{ + ReturnCode_t ret_value = RETCODE_BAD_PARAMETER; + TypeKind element_kind = element_type->get_kind(); + + if (TK_STRING8 == element_kind && ( + static_cast(LENGTH_UNLIMITED) == element_type->get_descriptor().bound().at(0) || + value.size() <= element_type->get_descriptor().bound().at(0))) + { + *std::static_pointer_cast>(value_iterator->second) = value; + ret_value = RETCODE_OK; + } + else + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Element kind is not TK_STRING8 or the string length exceeds the string bound"); + } + + return ret_value; +} + +template<> +ReturnCode_t DynamicDataImpl::set_primitive_value( + const traits::ref_type& element_type, + std::map>::iterator value_iterator, + const TypeForKind& value) noexcept +{ + ReturnCode_t ret_value = RETCODE_BAD_PARAMETER; + TypeKind element_kind = element_type->get_kind(); + + if (TK_STRING16 == element_kind && ( + static_cast(LENGTH_UNLIMITED) == enclosing_type_->get_descriptor().bound().at(0) || + value.size() <= enclosing_type_->get_descriptor().bound().at(0))) + { + *std::static_pointer_cast>(value_iterator->second) = value; + ret_value = RETCODE_OK; + } + else + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Element kind is not TK_STRING16 or the string length exceeds the string bound"); + } + + return ret_value; +} + +template +ReturnCode_t DynamicDataImpl::set_sequence_values( + MemberId id, + const SequenceTypeForKind& value) noexcept +{ + ReturnCode_t ret_value = RETCODE_BAD_PARAMETER; + TypeKind type_kind = enclosing_type_->get_kind(); + + if (TK_ANNOTATION == type_kind || + TK_MAP == type_kind || + TK_STRUCTURE == type_kind || + TK_UNION == type_kind) + { + if (MEMBER_ID_INVALID != id) + { + if (TK_UNION == type_kind && 0 == id) // Check setting discriminator is correct. + { + if (!check_new_discriminator_value(value)) + { + return RETCODE_BAD_PARAMETER; + } + } + + auto it = value_.find(id); + if (it != value_.end()) + { + + ret_value = std::static_pointer_cast(it->second)->set_sequence_values( + 0, + value); + } + else + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Cannot find MemberId " << id); + } + + if (RETCODE_OK == ret_value && TK_UNION == type_kind && 0 != id) // Set new discriminator. + { + set_discriminator_value(id); + } + } + else + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Error setting value. Invalid MemberId."); + } + + } + else if (TK_ARRAY == type_kind || + TK_SEQUENCE == type_kind) + { + auto element_type = + get_enclosing_type(traits::narrow( + enclosing_type_->get_descriptor().element_type())); + TypeKind element_kind = element_type->get_kind(); + auto it = value_.cbegin(); + assert(value_.cend() != it && MEMBER_ID_INVALID == it->first); + if (TK_ARRAY == element_kind || + TK_SEQUENCE == element_kind) + { + if (MEMBER_ID_INVALID != id) + { + auto sequence = + std::static_pointer_cast::ref_type>>(it->second); + assert(sequence); + if ((TK_ARRAY == type_kind && sequence->size() > id) || + (TK_SEQUENCE == type_kind && + (static_cast(LENGTH_UNLIMITED) == + enclosing_type_->get_descriptor().bound().at(0) || + enclosing_type_->get_descriptor().bound().at(0) > id))) + { + if (sequence->size() < id + 1) + { + auto last_pos = sequence->size(); + sequence->resize(id + 1); + + for (auto pos = last_pos; pos < sequence->size(); ++pos) + { + sequence->at(pos) = traits::narrow( + DynamicDataFactory::get_instance()->create_data(element_type)); + } + } + + ret_value = sequence->at(id)->set_sequence_values(0, value); + } + } + else + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Error setting value. Invalid MemberId."); + } + } + else if (TK_BITMASK == element_kind) + { + ret_value = set_sequence_values_bitmask(MEMBER_ID_INVALID == id ? 0 : id, it, value); + } + else // Try primitives + { + ret_value = set_sequence_values_primitive(MEMBER_ID_INVALID == id ? 0 : id, element_kind, it, value); + } + } + else + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Unsupported type kind"); + } + + return ret_value; +} + +template +ReturnCode_t DynamicDataImpl::set_sequence_values_bitmask( + MemberId id, + std::map>::const_iterator value_iterator, + const SequenceTypeForKind& value) noexcept +{ + TypeKind type_kind = enclosing_type_->get_kind(); + auto element_type = + get_enclosing_type(traits::narrow( + enclosing_type_->get_descriptor().element_type())); + auto sequence = + std::static_pointer_cast::ref_type>>(value_iterator->second); + assert(sequence); + if ((TK_ARRAY == type_kind && sequence->size() >= id + value.size()) || + (TK_SEQUENCE == type_kind && + (static_cast(LENGTH_UNLIMITED) == enclosing_type_->get_descriptor().bound().at(0) || + enclosing_type_->get_descriptor().bound().at(0) >= id + value.size()))) + { + if (sequence->size() < id + value.size()) + { + auto last_pos = sequence->size(); + sequence->resize(id + value.size()); + + for (auto pos = last_pos; pos < sequence->size(); ++pos) + { + sequence->at(pos) = traits::narrow( + DynamicDataFactory::get_instance()->create_data(element_type)); + } + } + auto pos = sequence->begin() + id; + for (size_t count {0}; count < value.size(); ++count) + { + (*pos)->set_bitmask_bit(MEMBER_ID_INVALID, value.at(count)); + ++pos; + } + return RETCODE_OK; + } + + return RETCODE_BAD_PARAMETER; +} + +template +ReturnCode_t DynamicDataImpl::set_sequence_values_primitive( + MemberId id, + TypeKind element_kind, + std::map>::const_iterator value_iterator, + const SequenceTypeForKind& value) noexcept +{ + ReturnCode_t ret_value {RETCODE_BAD_PARAMETER}; + + switch (element_kind) + { + case TK_INT8: + ret_value = set_sequence_values_promoting(id, value_iterator, value); + break; + case TK_UINT8: + ret_value = set_sequence_values_promoting(id, value_iterator, value); + break; + case TK_INT16: + ret_value = set_sequence_values_promoting(id, value_iterator, value); + break; + case TK_UINT16: + ret_value = set_sequence_values_promoting(id, value_iterator, value); + break; + case TK_INT32: + ret_value = set_sequence_values_promoting(id, value_iterator, value); + break; + case TK_UINT32: + ret_value = set_sequence_values_promoting(id, value_iterator, value); + break; + case TK_INT64: + ret_value = set_sequence_values_promoting(id, value_iterator, value); + break; + case TK_UINT64: + ret_value = set_sequence_values_promoting(id, value_iterator, value); + break; + case TK_FLOAT32: + ret_value = set_sequence_values_promoting(id, value_iterator, value); + break; + case TK_FLOAT64: + ret_value = set_sequence_values_promoting(id, value_iterator, value); + break; + case TK_FLOAT128: + ret_value = set_sequence_values_promoting(id, value_iterator, value); + break; + case TK_CHAR8: + ret_value = set_sequence_values_promoting(id, value_iterator, value); + break; + case TK_CHAR16: + ret_value = set_sequence_values_promoting(id, value_iterator, value); + break; + case TK_BYTE: + ret_value = set_sequence_values_promoting(id, value_iterator, value); + break; + case TK_BOOLEAN: + ret_value = set_sequence_values_promoting(id, value_iterator, value); + break; + } + + return ret_value; +} + +template<> +ReturnCode_t DynamicDataImpl::set_sequence_values_primitive( + MemberId id, + TypeKind element_kind, + std::map>::const_iterator value_iterator, + const SequenceTypeForKind& value) noexcept +{ + if (TK_STRING8 == element_kind) + { + TypeKind type_kind = enclosing_type_->get_kind(); + auto sequence = std::static_pointer_cast>(value_iterator->second); + assert(sequence); + if ((TK_ARRAY == type_kind && sequence->size() >= id + value.size()) || + (TK_SEQUENCE == type_kind && + (static_cast(LENGTH_UNLIMITED) == enclosing_type_->get_descriptor().bound().at(0) || + enclosing_type_->get_descriptor().bound().at(0) >= id + value.size()))) + { + if (sequence->size() < id + value.size()) + { + sequence->resize(id + value.size()); + } + auto pos = sequence->begin() + id; + for (size_t count {0}; count < value.size(); ++count) + { + *pos = value.at(count); + ++pos; + } + return RETCODE_OK; + } + } + + return RETCODE_BAD_PARAMETER; +} + +template<> +ReturnCode_t DynamicDataImpl::set_sequence_values_primitive( + MemberId id, + TypeKind element_kind, + std::map>::const_iterator value_iterator, + const SequenceTypeForKind& value) noexcept +{ + if (TK_STRING16 == element_kind) + { + TypeKind type_kind = enclosing_type_->get_kind(); + auto sequence = std::static_pointer_cast>(value_iterator->second); + assert(sequence); + if ((TK_ARRAY == type_kind && sequence->size() >= id + value.size()) || + (TK_SEQUENCE == type_kind && + (static_cast(LENGTH_UNLIMITED) == enclosing_type_->get_descriptor().bound().at(0) || + enclosing_type_->get_descriptor().bound().at(0) >= id + value.size()))) + { + if (sequence->size() < id + value.size()) + { + sequence->resize(id + value.size()); + } + auto pos = sequence->begin() + id; + for (size_t count {0}; count < value.size(); ++count) + { + *pos = value.at(count); + ++pos; + } + return RETCODE_OK; + } + } + + return RETCODE_BAD_PARAMETER; +} + +template +ReturnCode_t DynamicDataImpl::set_sequence_values_promoting( + MemberId id, + std::map>::const_iterator value_iterator, + const SequenceTypeForKind& value) noexcept +{ + TypeKind type_kind = enclosing_type_->get_kind(); + auto sequence = std::static_pointer_cast>(value_iterator->second); + assert(sequence); + + if (((TK_ARRAY == type_kind && sequence->size() >= id + value.size()) || + (TK_SEQUENCE == type_kind && + (static_cast(LENGTH_UNLIMITED) == enclosing_type_->get_descriptor().bound().at(0) || + enclosing_type_->get_descriptor().bound().at(0) >= id + value.size()))) && + (TK == ToTK || TypePromotion::value)) + { + if (sequence->size() < id + value.size()) + { + sequence->resize(id + value.size()); + } + auto pos = sequence->begin() + id; + for (size_t count {0}; count < value.size(); ++count) + { + *pos = static_cast>(value.at(count)); + ++pos; + } + return RETCODE_OK; + } + + return RETCODE_BAD_PARAMETER; +} + +void DynamicDataImpl::set_value( + const ObjectName& sValue) noexcept +{ + auto enclosed_type = type_->resolve_alias_enclosed_type(); + TypeKind type_kind = enclosed_type->get_kind(); + + switch (type_kind) + { + case TK_INT32: + { + TypeForKind value {0}; + try + { + value = TypeValueConverter::sto(sValue.to_string()); + } + catch (...) + { + } + set_int32_value(MEMBER_ID_INVALID, value); + break; + } + case TK_UINT32: + { + TypeForKind value {0}; + try + { + value = TypeValueConverter::sto(sValue.to_string()); + } + catch (...) + { + } + set_uint32_value(MEMBER_ID_INVALID, value); + break; + } + case TK_INT8: + { + TypeForKind value {0}; + try + { + value = TypeValueConverter::sto(sValue.to_string()); + } + catch (...) + { + } + set_int8_value(MEMBER_ID_INVALID, value); + break; + } + case TK_INT16: + { + TypeForKind value {0}; + try + { + value = TypeValueConverter::sto(sValue.to_string()); + } + catch (...) + { + } + set_int16_value(MEMBER_ID_INVALID, value); + break; + } + case TK_UINT16: + { + TypeForKind value {0}; + try + { + value = TypeValueConverter::sto(sValue.to_string()); + } + catch (...) + { + } + set_uint16_value(MEMBER_ID_INVALID, value); + break; + } + case TK_INT64: + { + TypeForKind value {0}; + try + { + value = TypeValueConverter::sto(sValue.to_string()); + } + catch (...) + { + } + set_int64_value(MEMBER_ID_INVALID, value); + break; + } + case TK_UINT64: + { + TypeForKind value(0); + try + { + value = TypeValueConverter::sto(sValue.to_string()); + } + catch (...) + { + } + set_uint64_value(MEMBER_ID_INVALID, value); + break; + } + case TK_FLOAT32: + { + TypeForKind value {0.0f}; + try + { + value = TypeValueConverter::sto(sValue.to_string()); + } + catch (...) + { + } + set_float32_value(MEMBER_ID_INVALID, value); + break; + } + case TK_FLOAT64: + { + TypeForKind value {0.0f}; + try + { + value = TypeValueConverter::sto(sValue.to_string()); + } + catch (...) + { + } + set_float64_value(MEMBER_ID_INVALID, value); + break; + } + case TK_FLOAT128: + { + TypeForKind value {0.0f}; + try + { + value = TypeValueConverter::sto(sValue.to_string()); + } + catch (...) + { + } + set_float128_value(MEMBER_ID_INVALID, value); + break; + } + case TK_CHAR8: + { + TypeForKind value {0}; + if (1 == sValue.size()) + { + value = sValue[0]; + } + + set_char8_value(MEMBER_ID_INVALID, value); + break; + } + case TK_CHAR16: + { + TypeForKind value {0}; + try + { + if (1 == sValue.size()) + { + std::string str = sValue.to_string(); + std::wstring temp = std::wstring(str.begin(), str.end()); + value = temp[0]; + } + } + catch (...) + { + } + + set_char16_value(MEMBER_ID_INVALID, value); + break; + } + case TK_BOOLEAN: + { + TypeForKind value {false}; + try + { + value = TypeValueConverter::sto(sValue.to_string()); + } + catch (...) + { + } + set_boolean_value(MEMBER_ID_INVALID, value); + break; + } + case TK_BYTE: + { + TypeForKind value {0}; + if (sValue.size() >= 1) + { + try + { + value = TypeValueConverter::sto(sValue.to_string()); + } + catch (...) + { + } + } + set_byte_value(MEMBER_ID_INVALID, value); + break; + } + case TK_UINT8: + { + TypeForKind value {0}; + if (sValue.size() >= 1) + { + try + { + value = TypeValueConverter::sto(sValue.to_string()); + } + catch (...) + { + } + } + set_byte_value(MEMBER_ID_INVALID, value); + break; + } + case TK_STRING8: + { + set_string_value(MEMBER_ID_INVALID, sValue.to_string()); + break; + } + case TK_STRING16: + { + std::string str = sValue.to_string(); + set_wstring_value(MEMBER_ID_INVALID, std::wstring(str.begin(), str.end())); + break; + } + case TK_ENUM: + { + auto& members = enclosed_type->get_all_members_by_index(); + assert(0 < members.size()); + TypeForKind value = TypeValueConverter::sto(members.at(0)->get_descriptor().default_value()); + for (auto member_it {members.begin()}; member_it != members.end(); ++member_it) + { + if (0 == sValue.to_string().compare((*member_it)->get_name().to_string())) + { + value = TypeValueConverter::sto((*member_it)->get_descriptor().default_value()); + break; + } + } + + switch (enclosing_type_->get_kind()) + { + case TK_INT8: + set_int8_value(MEMBER_ID_INVALID, static_cast(value)); + break; + case TK_UINT8: + set_uint8_value(MEMBER_ID_INVALID, static_cast(value)); + break; + case TK_INT16: + set_int16_value(MEMBER_ID_INVALID, static_cast(value)); + break; + case TK_UINT16: + set_uint16_value(MEMBER_ID_INVALID, static_cast(value)); + break; + case TK_INT32: + set_int32_value(MEMBER_ID_INVALID, static_cast(value)); + break; + case TK_UINT32: + set_uint32_value(MEMBER_ID_INVALID, static_cast(value)); + break; + } + break; + } + default: + break; + } +} + +template +ReturnCode_t DynamicDataImpl::set_value( + MemberId id, + const TypeForKind& value) noexcept +{ + ReturnCode_t ret_value = RETCODE_BAD_PARAMETER; + TypeKind type_kind = enclosing_type_->get_kind(); + + if (TK_ANNOTATION == type_kind || + TK_BITSET == type_kind || + TK_STRUCTURE == type_kind || + TK_UNION == type_kind) + { + if (MEMBER_ID_INVALID != id) + { + if (TK_UNION == type_kind && 0 == id) // Check setting discriminator is correct. + { + if (!check_new_discriminator_value(value)) + { + return RETCODE_BAD_PARAMETER; + } + } + + auto it = value_.find(id); + if (it != value_.end()) + { + TypeForKind new_value {value}; + + // In case of BITSET, apply mask. + if (TK_BITSET == type_kind) + { + apply_bitset_mask(id, new_value); + } + + ret_value = std::static_pointer_cast(it->second)->set_value( + MEMBER_ID_INVALID, new_value); + } + else + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Error setting value. MemberId not found."); + } + + if (RETCODE_OK == ret_value && TK_UNION == type_kind && 0 != id) // Set new discriminator. + { + set_discriminator_value(id); + } + } + else + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Error setting value. Invalid MemberId."); + } + } + else if (TK_ARRAY == type_kind || + TK_SEQUENCE == type_kind) + { + TypeKind element_kind = + get_enclosing_typekind(traits::narrow( + enclosing_type_->get_descriptor().element_type())); + if (MEMBER_ID_INVALID != id) + { + auto it = value_.cbegin(); + assert(value_.cend() != it && MEMBER_ID_INVALID == it->first); + + if (TK_BITMASK == element_kind) + { + ret_value = set_sequence_values_bitmask(id, it, {value}); + } + else + { + ret_value = set_sequence_values_primitive(id, element_kind, it, {value}); + } + } + else + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Error setting value. Invalid MemberId."); + } + } + else if (TK_MAP == type_kind) + { + if (MEMBER_ID_INVALID != id) + { + auto it = value_.find(id); + if (it != value_.end()) + { + auto element_type = + get_enclosing_type(traits::narrow( + enclosing_type_->get_descriptor().element_type())); + if (TK_BITMASK == element_type->get_kind()) + { + ret_value = std::static_pointer_cast(it->second)->set_bitmask_bit( + MEMBER_ID_INVALID, value); + } + else + { + ret_value = set_primitive_value(element_type, it, value); + } + } + else + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Error setting value. MemberId not found."); + } + } + else + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Error setting value. Invalid MemberId."); + } + } + else if (TK_BITMASK == type_kind) + { + ret_value = set_bitmask_bit(id, value); + } + else // Primitives + { + if (MEMBER_ID_INVALID == id) + { + assert(1 == value_.size() && MEMBER_ID_INVALID == value_.begin()->first); + ret_value = set_primitive_value(enclosing_type_, value_.begin(), value); + } + } + + return ret_value; +} + +//}}} + +//{{{ Encoding/decoding functions + +size_t DynamicDataImpl::calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const traits::ref_type type, + size_t& current_alignment) const noexcept +{ + size_t calculated_size {0}; + auto it = value_.begin(); + + TypeKind type_kind = type->get_kind(); + + switch (type_kind) + { + //{{{ Primitive types + case TK_INT32: + calculated_size = calculator.calculate_serialized_size(*std::static_pointer_cast>( + it->second), current_alignment); + break; + case TK_UINT32: + calculated_size = calculator.calculate_serialized_size(*std::static_pointer_cast>( + it->second), current_alignment); + break; + case TK_FLOAT32: + calculated_size = calculator.calculate_serialized_size(*std::static_pointer_cast>( + it->second), current_alignment); + break; + case TK_CHAR16: + calculated_size = calculator.calculate_serialized_size(*std::static_pointer_cast>( + it->second), current_alignment); + break; + case TK_INT8: + calculated_size = calculator.calculate_serialized_size(*std::static_pointer_cast>( + it->second), current_alignment); + break; + case TK_INT16: + calculated_size = calculator.calculate_serialized_size(*std::static_pointer_cast>( + it->second), current_alignment); + break; + case TK_UINT16: + calculated_size = calculator.calculate_serialized_size(*std::static_pointer_cast>( + it->second), current_alignment); + break; + case TK_INT64: + calculated_size = calculator.calculate_serialized_size(*std::static_pointer_cast>( + it->second), current_alignment); + break; + case TK_UINT64: + calculated_size = calculator.calculate_serialized_size(*std::static_pointer_cast>( + it->second), current_alignment); + break; + case TK_FLOAT64: + calculated_size = calculator.calculate_serialized_size(*std::static_pointer_cast>( + it->second), current_alignment); + break; + case TK_FLOAT128: + calculated_size = calculator.calculate_serialized_size(*std::static_pointer_cast>( + it->second), current_alignment); + break; + case TK_CHAR8: + calculated_size = calculator.calculate_serialized_size(*std::static_pointer_cast>( + it->second), current_alignment); + break; + case TK_BOOLEAN: + calculated_size = calculator.calculate_serialized_size(*std::static_pointer_cast>( + it->second), current_alignment); + break; + case TK_BYTE: + calculated_size = calculator.calculate_serialized_size(*std::static_pointer_cast>( + it->second), current_alignment); + break; + case TK_UINT8: + calculated_size = calculator.calculate_serialized_size(*std::static_pointer_cast>( + it->second), current_alignment); + break; + case TK_STRING8: + calculated_size = calculator.calculate_serialized_size(*std::static_pointer_cast>( + it->second), current_alignment); + break; + case TK_STRING16: + calculated_size = + calculator.calculate_serialized_size(*std::static_pointer_cast>( + it->second), + current_alignment); + break; + //}}} + case TK_ARRAY: + { + TypeKind element_kind = + get_enclosing_typekind(traits::narrow( + type->get_descriptor().element_type())); + switch (element_kind) + { + case TK_INT32: + calculated_size = + calculator.calculate_array_serialized_size(*std::static_pointer_cast>( + it->second), current_alignment); + break; + case TK_UINT32: + calculated_size = + calculator.calculate_array_serialized_size(*std::static_pointer_cast>( + it->second), current_alignment); + break; + case TK_INT8: + calculated_size = + calculator.calculate_array_serialized_size(*std::static_pointer_cast>( + it->second), current_alignment); + break; + case TK_INT16: + calculated_size = + calculator.calculate_array_serialized_size(*std::static_pointer_cast>( + it->second), current_alignment); + break; + case TK_UINT16: + calculated_size = + calculator.calculate_array_serialized_size(*std::static_pointer_cast>( + it->second), current_alignment); + break; + case TK_INT64: + calculated_size = + calculator.calculate_array_serialized_size(*std::static_pointer_cast>( + it->second), current_alignment); + break; + case TK_UINT64: + calculated_size = + calculator.calculate_array_serialized_size(*std::static_pointer_cast>( + it->second), current_alignment); + break; + case TK_FLOAT32: + calculated_size = + calculator.calculate_array_serialized_size(*std::static_pointer_cast>( + it->second), current_alignment); + break; + case TK_FLOAT64: + calculated_size = + calculator.calculate_array_serialized_size(*std::static_pointer_cast>( + it->second), current_alignment); + break; + case TK_FLOAT128: + calculated_size = + calculator.calculate_array_serialized_size(*std::static_pointer_cast>( + it->second), current_alignment); + break; + case TK_CHAR8: + calculated_size = + calculator.calculate_array_serialized_size(*std::static_pointer_cast>( + it->second), current_alignment); + break; + case TK_CHAR16: + calculated_size = + calculator.calculate_array_serialized_size(*std::static_pointer_cast>( + it->second), current_alignment); + break; + case TK_BOOLEAN: + calculated_size = + calculator.calculate_array_serialized_size(*std::static_pointer_cast>( + it->second), current_alignment); + break; + case TK_BYTE: + calculated_size = + calculator.calculate_array_serialized_size(*std::static_pointer_cast>( + it->second), current_alignment); + break; + case TK_UINT8: + calculated_size = + calculator.calculate_array_serialized_size(*std::static_pointer_cast>( + it->second), current_alignment); + break; + case TK_STRING8: + calculated_size = + calculator.calculate_array_serialized_size(*std::static_pointer_cast>( + it->second), current_alignment); + break; + case TK_STRING16: + calculated_size = + calculator.calculate_array_serialized_size(*std::static_pointer_cast>( + it->second), current_alignment); + break; + case TK_BITMASK: + { + auto vector_t {std::static_pointer_cast::ref_type>>( + it->second)}; + calculated_size += + calculator.calculate_array_serialized_size(vector_t->data(), + vector_t->size(), current_alignment); + } + break; + default: + calculated_size = + calculator.calculate_array_serialized_size( + *std::static_pointer_cast::ref_type>>( + it->second), current_alignment); + break; + + } + + break; + } + case TK_BITMASK: + { + assert(1 == type->get_descriptor().bound().size()); + auto bound = type->get_descriptor().bound().at(0); + + if (9 > bound) + { + uint8_t value {0}; + calculated_size = calculator.calculate_serialized_size(value, current_alignment); + } + else if (17 > bound) + { + uint16_t value {0}; + calculated_size = calculator.calculate_serialized_size(value, current_alignment); + } + else if (33 > bound) + { + uint32_t value {0}; + calculated_size = calculator.calculate_serialized_size(value, current_alignment); + } + else + { + uint64_t value {0}; + calculated_size = calculator.calculate_serialized_size(value, current_alignment); + } + break; + } + case TK_BITSET: + { + assert(0 < type->get_all_members_by_index().size()); + auto sum {type->get_all_members_by_index().rbegin()->get()->get_id() + + *type->get_descriptor().bound().rbegin()}; + + if (9 > sum) + { + std::bitset<8> bitset; + calculated_size = calculator.calculate_serialized_size(bitset, current_alignment); + } + else if (17 > sum) + { + std::bitset<16> bitset; + calculated_size = calculator.calculate_serialized_size(bitset, current_alignment); + } + else if (33 > sum) + { + std::bitset<32> bitset; + calculated_size = calculator.calculate_serialized_size(bitset, current_alignment); + } + else + { + std::bitset<64> bitset; + calculated_size = calculator.calculate_serialized_size(bitset, current_alignment); + } + break; + } + case TK_MAP: + { + TypeKind key_kind { get_enclosing_typekind(traits::narrow( + type->get_descriptor().key_element_type()))}; + TypeKind element_kind { get_enclosing_typekind(traits::narrow( + type->get_descriptor().element_type()))}; + bool is_primitive {TK_BITMASK == element_kind || (!is_complex_kind(element_kind) && + TK_STRING8 != element_kind && + TK_STRING16 != element_kind)}; + size_t initial_alignment {current_alignment}; + + if (!is_primitive && eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version()) + { + // DHEADER + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + } + + // Serializing map's length. XTypes v1.3 section 7.4.3.5.3 rule 15 doesn't specify this but it is probably a + // typo (other collection types behave this way). + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + calculated_size = current_alignment - initial_alignment; + for (auto key_it = key_to_id_.begin(); key_it != key_to_id_.end(); ++key_it) + { + switch (key_kind) + { + case TK_INT32: + { + TypeForKind value {0}; + calculated_size += calculator.calculate_serialized_size(value, current_alignment); + } + break; + case TK_UINT32: + { + TypeForKind value {0}; + calculated_size += calculator.calculate_serialized_size(value, current_alignment); + } + break; + case TK_INT8: + { + TypeForKind value {0}; + calculated_size += calculator.calculate_serialized_size(value, current_alignment); + } + break; + case TK_INT16: + { + TypeForKind value {0}; + calculated_size += calculator.calculate_serialized_size(value, current_alignment); + } + break; + case TK_UINT16: + { + TypeForKind value {0}; + calculated_size += calculator.calculate_serialized_size(value, current_alignment); + } + break; + case TK_INT64: + { + TypeForKind value {0}; + calculated_size += calculator.calculate_serialized_size(value, current_alignment); + } + break; + case TK_UINT64: + { + TypeForKind value {0}; + calculated_size += calculator.calculate_serialized_size(value, current_alignment); + } + break; + case TK_FLOAT32: + { + TypeForKind value {0}; + calculated_size += calculator.calculate_serialized_size(value, current_alignment); + } + break; + case TK_FLOAT64: + { + TypeForKind value {0}; + calculated_size += calculator.calculate_serialized_size(value, current_alignment); + } + break; + case TK_FLOAT128: + { + TypeForKind value {0}; + calculated_size += calculator.calculate_serialized_size(value, current_alignment); + } + break; + case TK_CHAR8: + { + TypeForKind value {0}; + calculated_size += calculator.calculate_serialized_size(value, current_alignment); + } + break; + case TK_CHAR16: + { + TypeForKind value {0}; + calculated_size += calculator.calculate_serialized_size(value, current_alignment); + } + break; + case TK_BOOLEAN: + { + TypeForKind value {0}; + calculated_size += calculator.calculate_serialized_size(value, current_alignment); + } + break; + case TK_BYTE: + { + TypeForKind value {0}; + calculated_size += calculator.calculate_serialized_size(value, current_alignment); + } + break; + case TK_UINT8: + { + TypeForKind value {0}; + calculated_size += calculator.calculate_serialized_size(value, current_alignment); + } + break; + case TK_STRING8: + { + calculated_size += calculator.calculate_serialized_size(key_it->first, current_alignment); + } + break; + case TK_STRING16: + EPROSIMA_LOG_ERROR(DYN_TYPES, "Map's key type cannot be WString. Not supported"); + assert(false); + break; + default: + assert(false); + break; + + } + assert(value_.end() != value_.find(key_it->second)); + switch (element_kind) + { + case TK_INT32: + { + TypeForKind value {0}; + calculated_size += calculator.calculate_serialized_size(value, current_alignment); + break; + } + case TK_UINT32: + { + TypeForKind value {0}; + calculated_size += calculator.calculate_serialized_size(value, current_alignment); + break; + } + case TK_INT8: + { + TypeForKind value {0}; + calculated_size += calculator.calculate_serialized_size(value, current_alignment); + break; + } + case TK_INT16: + { + TypeForKind value {0}; + calculated_size += calculator.calculate_serialized_size(value, current_alignment); + break; + } + case TK_UINT16: + { + TypeForKind value {0}; + calculated_size += calculator.calculate_serialized_size(value, current_alignment); + break; + } + case TK_INT64: + { + TypeForKind value {0}; + calculated_size += calculator.calculate_serialized_size(value, current_alignment); + break; + } + case TK_UINT64: + { + TypeForKind value {0}; + calculated_size += calculator.calculate_serialized_size(value, current_alignment); + break; + } + case TK_FLOAT32: + { + TypeForKind value {0}; + calculated_size += calculator.calculate_serialized_size(value, current_alignment); + break; + } + case TK_FLOAT64: + { + TypeForKind value {0}; + calculated_size += calculator.calculate_serialized_size(value, current_alignment); + break; + } + case TK_FLOAT128: + { + TypeForKind value {0}; + calculated_size += calculator.calculate_serialized_size(value, current_alignment); + break; + } + case TK_CHAR8: + { + TypeForKind value {0}; + calculated_size += calculator.calculate_serialized_size(value, current_alignment); + break; + } + case TK_CHAR16: + { + TypeForKind value {0}; + calculated_size += calculator.calculate_serialized_size(value, current_alignment); + break; + } + case TK_BOOLEAN: + { + TypeForKind value {0}; + calculated_size += calculator.calculate_serialized_size(value, current_alignment); + break; + } + case TK_BYTE: + { + TypeForKind value {0}; + calculated_size += calculator.calculate_serialized_size(value, current_alignment); + break; + } + case TK_UINT8: + { + TypeForKind value {0}; + calculated_size += calculator.calculate_serialized_size(value, current_alignment); + break; + } + case TK_STRING8: + calculated_size += + calculator.calculate_serialized_size(*std::static_pointer_cast>( + value_.find( + key_it->second)->second), current_alignment); + break; + case TK_STRING16: + calculated_size += + calculator.calculate_serialized_size(*std::static_pointer_cast>( + value_.find( + key_it->second)->second), current_alignment); + break; + default: + calculated_size += + calculator.calculate_serialized_size(std::static_pointer_cast( + value_.find(key_it->second)->second), current_alignment); + break; + + } + } + + break; + } + case TK_SEQUENCE: + { + TypeKind element_kind = + get_enclosing_typekind(traits::narrow( + type->get_descriptor().element_type())); + switch (element_kind) + { + case TK_INT32: + calculated_size = + calculator.calculate_serialized_size(*std::static_pointer_cast>( + value_.begin()->second), current_alignment); + break; + case TK_UINT32: + calculated_size = + calculator.calculate_serialized_size(*std::static_pointer_cast>( + value_.begin()->second), current_alignment); + break; + case TK_INT8: + calculated_size = + calculator.calculate_serialized_size(*std::static_pointer_cast>( + value_.begin()->second), current_alignment); + break; + case TK_INT16: + calculated_size = + calculator.calculate_serialized_size(*std::static_pointer_cast>( + value_.begin()->second), current_alignment); + break; + case TK_UINT16: + calculated_size = + calculator.calculate_serialized_size(*std::static_pointer_cast>( + value_.begin()->second), current_alignment); + break; + case TK_INT64: + calculated_size = + calculator.calculate_serialized_size(*std::static_pointer_cast>( + value_.begin()->second), current_alignment); + break; + case TK_UINT64: + calculated_size = + calculator.calculate_serialized_size(*std::static_pointer_cast>( + value_.begin()->second), current_alignment); + break; + case TK_FLOAT32: + calculated_size = + calculator.calculate_serialized_size(*std::static_pointer_cast>( + value_.begin()->second), current_alignment); + break; + case TK_FLOAT64: + calculated_size = + calculator.calculate_serialized_size(*std::static_pointer_cast>( + value_.begin()->second), current_alignment); + break; + case TK_FLOAT128: + calculated_size = + calculator.calculate_serialized_size(*std::static_pointer_cast>( + value_.begin()->second), current_alignment); + break; + case TK_CHAR8: + calculated_size = + calculator.calculate_serialized_size(*std::static_pointer_cast>( + value_.begin()->second), current_alignment); + break; + case TK_CHAR16: + calculated_size = + calculator.calculate_serialized_size(*std::static_pointer_cast>( + value_.begin()->second), current_alignment); + break; + case TK_BOOLEAN: + calculated_size = + calculator.calculate_serialized_size(*std::static_pointer_cast>( + value_.begin()->second), current_alignment); + break; + case TK_BYTE: + calculated_size = + calculator.calculate_serialized_size(*std::static_pointer_cast>( + value_.begin()->second), current_alignment); + break; + case TK_UINT8: + calculated_size = + calculator.calculate_serialized_size(*std::static_pointer_cast>( + value_.begin()->second), current_alignment); + break; + case TK_STRING8: + calculated_size = + calculator.calculate_serialized_size(*std::static_pointer_cast>( + value_.begin()->second), current_alignment); + break; + case TK_STRING16: + calculated_size = + calculator.calculate_serialized_size(*std::static_pointer_cast>( + value_.begin()->second), current_alignment); + break; + case TK_BITMASK: + { + uint32_t seq_length {0}; + auto vector_t {std::static_pointer_cast::ref_type>>( + value_.begin()->second)}; + calculated_size = calculator.calculate_serialized_size(seq_length, current_alignment); + calculated_size += + calculator.calculate_array_serialized_size(vector_t->data(), + vector_t->size(), current_alignment); + } + break; + default: + calculated_size = + calculator.calculate_serialized_size( + *std::static_pointer_cast::ref_type>>( + value_.begin()->second), current_alignment); + break; + + } + + break; + } + case TK_STRUCTURE: + { + eprosima::fastcdr::EncodingAlgorithmFlag encoding {get_fastcdr_encoding_flag( + type->get_descriptor().extensibility_kind(), + calculator.get_cdr_version())}; + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + calculated_size = calculator.begin_calculate_type_serialized_size(encoding, current_alignment); + + for (auto& member : type->get_all_members_by_index()) + { + it = value_.find(member->get_id()); + + if (it != value_.end()) + { + auto member_data = std::static_pointer_cast(it->second); + calculated_size += calculator.calculate_member_serialized_size( + member->get_id(), member_data, current_alignment); + } + } + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + break; + } + case TK_UNION: + { + eprosima::fastcdr::EncodingAlgorithmFlag encoding {get_fastcdr_encoding_flag( + type->get_descriptor().extensibility_kind(), + calculator.get_cdr_version())}; + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + calculated_size = calculator.begin_calculate_type_serialized_size(encoding, current_alignment); + + // Union discriminator + auto discriminator_data = std::static_pointer_cast(value_.at(0)); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + discriminator_data, current_alignment); + + if (MEMBER_ID_INVALID != selected_union_member_) + { + auto member_data = std::static_pointer_cast(value_.at(selected_union_member_)); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + member_data, current_alignment); + } + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + break; + } + default: + break; + } + + return calculated_size; +} + +bool DynamicDataImpl::deserialize( + eprosima::fastcdr::Cdr& cdr, + const traits::ref_type type) +{ + bool res = true; + + TypeKind type_kind = type->get_kind(); + auto begin_it = value_.begin(); + + switch (type_kind) + { + //{{{ Primitive types + case TK_INT32: + { + cdr >> *std::static_pointer_cast>(begin_it->second); + break; + } + case TK_UINT32: + { + cdr >> *std::static_pointer_cast>(begin_it->second); + break; + } + case TK_INT8: + { + cdr >> *std::static_pointer_cast>(begin_it->second); + break; + } + case TK_INT16: + { + cdr >> *std::static_pointer_cast>(begin_it->second); + break; + } + case TK_UINT16: + { + cdr >> *std::static_pointer_cast>(begin_it->second); + break; + } + case TK_INT64: + { + cdr >> *std::static_pointer_cast>(begin_it->second); + break; + } + case TK_UINT64: + { + cdr >> *std::static_pointer_cast>(begin_it->second); + break; + } + case TK_FLOAT32: + { + cdr >> *std::static_pointer_cast>(begin_it->second); + break; + } + case TK_FLOAT64: + { + cdr >> *std::static_pointer_cast>(begin_it->second); + break; + } + case TK_FLOAT128: + { + cdr >> *std::static_pointer_cast>(begin_it->second); + break; + } + case TK_CHAR8: + { + cdr >> *std::static_pointer_cast>(begin_it->second); + break; + } + case TK_CHAR16: + { + cdr >> *std::static_pointer_cast>(begin_it->second); + break; + } + case TK_BOOLEAN: + { + cdr >> *std::static_pointer_cast>(begin_it->second); + break; + } + case TK_BYTE: + { + cdr >> *std::static_pointer_cast>(begin_it->second); + break; + } + case TK_UINT8: + { + cdr >> *std::static_pointer_cast>(begin_it->second); + break; + } + case TK_STRING8: + { + cdr >> *std::static_pointer_cast>(begin_it->second); + break; + } + case TK_STRING16: + { + cdr >> *std::static_pointer_cast>(begin_it->second); + break; + } + //}}} + case TK_ARRAY: + { + TypeKind element_kind = + get_enclosing_typekind(traits::narrow( + type->get_descriptor().element_type())); + switch (element_kind) + { + case TK_INT32: + cdr.deserialize_array(*std::static_pointer_cast>(begin_it->second)); + break; + case TK_UINT32: + cdr.deserialize_array(*std::static_pointer_cast>(begin_it->second)); + break; + case TK_INT8: + cdr.deserialize_array(*std::static_pointer_cast>(begin_it->second)); + break; + case TK_INT16: + cdr.deserialize_array(*std::static_pointer_cast>(begin_it->second)); + break; + case TK_UINT16: + cdr.deserialize_array(*std::static_pointer_cast>(begin_it->second)); + break; + case TK_INT64: + cdr.deserialize_array(*std::static_pointer_cast>(begin_it->second)); + break; + case TK_UINT64: + cdr.deserialize_array(*std::static_pointer_cast>(begin_it->second)); + break; + case TK_FLOAT32: + cdr.deserialize_array(*std::static_pointer_cast>(begin_it->second)); + break; + case TK_FLOAT64: + cdr.deserialize_array(*std::static_pointer_cast>(begin_it->second)); + break; + case TK_FLOAT128: + cdr.deserialize_array(*std::static_pointer_cast>(begin_it->second)); + break; + case TK_CHAR8: + cdr.deserialize_array(*std::static_pointer_cast>(begin_it->second)); + break; + case TK_CHAR16: + cdr.deserialize_array(*std::static_pointer_cast>(begin_it->second)); + break; + case TK_BOOLEAN: + cdr.deserialize_array(*std::static_pointer_cast>(begin_it->second)); + break; + case TK_BYTE: + cdr.deserialize_array(*std::static_pointer_cast>(begin_it->second)); + break; + case TK_UINT8: + cdr.deserialize_array(*std::static_pointer_cast>(begin_it->second)); + break; + case TK_STRING8: + cdr.deserialize_array(*std::static_pointer_cast>(begin_it->second)); + break; + case TK_STRING16: + cdr.deserialize_array(*std::static_pointer_cast>(begin_it->second)); + break; + case TK_BITMASK: + { + auto vector_t {std::static_pointer_cast::ref_type>>( + begin_it->second)}; + cdr.deserialize_array(vector_t->data(), vector_t->size()); + break; + } + default: + cdr.deserialize_array(*std::static_pointer_cast::ref_type>>( + begin_it->second)); + break; + } + break; + } + case TK_BITMASK: + { + uint64_t value {0}; + auto sequence = std::static_pointer_cast>(begin_it->second); + assert(1 == type->get_descriptor().bound().size()); + auto bound = type->get_descriptor().bound().at(0); + + if (9 > bound) + { + uint8_t value_get {0}; + cdr >> value_get; + value = value_get; + } + else if (17 > bound) + { + uint16_t value_get {0}; + cdr >> value_get; + value = value_get; + } + else if (33 > bound) + { + uint32_t value_get {0}; + cdr >> value_get; + value = value_get; + } + else + { + cdr >> value; + } + + for (size_t pos {0}; pos < sequence->size(); ++pos) + { + if (value & (0x1ull << pos)) + { + sequence->at(pos) = true; + } + else + { + sequence->at(pos) = false; + } + } + break; + } + case TK_BITSET: + { + std::bitset<64> bitset; + assert(0 < type->get_all_members_by_index().size()); + auto sum {type->get_all_members_by_index().rbegin()->get()->get_id() + + *type->get_descriptor().bound().rbegin()}; + + if (9 > sum) + { + std::bitset<8> new_bitset; + cdr >> new_bitset; + bitset = {new_bitset.to_ullong()}; + } + else if (17 > sum) + { + std::bitset<16> new_bitset; + cdr >> new_bitset; + bitset = {new_bitset.to_ullong()}; + } + else if (33 > sum) + { + std::bitset<32> new_bitset; + cdr >> new_bitset; + bitset = {new_bitset.to_ullong()}; + } + else + { + cdr >> bitset; + } + + size_t index = 0; + for (auto& member : type->get_all_members_by_index()) + { + MemberId member_id {member->get_id()}; + auto it = value_.find(member_id); + + if (it != value_.end()) + { + int64_t value {0}; + auto base {member_id}; + auto size {type->get_descriptor().bound().at(index)}; + auto member_data {std::static_pointer_cast(it->second)}; + + for (uint32_t i = 0; i < size; ++i) + { + if (bitset.test(i + base)) + { + value |= 0x1ull << i; + } + } + + TypeKind element_kind { + get_enclosing_typekind(traits::narrow( + member->get_descriptor().type()))}; + ReturnCode_t ret_value {RETCODE_ERROR}; + + switch (element_kind) + { + case TK_BOOLEAN: + ret_value = member_data->set_value(MEMBER_ID_INVALID, + static_cast>(value)); + break; + case TK_BYTE: + ret_value = member_data->set_value(MEMBER_ID_INVALID, + static_cast>(value)); + break; + case TK_INT8: + ret_value = member_data->set_value(MEMBER_ID_INVALID, + static_cast>(value)); + break; + case TK_UINT8: + ret_value = member_data->set_value(MEMBER_ID_INVALID, + static_cast>(value)); + break; + case TK_INT16: + ret_value = member_data->set_value(MEMBER_ID_INVALID, + static_cast>(value)); + break; + case TK_UINT16: + ret_value = member_data->set_value(MEMBER_ID_INVALID, + static_cast>(value)); + break; + case TK_INT32: + ret_value = member_data->set_value(MEMBER_ID_INVALID, + static_cast>(value)); + break; + case TK_UINT32: + ret_value = member_data->set_value(MEMBER_ID_INVALID, + static_cast>(value)); + break; + case TK_INT64: + ret_value = member_data->set_value(MEMBER_ID_INVALID, + static_cast>(value)); + break; + case TK_UINT64: + ret_value = member_data->set_value(MEMBER_ID_INVALID, + static_cast>(value)); + break; + default: + break; + } + + if (RETCODE_OK != ret_value) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, + "Error retrieving bitset bitfield value"); + } + } + else + { + EPROSIMA_LOG_ERROR(DYN_TYPES, + "Error deserializing bitset bitfield because it is not found on DynamicData"); + } + + ++index; + } + break; + } + case TK_MAP: + { + TypeKind key_kind { get_enclosing_typekind(traits::narrow( + type->get_descriptor().key_element_type()))}; + TypeKind element_kind { get_enclosing_typekind(traits::narrow( + type->get_descriptor().element_type()))}; + bool is_primitive {TK_BITMASK == element_kind || (!is_complex_kind(element_kind) && + TK_STRING8 != element_kind && + TK_STRING16 != element_kind)}; + uint32_t dheader {0}; + + if (!is_primitive && eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version()) + { + cdr >> dheader; + } + + clear_all_values(); + + auto offset {cdr.get_current_position()}; + uint32_t length {0}; + cdr >> length; + + for (uint32_t count {0}; + (is_primitive || eprosima::fastcdr::CdrVersion::XCDRv2 != cdr.get_cdr_version() || + static_cast(cdr.get_current_position() - offset) < dheader) && count < length; ++count) + { + if (static_cast(LENGTH_UNLIMITED) == type->get_descriptor().bound().at(0) || + type->get_descriptor().bound().at(0) > key_to_id_.size()) + { + std::string key; + switch (key_kind) + { + case TK_INT32: + { + TypeForKind value {0}; + cdr >> value; + key = std::to_string(value); + } + break; + case TK_UINT32: + { + TypeForKind value {0}; + cdr >> value; + key = std::to_string(value); + } + break; + case TK_INT8: + { + TypeForKind value {0}; + cdr >> value; + key = std::to_string(value); + } + break; + case TK_INT16: + { + TypeForKind value {0}; + cdr >> value; + key = std::to_string(value); + } + break; + case TK_UINT16: + { + TypeForKind value {0}; + cdr >> value; + key = std::to_string(value); + } + break; + case TK_INT64: + { + TypeForKind value {0}; + cdr >> value; + key = std::to_string(value); + } + break; + case TK_UINT64: + { + TypeForKind value {0}; + cdr >> value; + key = std::to_string(value); + } + break; + case TK_FLOAT32: + { + TypeForKind value {0}; + cdr >> value; + key = std::to_string(value); + } + break; + case TK_FLOAT64: + { + TypeForKind value {0}; + cdr >> value; + key = std::to_string(value); + } + break; + case TK_FLOAT128: + { + TypeForKind value {0}; + cdr >> value; + key = std::to_string(value); + } + break; + case TK_CHAR8: + { + TypeForKind value {0}; + cdr >> value; + key = std::to_string(value); + } + break; + case TK_CHAR16: + { + TypeForKind value {0}; + cdr >> value; + key = std::to_string(value); + } + break; + case TK_BOOLEAN: + { + TypeForKind value {0}; + cdr >> value; + key = std::to_string(value); + } + break; + case TK_BYTE: + { + TypeForKind value {0}; + cdr >> value; + key = std::to_string(value); + } + break; + case TK_UINT8: + { + TypeForKind value {0}; + cdr >> value; + key = std::to_string(value); + } + break; + case TK_STRING8: + { + cdr >> key; + } + break; + case TK_STRING16: + EPROSIMA_LOG_ERROR(DYN_TYPES, "Map's key type cannot be WString. Not supported"); + assert(false); + break; + default: + assert(false); + break; + + } + MemberId id = next_map_member_id_++; + key_to_id_[key] = id; + std::map>::iterator insert_it {value_.end()}; + + if (!is_complex_kind(element_kind)) + { + insert_it = add_value(element_kind, id); + } + else + { + traits::ref_type data = DynamicDataFactory::get_instance()->create_data( + type->get_descriptor().element_type()); + insert_it = value_.emplace(id, data).first; + } + + switch (element_kind) + { + case TK_INT32: + cdr >> *std::static_pointer_cast>(insert_it->second); + break; + case TK_UINT32: + cdr >> *std::static_pointer_cast>(insert_it->second); + break; + case TK_INT8: + cdr >> *std::static_pointer_cast>(insert_it->second); + break; + case TK_INT16: + cdr >> *std::static_pointer_cast>(insert_it->second); + break; + case TK_UINT16: + cdr >> *std::static_pointer_cast>(insert_it->second); + break; + case TK_INT64: + cdr >> *std::static_pointer_cast>(insert_it->second); + break; + case TK_UINT64: + cdr >> *std::static_pointer_cast>(insert_it->second); + break; + case TK_FLOAT32: + cdr >> *std::static_pointer_cast>(insert_it->second); + break; + case TK_FLOAT64: + cdr >> *std::static_pointer_cast>(insert_it->second); + break; + case TK_FLOAT128: + cdr >> *std::static_pointer_cast>(insert_it->second); + break; + case TK_CHAR8: + cdr >> *std::static_pointer_cast>(insert_it->second); + break; + case TK_CHAR16: + cdr >> *std::static_pointer_cast>(insert_it->second); + break; + case TK_BOOLEAN: + cdr >> *std::static_pointer_cast>(insert_it->second); + break; + case TK_BYTE: + cdr >> *std::static_pointer_cast>(insert_it->second); + break; + case TK_UINT8: + cdr >> *std::static_pointer_cast>(insert_it->second); + break; + case TK_STRING8: + cdr >> *std::static_pointer_cast>(insert_it->second); + break; + case TK_STRING16: + cdr >> *std::static_pointer_cast>(insert_it->second); + break; + default: + traits::ref_type member_data = + std::static_pointer_cast( + insert_it->second); + cdr >> member_data; + break; + + } + + } + } + + if (!is_primitive && eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() && + static_cast(cdr.get_current_position() - offset) != dheader) + { + throw fastcdr::exception::BadParamException( + "Member size differs from the size specified by DHEADER"); + } + + break; + } + case TK_SEQUENCE: + { + TypeKind element_kind = + get_enclosing_typekind(traits::narrow( + type->get_descriptor().element_type())); + switch (element_kind) + { + case TK_INT32: + cdr >> *std::static_pointer_cast>(begin_it->second); + break; + case TK_UINT32: + cdr >> *std::static_pointer_cast>(begin_it->second); + break; + case TK_INT8: + cdr >> *std::static_pointer_cast>(begin_it->second); + break; + case TK_INT16: + cdr >> *std::static_pointer_cast>(begin_it->second); + break; + case TK_UINT16: + cdr >> *std::static_pointer_cast>(begin_it->second); + break; + case TK_INT64: + cdr >> *std::static_pointer_cast>(begin_it->second); + break; + case TK_UINT64: + cdr >> *std::static_pointer_cast>(begin_it->second); + break; + case TK_FLOAT32: + cdr >> *std::static_pointer_cast>(begin_it->second); + break; + case TK_FLOAT64: + cdr >> *std::static_pointer_cast>(begin_it->second); + break; + case TK_FLOAT128: + cdr >> *std::static_pointer_cast>(begin_it->second); + break; + case TK_CHAR8: + cdr >> *std::static_pointer_cast>(begin_it->second); + break; + case TK_CHAR16: + cdr >> *std::static_pointer_cast>(begin_it->second); + break; + case TK_BOOLEAN: + cdr >> *std::static_pointer_cast>(begin_it->second); + break; + case TK_BYTE: + cdr >> *std::static_pointer_cast>(begin_it->second); + break; + case TK_UINT8: + cdr >> *std::static_pointer_cast>(begin_it->second); + break; + case TK_STRING8: + cdr >> *std::static_pointer_cast>(begin_it->second); + break; + case TK_STRING16: + cdr >> *std::static_pointer_cast>(begin_it->second); + break; + default: + { + auto vector_t = std::static_pointer_cast ::ref_type >> ( + begin_it->second); + uint32_t sequence_length {0}; + + if (TK_BITMASK != element_kind && + fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version()) + { + uint32_t dheader {0}; + cdr.deserialize(dheader); + + auto offset {cdr.get_current_position()}; + + cdr.deserialize(sequence_length); + + if (0 == sequence_length) + { + vector_t->clear(); + } + else + { + auto element_type = + get_enclosing_type(traits::narrow( + type->get_descriptor().element_type())); + + vector_t->resize(sequence_length); + + for (size_t pos = 0; pos < vector_t->size(); ++pos) + { + if (!vector_t->at(pos)) + { + vector_t->at(pos) = traits::narrow( + DynamicDataFactory::get_instance()->create_data(element_type)); + } + } + + uint32_t count {0}; + while (static_cast(cdr.get_current_position() - offset) < dheader && + count < sequence_length) + { + cdr.deserialize(vector_t->data()[count]); + ++count; + } + + if (static_cast(cdr.get_current_position() - offset) != dheader) + { + throw fastcdr::exception::BadParamException( + "Member size differs from the size specified by DHEADER"); + } + } + } + else + { + fastcdr::Cdr::state state_before_error(cdr); + + cdr.deserialize(sequence_length); + + if (sequence_length == 0) + { + vector_t->clear(); + } + else + { + auto element_type = + get_enclosing_type(traits::narrow( + type->get_descriptor().element_type())); + try + { + vector_t->resize(sequence_length); + for (size_t pos = 0; pos < vector_t->size(); ++pos) + { + if (!vector_t->at(pos)) + { + vector_t->at(pos) = traits::narrow( + DynamicDataFactory::get_instance()->create_data(element_type)); + } + } + cdr.deserialize_array(vector_t->data(), vector_t->size()); + } + catch (fastcdr::exception::Exception& ex) + { + cdr.set_state(state_before_error); + ex.raise(); + } + } + } + } + break; + } + break; + } + case TK_STRUCTURE: + { + eprosima::fastcdr::EncodingAlgorithmFlag encoding {get_fastcdr_encoding_flag( + type->get_descriptor().extensibility_kind(), + cdr.get_cdr_version())}; + cdr.deserialize_type(encoding, + [&](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + + traits::ref_type member; + + if (ExtensibilityKind::MUTABLE == type->get_descriptor().extensibility_kind()) + { + ret_value = (RETCODE_OK == type->get_member(member, mid.id)); + } + else + { + ret_value = (RETCODE_OK == type->get_member_by_index(member, mid.id)); + } + + if (ret_value) + { + auto member_impl = traits::narrow(member); + traits::ref_type member_data; + auto it = value_.find(member_impl->get_id()); + + if (it != value_.end()) + { + member_data = std::static_pointer_cast(it->second); + } + else + { + member_data = + traits::narrow(DynamicDataFactory::get_instance() + ->create_data( + member_impl->get_descriptor().type())); + value_.emplace(it->first, member_data); + } + + dcdr >> member_data; + } + + return ret_value; + }); + break; + } + case TK_UNION: + { + eprosima::fastcdr::EncodingAlgorithmFlag encoding {get_fastcdr_encoding_flag( + type->get_descriptor().extensibility_kind(), + cdr.get_cdr_version())}; + cdr.deserialize_type(encoding, + [&](eprosima::fastcdr::Cdr& dcdr, + const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + + switch (mid.id) + { + case 0: + { + traits::ref_type member_data = + std::static_pointer_cast(value_.at( + 0)); + dcdr >> member_data; + + // Select member pointed by discriminator. + int64_t discriminator {0}; + uint64_t udiscriminator {0}; + selected_union_member_ = MEMBER_ID_INVALID; + ReturnCode_t dyn_ret_value = get_int64_value(discriminator, 0); + if (RETCODE_OK != dyn_ret_value) + { + dyn_ret_value = get_uint64_value(udiscriminator, 0); + discriminator = static_cast(udiscriminator); + } + + if (RETCODE_OK == dyn_ret_value) + { + for (auto member : type->get_all_members_by_index()) + { + auto m_impl {traits::narrow( + member)}; + + for (auto label : m_impl->get_descriptor().label()) + { + if (static_cast(discriminator) == label) + { + selected_union_member_ = m_impl->get_id(); + break; + } + } + } + + if (MEMBER_ID_INVALID == selected_union_member_) + { + selected_union_member_ = type->default_union_member(); + } + } + else + { + throw fastcdr::exception::BadParamException("Wrong discriminator"); + } + } + break; + default: + { + if (1 == value_.count(selected_union_member_)) + { + // Check MemberId in mutable case. + auto member_data {std::static_pointer_cast(value_.at( + selected_union_member_))}; + dcdr >> member_data; + // In case it is not MUTABLE, we have to inform fastcdr to stop returning `false`. + if (ExtensibilityKind::MUTABLE != type->get_descriptor().extensibility_kind()) + { + ret_value = false; + } + } + else + { + throw fastcdr::exception::BadParamException( + "Cannot deserialize union member due to wrong discriminator value"); + } + } + break; + } + + return ret_value; + }); + + break; + } + default: + break; + } + + return res; +} + +void DynamicDataImpl::serialize( + eprosima::fastcdr::Cdr& cdr, + const traits::ref_type type) const +{ + TypeKind type_kind = type->get_kind(); + auto begin_it = value_.begin(); + + switch (type_kind) + { + //{{{ Primitive types + case TK_INT32: + { + cdr << *std::static_pointer_cast>(begin_it->second); + break; + } + case TK_UINT32: + { + cdr << *std::static_pointer_cast>(begin_it->second); + break; + } + case TK_INT8: + { + cdr << *std::static_pointer_cast>(begin_it->second); + break; + } + case TK_INT16: + { + cdr << *std::static_pointer_cast>(begin_it->second); + break; + } + case TK_UINT16: + { + cdr << *std::static_pointer_cast>(begin_it->second); + break; + } + case TK_INT64: + { + cdr << *std::static_pointer_cast>(begin_it->second); + break; + } + case TK_UINT64: + { + cdr << *std::static_pointer_cast>(begin_it->second); + break; + } + case TK_FLOAT32: + { + cdr << *std::static_pointer_cast>(begin_it->second); + break; + } + case TK_FLOAT64: + { + cdr << *std::static_pointer_cast>(begin_it->second); + break; + } + case TK_FLOAT128: + { + cdr << *std::static_pointer_cast>(begin_it->second); + break; + } + case TK_CHAR8: + { + cdr << *std::static_pointer_cast>(begin_it->second); + break; + } + case TK_CHAR16: + { + cdr << *std::static_pointer_cast>(begin_it->second); + break; + } + case TK_BOOLEAN: + { + cdr << *std::static_pointer_cast>(begin_it->second); + break; + } + case TK_BYTE: + { + cdr << *std::static_pointer_cast>(begin_it->second); + break; + } + case TK_UINT8: + { + cdr << *std::static_pointer_cast>(begin_it->second); + break; + } + case TK_STRING8: + { + cdr << *std::static_pointer_cast>(begin_it->second); + break; + } + case TK_STRING16: + { + cdr << *std::static_pointer_cast>(begin_it->second); + break; + } + //}}} + case TK_ARRAY: + { + TypeKind element_kind {get_enclosing_typekind(traits::narrow( + type->get_descriptor().element_type()))}; + switch (element_kind) + { + case TK_INT32: + cdr.serialize_array(*std::static_pointer_cast>(begin_it->second)); + break; + case TK_UINT32: + cdr.serialize_array(*std::static_pointer_cast>(begin_it->second)); + break; + case TK_INT8: + cdr.serialize_array(*std::static_pointer_cast>(begin_it->second)); + break; + case TK_INT16: + cdr.serialize_array(*std::static_pointer_cast>(begin_it->second)); + break; + case TK_UINT16: + cdr.serialize_array(*std::static_pointer_cast>(begin_it->second)); + break; + case TK_INT64: + cdr.serialize_array(*std::static_pointer_cast>(begin_it->second)); + break; + case TK_UINT64: + cdr.serialize_array(*std::static_pointer_cast>(begin_it->second)); + break; + case TK_FLOAT32: + cdr.serialize_array(*std::static_pointer_cast>(begin_it->second)); + break; + case TK_FLOAT64: + cdr.serialize_array(*std::static_pointer_cast>(begin_it->second)); + break; + case TK_FLOAT128: + cdr.serialize_array(*std::static_pointer_cast>(begin_it->second)); + break; + case TK_CHAR8: + cdr.serialize_array(*std::static_pointer_cast>(begin_it->second)); + break; + case TK_CHAR16: + cdr.serialize_array(*std::static_pointer_cast>(begin_it->second)); + break; + case TK_BOOLEAN: + cdr.serialize_array(*std::static_pointer_cast>(begin_it->second)); + break; + case TK_BYTE: + cdr.serialize_array(*std::static_pointer_cast>(begin_it->second)); + break; + case TK_UINT8: + cdr.serialize_array(*std::static_pointer_cast>(begin_it->second)); + break; + case TK_STRING8: + cdr.serialize_array(*std::static_pointer_cast>(begin_it->second)); + break; + case TK_STRING16: + cdr.serialize_array(*std::static_pointer_cast>(begin_it->second)); + break; + case TK_BITMASK: + { + auto vector_t {std::static_pointer_cast::ref_type>>( + begin_it->second)}; + cdr.serialize_array(vector_t->data(), vector_t->size()); + break; + } + default: + cdr.serialize_array(*std::static_pointer_cast::ref_type>>( + begin_it->second)); + break; + } + + break; + } + case TK_BITMASK: + { + uint64_t value {0}; + auto sequence = std::static_pointer_cast>(begin_it->second); + assert(1 == type->get_descriptor().bound().size()); + auto bound = type->get_descriptor().bound().at(0); + + for (size_t pos {0}; pos < sequence->size(); ++pos) + { + if (sequence->at(pos)) + { + value |= 0x1ull << pos; + } + } + + if (9 > bound) + { + cdr << static_cast(value); + } + else if (17 > bound) + { + cdr << static_cast(value); + } + else if (33 > bound) + { + cdr << static_cast(value); + } + else + { + cdr << value; + } + break; + } + case TK_BITSET: + { + size_t index = 0; + size_t sum {0}; + std::bitset<64> bitset; + for (auto& member : type->get_all_members_by_index()) + { + MemberId member_id {member->get_id()}; + auto it = value_.find(member_id); + + if (it != value_.end()) + { + int64_t value {0}; + auto member_data {std::static_pointer_cast(it->second)}; + + if (RETCODE_OK == member_data->get_value(value, MEMBER_ID_INVALID)) + { + auto base {member_id}; + auto size {type->get_descriptor().bound().at(index)}; + for (auto i = base; i < base + size; ++i) + { + bitset.set(i, !!(value & 0x01)); + value = value >> 1; + } + assert(sum <= base); + sum = base + size; + } + else + { + EPROSIMA_LOG_ERROR(DYN_TYPES, + "Error retrieving bitset bitfield value"); + } + } + else + { + EPROSIMA_LOG_ERROR(DYN_TYPES, + "Error serializing bitset bitfield because it is not found on DynamicData"); + } + + ++index; + } + + if (9 > sum) + { + std::bitset<8> new_bitset(bitset.to_ullong()); + cdr << new_bitset; + } + else if (17 > sum) + { + std::bitset<16> new_bitset(bitset.to_ullong()); + cdr << new_bitset; + } + else if (33 > sum) + { + std::bitset<32> new_bitset(bitset.to_ullong()); + cdr << new_bitset; + } + else + { + cdr << bitset; + } + break; + } + case TK_MAP: + { + TypeKind key_kind {get_enclosing_typekind(traits::narrow( + type->get_descriptor().key_element_type()))}; + TypeKind element_kind {get_enclosing_typekind(traits::narrow( + type->get_descriptor().element_type()))}; + bool is_primitive {TK_BITMASK == element_kind || (!is_complex_kind(element_kind) && + TK_STRING8 != element_kind && + TK_STRING16 != element_kind)}; + eprosima::fastcdr::Cdr::state dheader_state{!is_primitive ? cdr.allocate_xcdrv2_dheader() : + eprosima::fastcdr::Cdr::state{cdr}}; + + assert(key_to_id_.size() == value_.size()); + cdr << static_cast(key_to_id_.size()); + + for (auto it = key_to_id_.begin(); it != key_to_id_.end(); ++it) + { + switch (key_kind) + { + case TK_INT32: + { + TypeForKind value = TypeValueConverter::sto(it->first); + cdr << value; + } + break; + case TK_UINT32: + { + TypeForKind value = TypeValueConverter::sto(it->first); + cdr << value; + } + break; + case TK_INT8: + { + TypeForKind value = TypeValueConverter::sto(it->first); + cdr << value; + } + break; + case TK_INT16: + { + TypeForKind value = TypeValueConverter::sto(it->first); + cdr << value; + } + break; + case TK_UINT16: + { + TypeForKind value = TypeValueConverter::sto(it->first); + cdr << value; + } + break; + case TK_INT64: + { + TypeForKind value = TypeValueConverter::sto(it->first); + cdr << value; + } + break; + case TK_UINT64: + { + TypeForKind value = TypeValueConverter::sto(it->first); + cdr << value; + } + break; + case TK_FLOAT32: + { + TypeForKind value = TypeValueConverter::sto(it->first); + cdr << value; + } + break; + case TK_FLOAT64: + { + TypeForKind value = TypeValueConverter::sto(it->first); + cdr << value; + } + break; + case TK_FLOAT128: + { + TypeForKind value = TypeValueConverter::sto(it->first); + cdr << value; + } + break; + case TK_CHAR8: + { + TypeForKind value = TypeValueConverter::sto(it->first); + cdr << value; + } + break; + case TK_CHAR16: + { + TypeForKind value = TypeValueConverter::sto(it->first); + cdr << value; + } + break; + case TK_BOOLEAN: + { + TypeForKind value = TypeValueConverter::sto(it->first); + cdr << value; + } + break; + case TK_BYTE: + { + TypeForKind value = TypeValueConverter::sto(it->first); + cdr << value; + } + break; + case TK_UINT8: + { + TypeForKind value = TypeValueConverter::sto(it->first); + cdr << value; + } + break; + case TK_STRING8: + { + cdr << it->first; + } + break; + case TK_STRING16: + EPROSIMA_LOG_ERROR(DYN_TYPES, "Map's key type cannot be WString. Not supported"); + assert(false); + break; + default: + assert(false); + break; + + } + assert(value_.end() != value_.find(it->second)); + switch (element_kind) + { + case TK_INT32: + cdr << *std::static_pointer_cast>(value_.find(it->second)->second); + break; + case TK_UINT32: + cdr << *std::static_pointer_cast>(value_.find(it->second)->second); + break; + case TK_INT8: + cdr << *std::static_pointer_cast>(value_.find(it->second)->second); + break; + case TK_INT16: + cdr << *std::static_pointer_cast>(value_.find(it->second)->second); + break; + case TK_UINT16: + cdr << *std::static_pointer_cast>(value_.find(it->second)->second); + break; + case TK_INT64: + cdr << *std::static_pointer_cast>(value_.find(it->second)->second); + break; + case TK_UINT64: + cdr << *std::static_pointer_cast>(value_.find(it->second)->second); + break; + case TK_FLOAT32: + cdr << *std::static_pointer_cast>(value_.find(it->second)->second); + break; + case TK_FLOAT64: + cdr << *std::static_pointer_cast>(value_.find(it->second)->second); + break; + case TK_FLOAT128: + cdr << *std::static_pointer_cast>(value_.find(it->second)->second); + break; + case TK_CHAR8: + cdr << *std::static_pointer_cast>(value_.find(it->second)->second); + break; + case TK_CHAR16: + cdr << *std::static_pointer_cast>(value_.find(it->second)->second); + break; + case TK_BOOLEAN: + cdr << *std::static_pointer_cast>(value_.find(it->second)->second); + break; + case TK_BYTE: + cdr << *std::static_pointer_cast>(value_.find(it->second)->second); + break; + case TK_UINT8: + cdr << *std::static_pointer_cast>(value_.find(it->second)->second); + break; + case TK_STRING8: + cdr << *std::static_pointer_cast>(value_.find(it->second)->second); + break; + case TK_STRING16: + cdr << *std::static_pointer_cast>(value_.find(it->second)->second); + break; + default: + cdr << std::static_pointer_cast(value_.find(it->second)->second); + break; + + } + } + + if (!is_primitive) + { + cdr.set_xcdrv2_dheader(dheader_state); + } + + break; + } + case TK_SEQUENCE: + { + TypeKind element_kind {get_enclosing_typekind(traits::narrow( + type->get_descriptor().element_type()))}; + switch (element_kind) + { + case TK_INT32: + cdr << *std::static_pointer_cast>(begin_it->second); + break; + case TK_UINT32: + cdr << *std::static_pointer_cast>(begin_it->second); + break; + case TK_INT8: + cdr << *std::static_pointer_cast>(begin_it->second); + break; + case TK_INT16: + cdr << *std::static_pointer_cast>(begin_it->second); + break; + case TK_UINT16: + cdr << *std::static_pointer_cast>(begin_it->second); + break; + case TK_INT64: + cdr << *std::static_pointer_cast>(begin_it->second); + break; + case TK_UINT64: + cdr << *std::static_pointer_cast>(begin_it->second); + break; + case TK_FLOAT32: + cdr << *std::static_pointer_cast>(begin_it->second); + break; + case TK_FLOAT64: + cdr << *std::static_pointer_cast>(begin_it->second); + break; + case TK_FLOAT128: + cdr << *std::static_pointer_cast>(begin_it->second); + break; + case TK_CHAR8: + cdr << *std::static_pointer_cast>(begin_it->second); + break; + case TK_CHAR16: + cdr << *std::static_pointer_cast>(begin_it->second); + break; + case TK_BOOLEAN: + cdr << *std::static_pointer_cast>(begin_it->second); + break; + case TK_BYTE: + cdr << *std::static_pointer_cast>(begin_it->second); + break; + case TK_UINT8: + cdr << *std::static_pointer_cast>(begin_it->second); + break; + case TK_STRING8: + cdr << *std::static_pointer_cast>(begin_it->second); + break; + case TK_STRING16: + cdr << *std::static_pointer_cast>(begin_it->second); + break; + default: + { + auto vector_t = std::static_pointer_cast ::ref_type >> ( + begin_it->second); + + if (TK_BITMASK != element_kind && + fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version()) + { + fastcdr::Cdr::state dheader_state {cdr.allocate_xcdrv2_dheader()}; + + cdr.serialize(static_cast(vector_t->size())); + + try + { + cdr.serialize_array(vector_t->data(), vector_t->size()); + } + catch (fastcdr::exception::Exception& ex) + { + cdr.set_state(dheader_state); + ex.raise(); + } + + cdr.set_xcdrv2_dheader(dheader_state); + } + else + { + fastcdr::Cdr::state state_before_error(cdr); + cdr.serialize(static_cast(vector_t->size())); + + try + { + cdr.serialize_array(vector_t->data(), vector_t->size()); + } + catch (fastcdr::exception::Exception& ex) + { + cdr.set_state(state_before_error); + ex.raise(); + } + + } + } + break; + } + + break; + } + case TK_STRUCTURE: + { + eprosima::fastcdr::EncodingAlgorithmFlag encoding {get_fastcdr_encoding_flag( + type->get_descriptor().extensibility_kind(), + cdr.get_cdr_version())}; + eprosima::fastcdr::Cdr::state current_state(cdr); + cdr.begin_serialize_type(current_state, encoding); + + for (auto& member : type->get_all_members_by_index()) + { + auto it = value_.find(member->get_id()); + + if (it != value_.end()) + { + auto member_data {std::static_pointer_cast(it->second)}; + + cdr << eprosima::fastcdr::MemberId{member->get_id()} << member_data; + } + else + { + EPROSIMA_LOG_ERROR(DYN_TYPES, + "Error serializing structure member because it is not found on DynamicData"); + } + } + + cdr.end_serialize_type(current_state); + break; + } + case TK_UNION: + { + eprosima::fastcdr::EncodingAlgorithmFlag encoding {get_fastcdr_encoding_flag( + type->get_descriptor().extensibility_kind(), + cdr.get_cdr_version())}; + eprosima::fastcdr::Cdr::state current_state(cdr); + cdr.begin_serialize_type(current_state, encoding); + + // The union_id_ must be serialized as a discriminator_type_ + auto discriminator_data {std::static_pointer_cast(value_.at(0))}; + cdr << eprosima::fastcdr::MemberId{0} << discriminator_data; + + if (MEMBER_ID_INVALID != selected_union_member_) + { + auto member_data = std::static_pointer_cast(value_.at(selected_union_member_)); + cdr << eprosima::fastcdr::MemberId{selected_union_member_} << member_data; + } + + cdr.end_serialize_type(current_state); + break; + } + default: + break; + } +} + +//}}} + +} // namespace dds + +} // namespace fastdds +} // namespace eprosima diff --git a/src/cpp/fastdds/xtypes/dynamic_types/DynamicDataImpl.hpp b/src/cpp/fastdds/xtypes/dynamic_types/DynamicDataImpl.hpp index 70886132829..09edfd74f02 100644 --- a/src/cpp/fastdds/xtypes/dynamic_types/DynamicDataImpl.hpp +++ b/src/cpp/fastdds/xtypes/dynamic_types/DynamicDataImpl.hpp @@ -15,341 +15,749 @@ #ifndef FASTDDS_XTYPES_DYNAMIC_TYPES_DYNAMICDATAIMPL_HPP #define FASTDDS_XTYPES_DYNAMIC_TYPES_DYNAMICDATAIMPL_HPP -#include - #include #include -#include +#include +#include #include "DynamicTypeImpl.hpp" +#include "TypeForKind.hpp" namespace eprosima { + +namespace fastcdr { +class Cdr; +class CdrSizeCalculator; +} // namespace fastcdr + namespace fastdds { namespace dds { class DynamicDataImpl : public traits::base_type { + //{{{ Implementation members of DynamicData + + //! The associated type. + traits::ref_type type_; + + //! Enclosed type in case of `type_` is TK_ALIAS or TK_ENUM. In other case, the same value as `type_`. + traits::ref_type enclosing_type_; + + //! Contains the values of the current sample. + std::map> value_; + + //! Used in TK_MAP to maintain correlation between keys and MemberIds. + std::map key_to_id_; + + //! Used in TK_MAP to know which is the next MemberId to be used. + MemberId next_map_member_id_ {0}; + + //! Stores the loaned values by the user. + std::vector loaned_values_; + + //! Points to the current selected member in the union. + MemberId selected_union_member_ {MEMBER_ID_INVALID}; + + //}}} + public: + //{{{ Public functions + + DynamicDataImpl() noexcept = default; + DynamicDataImpl( traits::ref_type type) noexcept; - traits::ref_type type() noexcept override; + ReturnCode_t clear_all_values() noexcept override; - ReturnCode_t get_descriptor( - traits::ref_type value, + ReturnCode_t clear_nonkey_values() noexcept override; + + ReturnCode_t clear_value( MemberId id) noexcept override; + traits::ref_type clone() noexcept override; + bool equals( traits::ref_type other) noexcept override; - MemberId get_member_id_by_name( - const ObjectName& name) noexcept override; + ReturnCode_t get_descriptor( + traits::ref_type& value, + MemberId id) noexcept override; + + uint32_t get_item_count() noexcept override; MemberId get_member_id_at_index( uint32_t index) noexcept override; - uint32_t get_item_count() noexcept override; + MemberId get_member_id_by_name( + const ObjectName& name) noexcept override; - ReturnCode_t clear_all_values() noexcept override; + //{{{ Getters - ReturnCode_t clear_nonkey_values() noexcept override; + //{{{ Primitive getters - ReturnCode_t clear_value( + ReturnCode_t get_int32_value( + int32_t& value, + MemberId id) noexcept override; + + ReturnCode_t get_uint32_value( + uint32_t& value, + MemberId id) noexcept override; + + ReturnCode_t get_int8_value( + int8_t& value, + MemberId id) noexcept override; + + ReturnCode_t get_uint8_value( + uint8_t& value, + MemberId id) noexcept override; + + ReturnCode_t get_int16_value( + int16_t& value, + MemberId id) noexcept override; + + ReturnCode_t get_uint16_value( + uint16_t& value, + MemberId id) noexcept override; + + ReturnCode_t get_int64_value( + int64_t& value, + MemberId id) noexcept override; + + ReturnCode_t get_uint64_value( + uint64_t& value, + MemberId id) noexcept override; + + ReturnCode_t get_float32_value( + float& value, + MemberId id) noexcept override; + + ReturnCode_t get_float64_value( + double& value, + MemberId id) noexcept override; + + ReturnCode_t get_float128_value( + long double& value, + MemberId id) noexcept override; + + ReturnCode_t get_char8_value( + char& value, + MemberId id) noexcept override; + + ReturnCode_t get_char16_value( + wchar_t& value, + MemberId id) noexcept override; + + ReturnCode_t get_byte_value( + eprosima::fastrtps::rtps::octet& value, + MemberId id) noexcept override; + + ReturnCode_t get_boolean_value( + bool& value, + MemberId id) noexcept override; + + ReturnCode_t get_string_value( + std::string& value, + MemberId id) noexcept override; + + ReturnCode_t get_wstring_value( + std::wstring& value, + MemberId id) noexcept override; + + //}}} + + ReturnCode_t get_complex_value( + traits::ref_type& value, + MemberId id) noexcept override; + + //{{{ Array getters + + ReturnCode_t get_int32_values( + Int32Seq& value, + MemberId id) noexcept override; + + ReturnCode_t get_uint32_values( + UInt32Seq& value, + MemberId id) noexcept override; + + ReturnCode_t get_int8_values( + Int8Seq& value, + MemberId id) noexcept override; + + ReturnCode_t get_uint8_values( + UInt8Seq& value, + MemberId id) noexcept override; + + ReturnCode_t get_int16_values( + Int16Seq& value, + MemberId id) noexcept override; + + ReturnCode_t get_uint16_values( + UInt16Seq& value, + MemberId id) noexcept override; + + ReturnCode_t get_int64_values( + Int64Seq& value, + MemberId id) noexcept override; + + ReturnCode_t get_uint64_values( + UInt64Seq& value, + MemberId id) noexcept override; + + ReturnCode_t get_float32_values( + Float32Seq& value, + MemberId id) noexcept override; + + ReturnCode_t get_float64_values( + Float64Seq& value, + MemberId id) noexcept override; + + ReturnCode_t get_float128_values( + Float128Seq& value, + MemberId id) noexcept override; + + ReturnCode_t get_char8_values( + CharSeq& value, + MemberId id) noexcept override; + + ReturnCode_t get_char16_values( + WcharSeq& value, + MemberId id) noexcept override; + + ReturnCode_t get_byte_values( + ByteSeq& value, + MemberId id) noexcept override; + + ReturnCode_t get_boolean_values( + BooleanSeq& value, + MemberId id) noexcept override; + + ReturnCode_t get_string_values( + StringSeq& value, + MemberId id) noexcept override; + + ReturnCode_t get_wstring_values( + WstringSeq& value, MemberId id) noexcept override; + //}}} + + //}}} + traits::ref_type loan_value( MemberId id) noexcept override; ReturnCode_t return_loaned_value( traits::ref_type value) noexcept override; - traits::ref_type clone() noexcept override; + //{{{ Setters - ReturnCode_t get_int32_value( - int32_t& value, - MemberId id) noexcept override; + //{{{ Primitive getters ReturnCode_t set_int32_value( MemberId id, int32_t value) noexcept override; - ReturnCode_t get_uint32_value( - uint32_t& value, - MemberId id) noexcept override; - ReturnCode_t set_uint32_value( MemberId id, uint32_t value) noexcept override; - ReturnCode_t get_int8_value( - int8_t& value, - MemberId id) noexcept override; - ReturnCode_t set_int8_value( MemberId id, int8_t value) noexcept override; - ReturnCode_t get_uint8_value( - uint8_t& value, - MemberId id) noexcept override; - ReturnCode_t set_uint8_value( MemberId id, uint8_t value) noexcept override; - ReturnCode_t get_int16_value( - int16_t& value, - MemberId id) noexcept override; - ReturnCode_t set_int16_value( MemberId id, int16_t value) noexcept override; - ReturnCode_t get_uint16_value( - uint16_t& value, - MemberId id) noexcept override; - ReturnCode_t set_uint16_value( MemberId id, uint16_t value) noexcept override; - ReturnCode_t get_int64_value( - int64_t& value, - MemberId id) noexcept override; - ReturnCode_t set_int64_value( MemberId id, int64_t value) noexcept override; - ReturnCode_t get_uint64_value( - uint64_t& value, - MemberId id) noexcept override; - ReturnCode_t set_uint64_value( MemberId id, uint64_t value) noexcept override; - ReturnCode_t get_float32_value( - float& value, - MemberId id) noexcept override; - ReturnCode_t set_float32_value( MemberId id, float value) noexcept override; - ReturnCode_t get_float64_value( - double& value, - MemberId id) noexcept override; - ReturnCode_t set_float64_value( MemberId id, double value) noexcept override; - ReturnCode_t get_float128_value( - long double& value, - MemberId id) noexcept override; - ReturnCode_t set_float128_value( MemberId id, long double value) noexcept override; - ReturnCode_t get_char8_value( - char& value, - MemberId id) noexcept override; - ReturnCode_t set_char8_value( MemberId id, char value) noexcept override; - ReturnCode_t get_char16_value( - wchar_t& value, - MemberId id) noexcept override; - ReturnCode_t set_char16_value( MemberId id, wchar_t value) noexcept override; - ReturnCode_t get_byte_value( - eprosima::fastrtps::rtps::octet& value, - MemberId id) noexcept override; - ReturnCode_t set_byte_value( MemberId id, eprosima::fastrtps::rtps::octet value) noexcept override; - ReturnCode_t get_boolean_value( - bool& value, - MemberId id) noexcept override; - ReturnCode_t set_boolean_value( MemberId id, bool value) noexcept override; - ReturnCode_t get_string_value( - std::string& value, - MemberId id) noexcept override; - ReturnCode_t set_string_value( MemberId id, const std::string& value) noexcept override; - ReturnCode_t get_wstring_value( - std::wstring& value, - MemberId id) noexcept override; - ReturnCode_t set_wstring_value( MemberId id, const std::wstring& value) noexcept override; - ReturnCode_t get_complex_value( - traits::ref_type value, - MemberId id) noexcept override; + //}}} ReturnCode_t set_complex_value( MemberId id, traits::ref_type value) noexcept override; - ReturnCode_t get_int32_values( - Int32Seq& value, - MemberId id) noexcept override; + //{{{ Array getters ReturnCode_t set_int32_values( MemberId id, const Int32Seq& value) noexcept override; - ReturnCode_t get_uint32_values( - UInt32Seq& value, - MemberId id) noexcept override; - ReturnCode_t set_uint32_values( MemberId id, const UInt32Seq& value) noexcept override; - ReturnCode_t get_int8_values( - Int8Seq& value, - MemberId id) noexcept override; - ReturnCode_t set_int8_values( MemberId id, const Int8Seq& value) noexcept override; - ReturnCode_t get_uint8_values( - UInt8Seq& value, - MemberId id) noexcept override; - ReturnCode_t set_uint8_values( MemberId id, const UInt8Seq& value) noexcept override; - ReturnCode_t get_int16_values( - Int16Seq& value, - MemberId id) noexcept override; - ReturnCode_t set_int16_values( MemberId id, const Int16Seq& value) noexcept override; - ReturnCode_t get_uint16_values( - UInt16Seq& value, - MemberId id) noexcept override; - ReturnCode_t set_uint16_values( MemberId id, const UInt16Seq& value) noexcept override; - ReturnCode_t get_int64_values( - Int64Seq& value, - MemberId id) noexcept override; - ReturnCode_t set_int64_values( MemberId id, const Int64Seq& value) noexcept override; - ReturnCode_t get_uint64_values( - UInt64Seq& value, - MemberId id) noexcept override; - ReturnCode_t set_uint64_values( MemberId id, const UInt64Seq& value) noexcept override; - ReturnCode_t get_float32_values( - Float32Seq& value, - MemberId id) noexcept override; - ReturnCode_t set_float32_values( MemberId id, const Float32Seq& value) noexcept override; - ReturnCode_t get_float64_values( - Float64Seq& value, - MemberId id) noexcept override; - ReturnCode_t set_float64_values( MemberId id, const Float64Seq& value) noexcept override; - ReturnCode_t get_float128_values( - Float128Seq& value, - MemberId id) noexcept override; - ReturnCode_t set_float128_values( MemberId id, const Float128Seq& value) noexcept override; - ReturnCode_t get_char8_values( - CharSeq& value, - MemberId id) noexcept override; - ReturnCode_t set_char8_values( MemberId id, const CharSeq& value) noexcept override; - ReturnCode_t get_char16_values( - WcharSeq& value, - MemberId id) noexcept override; - ReturnCode_t set_char16_values( MemberId id, const WcharSeq& value) noexcept override; - ReturnCode_t get_byte_values( - ByteSeq& value, - MemberId id) noexcept override; - ReturnCode_t set_byte_values( MemberId id, const ByteSeq& value) noexcept override; - ReturnCode_t get_boolean_values( - BooleanSeq& value, - MemberId id) noexcept override; - ReturnCode_t set_boolean_values( MemberId id, const BooleanSeq& value) noexcept override; - ReturnCode_t get_string_values( - StringSeq& value, - MemberId id) noexcept override; - ReturnCode_t set_string_values( MemberId id, const StringSeq& value) noexcept override; - ReturnCode_t get_wstring_values( - WstringSeq& value, - MemberId id) noexcept override; - ReturnCode_t set_wstring_values( MemberId id, const WstringSeq& value) noexcept override; + //}}} + + //}}} + + + traits::ref_type type() noexcept override; + + //{{{ Encoding/decoding functions + + size_t calculate_key_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + size_t& current_alignment) const noexcept; + + static size_t calculate_max_serialized_size( + traits::ref_type type, + size_t current_alignment = 0); + + size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + size_t& current_alignment) const noexcept; + + bool deserialize( + eprosima::fastcdr::Cdr& cdr); + + void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + void serialize_key( + eprosima::fastcdr::Cdr& cdr) const noexcept; + + //}}} + + //}}} + protected: - traits::ref_type _this(); + traits::ref_type _this(); + +private: + + //{{{ Auxiliary functions + + /*! + * Auxiliary function to apply the bitset mask when setting a value. + */ + template + void apply_bitset_mask( + MemberId member_id, + TypeForKind& value) const noexcept; + + void add_sequence_value( + const traits::ref_type& sequence_type, + uint32_t sequence_size) noexcept; + + std::map>::iterator add_value( + TypeKind kind, + MemberId id) noexcept; + + /*! + * Auxiliary function for getting the initial number of elements for TK_ARRAY. + */ + uint32_t calculate_array_max_elements( + TypeKind type_kind) noexcept; + + /*! + * Auxiliary function for checking the new discriminator value set by the user is correct. + */ + template::value, bool>::type = true> + bool check_new_discriminator_value( + const T& value) + { + bool ret_value = false; + + if (MEMBER_ID_INVALID != selected_union_member_) // There is a member selected by current discriminator. + { + traits::ref_type selected_member; + enclosing_type_->get_member(selected_member, selected_union_member_); + auto sm_impl = traits::narrow(selected_member); + + for (auto label : sm_impl->get_descriptor().label()) + { + if (static_cast(value) == label) + { + ret_value = true; + break; + } + } + } + + if (MEMBER_ID_INVALID == selected_union_member_ || + (MEMBER_ID_INVALID == enclosing_type_->default_union_member() && !ret_value)) // It is selected the implicit default member. + { + ret_value = true; + + if (enclosing_type_->default_value() != static_cast(value)) + { + for (auto member : enclosing_type_->get_all_members_by_index()) + { + auto m_impl = traits::narrow(member); + + for (auto label : m_impl->get_descriptor().label()) + { + if (static_cast(value) == label) + { + ret_value = false; + break; + } + } + } + } + + if (ret_value) + { + selected_union_member_ = MEMBER_ID_INVALID; + } + } + + return ret_value; + } + + template::value, bool>::type = true> + bool check_new_discriminator_value( + const T&) + { + return false; + } + + /*! + * Auxiliary function to clear completely a sequence. + * Only valid for TK_ARRAY or TK_SEQUENCE. + */ + ReturnCode_t clear_all_sequence( + TypeKind type_kind) noexcept; + + ReturnCode_t clear_all_values( + bool only_non_keyed) noexcept; + + /*! + * Auxiliary function to clear a sequence element. + * Only valid for TK_ARRAY and TK_SEQUENCE. + */ + ReturnCode_t clear_sequence_element( + TypeKind type_kind, + MemberId id) noexcept; + + /*! + * Auxiliary function to clone a primitive. + */ + std::shared_ptr clone_primitive( + TypeKind type_kind, + const std::shared_ptr& primitive) const noexcept; + + /*! + * Auxiliary function to clone a array/sequence. + */ + std::shared_ptr clone_sequence( + TypeKind element_kind, + const std::shared_ptr& sequence) const noexcept; + + /*! + * Auxiliary function to compare two sequence values. + */ + bool compare_sequence_values( + TypeKind kind, + std::shared_ptr left, + std::shared_ptr right) const noexcept; + + /*! + * Auxiliary function to compare two primitive values. + */ + bool compare_values( + TypeKind kind, + std::shared_ptr left, + std::shared_ptr right) const noexcept; + + template + ReturnCode_t get_bitmask_bit( + TypeForKind& value, + MemberId id) noexcept; + + /*! + * @brief Given a type, returns the enclosing type if exists. + */ + static traits::ref_type get_enclosing_type( + traits::ref_type type) noexcept; + + /*! + * @brief Given a type, returns the enclosing type kind if exists. + */ + static TypeKind get_enclosing_typekind( + traits::ref_type type) noexcept; + + template + ReturnCode_t get_primitive_value( + TypeKind element_kind, + std::map>::iterator value_iterator, + TypeForKind& value, + MemberId member_id) noexcept; + + /*! + * @brief Auxiliary template to retrieve the length of a internal sequence. + * Only valid for TK_ARRAY and TK_SEQUENCE. + */ + uint32_t get_sequence_length(); + + /*! + * Auxiliary template with the common code for getting the values of a sequence. + */ + template + ReturnCode_t get_sequence_values( + SequenceTypeForKind& value, + MemberId id) noexcept; + + /*! + * Auxiliary template with the common code for getting the values of a bitmask sequence from a TK_ARRAY or TK_SEQUENCE. + * @param[in] number_of_elements Number of elements. 0 value means all elements. + */ + template + ReturnCode_t get_sequence_values_bitmask( + MemberId id, + std::map>::const_iterator value_iterator, + SequenceTypeForKind& value, + size_t number_of_elements) noexcept; + + /*! + * Auxiliary template with the common code for getting the values of a primitive sequence from a TK_ARRAY or TK_SEQUENCE. + * @param[in] number_of_elements Number of elements. 0 value means all elements. + */ + template + ReturnCode_t get_sequence_values_primitive( + MemberId id, + TypeKind element_kind, + std::map>::const_iterator value_iterator, + SequenceTypeForKind& value, + size_t number_of_elements) noexcept; + + /*! + * Auxiliary template with the common code for getting the values of a primitive sequence supporting promotion + * from a TK_ARRAY or TK_SEQUENCE. + * @param[in] number_of_elements Number of elements. 0 value means all elements. + */ + template + ReturnCode_t get_sequence_values_promoting( + MemberId id, + std::map>::const_iterator value_iterator, + SequenceTypeForKind& value, + size_t number_of_elements) noexcept; + + template + ReturnCode_t get_value( + TypeForKind& value, + MemberId id) noexcept; + + /*! + * Auxiliary function for setting a bitmask bit. + */ + template + ReturnCode_t set_bitmask_bit( + MemberId id, + const TypeForKind& value) noexcept; + + void set_default_value( + const traits::ref_type member, + traits::ref_type data) noexcept; + + /*! + * Auxiliary function for setting the discriminator value to a label of the member specified by the MemberId. + */ + void set_discriminator_value( + MemberId id) noexcept; + + /*! + * Auxiliary function to set the discriminator value on already given discriminator DynamicData. + */ + void set_discriminator_value( + int32_t new_discriminator_value, + const traits::ref_type& discriminator_type, + traits::ref_type& data) noexcept; + + /*! + * Auxiliary function to set a primitive value taking into account if there is promotion of the type. + */ + template + ReturnCode_t set_primitive_value( + const traits::ref_type& element_type, + std::map>::iterator value_iterator, + const TypeForKind& value) noexcept; + + /*! + * Auxiliary template with the common code for setting the values of a sequence. + */ + template + ReturnCode_t set_sequence_values( + MemberId id, + const SequenceTypeForKind& value) noexcept; + + /*! + * Auxiliary template with the common code for setting the values of a bitmask sequence into a TK_ARRAY or TK_SEQUENCE. + */ + template + ReturnCode_t set_sequence_values_bitmask( + MemberId id, + std::map>::const_iterator value_iterator, + const SequenceTypeForKind& value) noexcept; + + /*! + * Auxiliary template with the common code for setting the values of a primitive sequence into a TK_ARRAY or TK_SEQUENCE. + */ + template + ReturnCode_t set_sequence_values_primitive( + MemberId id, + TypeKind element_kind, + std::map>::const_iterator value_iterator, + const SequenceTypeForKind& value) noexcept; + + /*! + * Auxiliary template with the common code for setting the values of a primitive sequence supporting promotion + * into a TK_ARRAY or TK_SEQUENCE. + */ + template + ReturnCode_t set_sequence_values_promoting( + MemberId id, + std::map>::const_iterator value_iterator, + const SequenceTypeForKind& value) noexcept; + + + /*! + * Auxiliary function to set the default value,specified by MemberDescriptor::default_value, to primitive types. + */ + void set_value( + const ObjectName& value) noexcept; + + /*! + * Auxiliary template with the common code for setting the value of a primitive type + */ + template + ReturnCode_t set_value( + MemberId id, + const TypeForKind& value) noexcept; + + //}}} + + //{{{ Encoding/decoding functions + + size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const traits::ref_type type, + size_t& current_alignment) const noexcept; + + bool deserialize( + eprosima::fastcdr::Cdr& cdr, + const traits::ref_type type); + + void serialize( + eprosima::fastcdr::Cdr& cdr, + const traits::ref_type type) const; + + //}}} }; diff --git a/src/cpp/fastdds/xtypes/dynamic_types/DynamicPubSubType.cpp b/src/cpp/fastdds/xtypes/dynamic_types/DynamicPubSubType.cpp new file mode 100644 index 00000000000..e787ffb78b9 --- /dev/null +++ b/src/cpp/fastdds/xtypes/dynamic_types/DynamicPubSubType.cpp @@ -0,0 +1,267 @@ +// 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. + +#include + +#include + +#include +#include +#include +#include +#include +#include + +#include "common.hpp" +#include "DynamicDataImpl.hpp" +#include "DynamicTypeImpl.hpp" + +namespace eprosima { +namespace fastdds { +namespace dds { + +//{{{ Public functions + +DynamicPubSubType::DynamicPubSubType( + traits::ref_type type) + : dynamic_type_(type) +{ + update_dynamic_type(); +} + +DynamicPubSubType::~DynamicPubSubType() +{ + if (key_buffer_ != nullptr) + { + free(key_buffer_); + } +} + +void* DynamicPubSubType::createData() +{ + if (!dynamic_type_) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "DynamicPubSubType cannot create data. Unspecified type."); + return nullptr; + } + else + { + traits::ref_type* ret_val = new traits::ref_type(); + *ret_val = + traits::narrow(DynamicDataFactory::get_instance()->create_data( + dynamic_type_)); + return ret_val; + } +} + +void DynamicPubSubType::deleteData( + void* data) +{ + traits::ref_type* data_ptr = static_cast::ref_type*>(data); + DynamicDataFactory::get_instance()->delete_data(*data_ptr); + delete data_ptr; +} + +bool DynamicPubSubType::deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) +{ + traits::ref_type* data_ptr = static_cast::ref_type*>(data); + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that manages the raw buffer. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); // Object that deserializes the data. + + try + { + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + deser >> *data_ptr; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + return true; +} + +traits::ref_type DynamicPubSubType::get_dynamic_type() const noexcept +{ + return dynamic_type_; +} + +bool DynamicPubSubType::getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* handle, + bool force_md5) +{ + if (!dynamic_type_ || !m_isGetKeyDefined) + { + return false; + } + traits::ref_type* data_ptr = static_cast::ref_type*>(data); + eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + size_t keyBufferSize = + static_cast((*data_ptr)->calculate_key_serialized_size(calculator, current_alignment)); + + if (nullptr == key_buffer_) + { + key_buffer_ = reinterpret_cast(malloc(keyBufferSize > 16 ? keyBufferSize : 16)); + memset(key_buffer_, 0, keyBufferSize > 16 ? keyBufferSize : 16); + } + + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(key_buffer_), keyBufferSize); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, + eprosima::fastcdr::CdrVersion::XCDRv2); // Object that serializes the data. + ser.set_encoding_flag(eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2); + (*data_ptr)->serialize_key(ser); + if (force_md5 || keyBufferSize > 16) + { + md5_.init(); + md5_.update(key_buffer_, (unsigned int)ser.get_serialized_data_length()); + md5_.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = md5_.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = key_buffer_[i]; + } + } + return true; +} + +std::function DynamicPubSubType::getSerializedSizeProvider( + void* data) +{ + return getSerializedSizeProvider(data, DEFAULT_DATA_REPRESENTATION); +} + +std::function DynamicPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + traits::ref_type* data_ptr = static_cast::ref_type*>(data); + + return [data_ptr, data_representation]() -> uint32_t + { + 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( + *data_ptr, current_alignment)) + 4u /*encapsulation*/; + + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } + }; +} + +bool DynamicPubSubType::serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + fastdds::dds::DataRepresentationId_t data_representation) +{ + traits::ref_type* data_ptr = static_cast::ref_type*>(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 == + fastdds::dds::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; + + auto type_impl = traits::narrow(dynamic_type_); + ser.set_encoding_flag(get_fastcdr_encoding_flag(type_impl->get_descriptor().extensibility_kind(), + fastdds::dds::DataRepresentationId_t::XCDR_DATA_REPRESENTATION == data_representation? + eprosima::fastcdr::CdrVersion:: XCDRv1 : + eprosima::fastcdr::CdrVersion::XCDRv2)); + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + + ser << *data_ptr; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + payload->length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length + return true; +} + +ReturnCode_t DynamicPubSubType::set_dynamic_type( + traits::ref_type type) +{ + if (!dynamic_type_) + { + dynamic_type_ = type; + update_dynamic_type(); + return RETCODE_OK; + } + else + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Error Setting the dynamic type. There is already a registered type"); + } + + return RETCODE_BAD_PARAMETER; +} + +//}}} + +void DynamicPubSubType::update_dynamic_type() +{ + m_isGetKeyDefined = false; + + if (nullptr == dynamic_type_) + { + return; + } + + m_typeSize = static_cast(DynamicDataImpl::calculate_max_serialized_size(dynamic_type_) + 4); + setName(dynamic_type_->get_name()); + + if (TK_STRUCTURE == dynamic_type_->get_kind()) + { + auto type_impl = traits::narrow(dynamic_type_); + for (auto& member : type_impl->get_all_members_by_index()) + { + auto member_impl = traits::narrow(member); + if (member_impl->get_descriptor().is_key()) + { + m_isGetKeyDefined = true; + break; + } + } + } +} + +} // namespace dds +} // namespace fastdds +} // namespace eprosima diff --git a/src/cpp/dynamic-types/DynamicDataPtr.cpp b/src/cpp/fastdds/xtypes/dynamic_types/DynamicTypeBuilderFactory.cpp similarity index 52% rename from src/cpp/dynamic-types/DynamicDataPtr.cpp rename to src/cpp/fastdds/xtypes/dynamic_types/DynamicTypeBuilderFactory.cpp index 436f4076f3d..a4ec26be2d0 100644 --- a/src/cpp/dynamic-types/DynamicDataPtr.cpp +++ b/src/cpp/fastdds/xtypes/dynamic_types/DynamicTypeBuilderFactory.cpp @@ -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,29 +12,25 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include -#include -#include +#include + +#include "DynamicTypeBuilderFactoryImpl.hpp" namespace eprosima { -namespace fastrtps { -namespace types { +namespace fastdds { +namespace dds { -DynamicData_ptr::DynamicData_ptr( - DynamicData* pData) - : Base(pData, [](DynamicData* pData) -{ - DynamicDataFactory::get_instance()->delete_data(pData); -}) +traits::ref_type DynamicTypeBuilderFactory::get_instance() { + return DynamicTypeBuilderFactoryImpl::get_instance(); } -DynamicData_ptr& DynamicData_ptr::operator =( - DynamicData* ptr) +ReturnCode_t DynamicTypeBuilderFactory::delete_instance() { - return operator =(DynamicData_ptr(ptr)); + // Delegate into the implementation class + return DynamicTypeBuilderFactoryImpl::delete_instance(); } -} // namespace types -} // namespace fastrtps +} // namespace dds +} // namespace fastdds } // namespace eprosima diff --git a/src/cpp/fastdds/xtypes/dynamic_types/DynamicTypeBuilderFactoryImpl.cpp b/src/cpp/fastdds/xtypes/dynamic_types/DynamicTypeBuilderFactoryImpl.cpp new file mode 100644 index 00000000000..fdfea29256a --- /dev/null +++ b/src/cpp/fastdds/xtypes/dynamic_types/DynamicTypeBuilderFactoryImpl.cpp @@ -0,0 +1,278 @@ +// 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. + +#include "DynamicTypeBuilderFactoryImpl.hpp" + +#include "DynamicTypeBuilderImpl.hpp" + +namespace eprosima { +namespace fastdds { +namespace dds { + +traits::ref_type DynamicTypeBuilderFactoryImpl::instance_; + +//{{{ Functions to create types + +traits::ref_type DynamicTypeBuilderFactoryImpl::create_type( + traits::ref_type descriptor) noexcept +{ + auto descriptor_impl = traits::narrow(descriptor); + + if (descriptor_impl->is_consistent()) + { + return std::make_shared(*descriptor_impl); + } + + return {}; +} + +traits::ref_type DynamicTypeBuilderFactoryImpl::create_type_copy( + traits::ref_type type) noexcept +{ + auto ret_val = std::make_shared(TypeDescriptorImpl{TK_NONE, ""}); + ret_val->copy_from(traits::narrow(type)); + return ret_val; +} + +traits::ref_type DynamicTypeBuilderFactoryImpl::create_type_w_document( + const std::string& document, + const std::string& type_name, + const IncludePathSeq& include_paths) noexcept +{ + traits::ref_type nil; + static_cast(document); + static_cast(type_name); + static_cast(include_paths); + return nil; +} + +traits::ref_type DynamicTypeBuilderFactoryImpl::create_type_w_type_object( + const xtypes::TypeObject& type_object) noexcept +{ + traits::ref_type nil; + static_cast(type_object); + return nil; +} + +traits::ref_type DynamicTypeBuilderFactoryImpl::create_type_w_uri( + const std::string& document_url, + const std::string& type_name, + const IncludePathSeq& include_paths) noexcept +{ + traits::ref_type nil; + static_cast(document_url); + static_cast(type_name); + static_cast(include_paths); + return nil; +} + +//}}} + +//{{{ Functions to create specific types + +traits::ref_type DynamicTypeBuilderFactoryImpl::create_array_type( + traits::ref_type element_type, + const BoundSeq& bound) noexcept +{ + traits::ref_type ret_val {std::make_shared( + TypeDescriptorImpl{TK_ARRAY, ""})}; + ret_val->get_descriptor().element_type(element_type); + ret_val->get_descriptor().bound() = bound; + + if (ret_val->get_descriptor().is_consistent()) + { + return ret_val; + } + return {}; +} + +traits::ref_type DynamicTypeBuilderFactoryImpl::create_bitmask_type( + uint32_t bound) noexcept +{ + traits::ref_type ret_val {std::make_shared( + TypeDescriptorImpl{TK_BITMASK, ""})}; + ret_val->get_descriptor().element_type(bool_type_); + ret_val->get_descriptor().bound().push_back(bound); + + if (ret_val->get_descriptor().is_consistent()) + { + return ret_val; + } + + return {}; +} + +traits::ref_type DynamicTypeBuilderFactoryImpl::create_map_type( + traits::ref_type key_element_type, + traits::ref_type element_type, + uint32_t bound) noexcept +{ + traits::ref_type ret_val {std::make_shared( + TypeDescriptorImpl{TK_MAP, ""})}; + ret_val->get_descriptor().key_element_type(key_element_type); + ret_val->get_descriptor().element_type(element_type); + ret_val->get_descriptor().bound().push_back(bound); + + if (ret_val->get_descriptor().is_consistent()) + { + return ret_val; + } + + return {}; +} + +traits::ref_type DynamicTypeBuilderFactoryImpl::create_sequence_type( + traits::ref_type element_type, + uint32_t bound) noexcept +{ + traits::ref_type ret_val {std::make_shared( + TypeDescriptorImpl{TK_SEQUENCE, ""})}; + ret_val->get_descriptor().element_type(element_type); + ret_val->get_descriptor().bound().push_back(bound); + + if (ret_val->get_descriptor().is_consistent()) + { + return ret_val; + } + return {}; +} + +traits::ref_type DynamicTypeBuilderFactoryImpl::create_string_type( + uint32_t bound) noexcept +{ + traits::ref_type ret_val {std::make_shared( + TypeDescriptorImpl{TK_STRING8, ""})}; + ret_val->get_descriptor().element_type(char8_type_); + ret_val->get_descriptor().bound().push_back(bound); + + if (ret_val->get_descriptor().is_consistent()) + { + return ret_val; + } + + return {}; +} + +traits::ref_type DynamicTypeBuilderFactoryImpl::create_wstring_type( + uint32_t bound) noexcept +{ + traits::ref_type ret_val {std::make_shared( + TypeDescriptorImpl{TK_STRING16, ""})}; + ret_val->get_descriptor().element_type(char16_type_); + ret_val->get_descriptor().bound().push_back(bound); + + if (ret_val->get_descriptor().is_consistent()) + { + return ret_val; + } + + return {}; +} + +//}}} + +ReturnCode_t DynamicTypeBuilderFactoryImpl::delete_instance() noexcept +{ + if (!instance_) + { + return RETCODE_BAD_PARAMETER; + } + instance_.reset(); + return RETCODE_OK; +} + +ReturnCode_t DynamicTypeBuilderFactoryImpl::delete_type( + traits::ref_type type) noexcept +{ + type.reset(); + return RETCODE_OK; +} + +traits::ref_type DynamicTypeBuilderFactoryImpl::get_instance() noexcept +{ + if (!instance_) + { + instance_ = std::make_shared(); + } + + return instance_; +} + +traits::ref_type DynamicTypeBuilderFactoryImpl::get_primitive_type( + TypeKind kind) noexcept +{ + traits::ref_type ret_val; + + switch (kind) + { + case TK_BOOLEAN: + ret_val = bool_type_; + break; + case TK_BYTE: + ret_val = byte_type_; + break; + case TK_INT16: + ret_val = int16_type_; + break; + case TK_INT32: + ret_val = int32_type_; + break; + case TK_INT64: + ret_val = int64_type_; + break; + case TK_UINT16: + ret_val = uint16_type_; + break; + case TK_UINT32: + ret_val = uint32_type_; + break; + case TK_UINT64: + ret_val = uint64_type_; + break; + case TK_FLOAT32: + ret_val = float32_type_; + break; + case TK_FLOAT64: + ret_val = float64_type_; + break; + case TK_FLOAT128: + ret_val = float128_type_; + break; + case TK_INT8: + ret_val = int8_type_; + break; + case TK_UINT8: + ret_val = uint8_type_; + break; + case TK_CHAR8: + ret_val = char8_type_; + break; + case TK_CHAR16: + ret_val = char16_type_; + break; + default: + break; + } + + return ret_val; +} + +traits::ref_type DynamicTypeBuilderFactoryImpl::_this() +{ + return shared_from_this(); +} + +} // namespace dds +} // namespace fastdds +} // namespace eprosima diff --git a/src/cpp/fastdds/xtypes/dynamic_types/DynamicTypeBuilderFactoryImpl.hpp b/src/cpp/fastdds/xtypes/dynamic_types/DynamicTypeBuilderFactoryImpl.hpp index 467653ae8fc..a70b39a1e8e 100644 --- a/src/cpp/fastdds/xtypes/dynamic_types/DynamicTypeBuilderFactoryImpl.hpp +++ b/src/cpp/fastdds/xtypes/dynamic_types/DynamicTypeBuilderFactoryImpl.hpp @@ -15,10 +15,15 @@ #ifndef FASTDDS_XTYPES_DYNAMIC_TYPES_DYNAMICTYPEBUILDERFACTORYIMPL_HPP #define FASTDDS_XTYPES_DYNAMIC_TYPES_DYNAMICTYPEBUILDERFACTORYIMPL_HPP -#include +#include + +#include +#include #include +#include #include "DynamicTypeImpl.hpp" +#include "TypeDescriptorImpl.hpp" namespace eprosima { @@ -33,12 +38,7 @@ class DynamicTypeBuilderFactoryImpl : public traits:: { public: - static traits::ref_type get_instance() noexcept; - - static ReturnCode_t delete_instance() noexcept; - - traits::ref_type get_primitive_type( - TypeKind kind) noexcept override; + //{{{ Functions to create types traits::ref_type create_type( traits::ref_type descriptor) noexcept override; @@ -46,80 +46,91 @@ class DynamicTypeBuilderFactoryImpl : public traits:: traits::ref_type create_type_copy( traits::ref_type type) noexcept override; + traits::ref_type create_type_w_document( + const std::string& document, + const std::string& type_name, + const IncludePathSeq& include_paths) noexcept override; + traits::ref_type create_type_w_type_object( const xtypes::TypeObject& type_object) noexcept override; - traits::ref_type create_string_type( - uint32_t bound) noexcept override; + traits::ref_type create_type_w_uri( + const std::string& document_url, + const std::string& type_name, + const IncludePathSeq& include_paths) noexcept override; - traits::ref_type create_wstring_type( - uint32_t bound) noexcept override; + //}}} - traits::ref_type create_sequence_type( - traits::ref_type element_type, - uint32_t bound) noexcept override; + //{{{ Functions to create specific types traits::ref_type create_array_type( traits::ref_type element_type, const BoundSeq& bound) noexcept override; + traits::ref_type create_bitmask_type( + uint32_t bound) noexcept override; + traits::ref_type create_map_type( traits::ref_type key_element_type, traits::ref_type element_type, uint32_t bound) noexcept override; - traits::ref_type create_bitmask_type( + traits::ref_type create_sequence_type( + traits::ref_type element_type, uint32_t bound) noexcept override; - traits::ref_type create_type_w_uri( - const std::string& document_url, - const std::string& type_name, - const IncludePathSeq& include_paths) noexcept override; + traits::ref_type create_string_type( + uint32_t bound) noexcept override; - traits::ref_type create_type_w_document( - const std::string& document, - const std::string& type_name, - const IncludePathSeq& include_paths) noexcept override; + traits::ref_type create_wstring_type( + uint32_t bound) noexcept override; + + //}}} + + static ReturnCode_t delete_instance() noexcept; ReturnCode_t delete_type( traits::ref_type type) noexcept override; + static traits::ref_type get_instance() noexcept; + + traits::ref_type get_primitive_type( + TypeKind kind) noexcept override; + +protected: + + traits::ref_type _this(); + private: static traits::ref_type instance_; - // Cached primitive types. + //{{{ Cached primitive types. + traits::ref_type bool_type_ {std::make_shared(TypeDescriptorImpl{TK_BOOLEAN, - xtypes::boolean_type_name})}; - traits::ref_type byte_type_ {std::make_shared(TypeDescriptorImpl{TK_BYTE, - xtypes::byte_type_name})}; - traits::ref_type int16_type_ {std::make_shared(TypeDescriptorImpl{TK_INT16, - xtypes::int16_type_name})}; - traits::ref_type int32_type_ {std::make_shared(TypeDescriptorImpl{TK_INT32, - xtypes::int32_type_name})}; - traits::ref_type int64_type_ {std::make_shared(TypeDescriptorImpl{TK_INT64, - xtypes::int64_type_name})}; + ""})}; + traits::ref_type byte_type_ {std::make_shared(TypeDescriptorImpl{TK_BYTE, ""})}; + traits::ref_type int16_type_ {std::make_shared(TypeDescriptorImpl{TK_INT16, ""})}; + traits::ref_type int32_type_ {std::make_shared(TypeDescriptorImpl{TK_INT32, ""})}; + traits::ref_type int64_type_ {std::make_shared(TypeDescriptorImpl{TK_INT64, ""})}; traits::ref_type uint16_type_ {std::make_shared(TypeDescriptorImpl{TK_UINT16, - xtypes::uint16_type_name})}; + ""})}; traits::ref_type uint32_type_ {std::make_shared(TypeDescriptorImpl{TK_UINT32, - xtypes::uint32_type_name})}; + ""})}; traits::ref_type uint64_type_ {std::make_shared(TypeDescriptorImpl{TK_UINT64, - xtypes::uint64_type_name})}; + ""})}; traits::ref_type float32_type_ {std::make_shared(TypeDescriptorImpl{TK_FLOAT32, - xtypes::float32_type_name})}; + ""})}; traits::ref_type float64_type_ {std::make_shared(TypeDescriptorImpl{TK_FLOAT64, - xtypes::float64_type_name})}; + ""})}; traits::ref_type float128_type_ {std::make_shared(TypeDescriptorImpl{TK_FLOAT128, - xtypes::float128_type_name})}; - traits::ref_type int8_type_ {std::make_shared(TypeDescriptorImpl{TK_INT8, - xtypes::int8_type_name})}; - traits::ref_type uint8_type_ {std::make_shared(TypeDescriptorImpl{TK_UINT8, - xtypes::uint8_type_name})}; - traits::ref_type char8_type_ {std::make_shared(TypeDescriptorImpl{TK_CHAR8, - xtypes::char8_type_name})}; + ""})}; + traits::ref_type int8_type_ {std::make_shared(TypeDescriptorImpl{TK_INT8, ""})}; + traits::ref_type uint8_type_ {std::make_shared(TypeDescriptorImpl{TK_UINT8, ""})}; + traits::ref_type char8_type_ {std::make_shared(TypeDescriptorImpl{TK_CHAR8, ""})}; traits::ref_type char16_type_ {std::make_shared(TypeDescriptorImpl{TK_CHAR16, - xtypes::char16_type_name})}; - + ""})}; + //}}} }; } // namespace dds diff --git a/src/cpp/fastdds/xtypes/dynamic_types/DynamicTypeBuilderImpl.cpp b/src/cpp/fastdds/xtypes/dynamic_types/DynamicTypeBuilderImpl.cpp new file mode 100644 index 00000000000..c112baddc49 --- /dev/null +++ b/src/cpp/fastdds/xtypes/dynamic_types/DynamicTypeBuilderImpl.cpp @@ -0,0 +1,678 @@ +// 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. + +#include "DynamicTypeBuilderImpl.hpp" + +#include +#include +#include + +#include +#include +#include + +#include "AnnotationDescriptorImpl.hpp" +#include "DynamicTypeImpl.hpp" +#include "DynamicTypeMemberImpl.hpp" +#include "MemberDescriptorImpl.hpp" +#include "TypeDescriptorImpl.hpp" +#include "TypeValueConverter.hpp" + +namespace eprosima { +namespace fastdds { +namespace dds { + +DynamicTypeBuilderImpl::DynamicTypeBuilderImpl( + const TypeDescriptorImpl& type_descriptor) noexcept +{ + type_descriptor_.copy_from(type_descriptor); + + if ((TK_STRUCTURE == type_descriptor_.kind() || + TK_BITSET == type_descriptor_.kind()) && + type_descriptor_.base_type()) + { + // Get the members of the base type. + auto base_type = + traits::narrow(type_descriptor_.base_type())->resolve_alias_enclosed_type(); + member_ = base_type->member_; + member_by_name_ = base_type->member_by_name_; + members_ = base_type->members_; + + // In case TK_BITSET, get the base type bounds. + type_descriptor_.bound().insert(type_descriptor_.bound().begin(), + base_type->get_descriptor().bound().begin(), + base_type->get_descriptor().bound().end()); + + // Get last member_id from the base type. + if (0 < members_.size()) + { + traits::ref_type member_impl {traits::narrow( + members_.back())}; + assert(MEMBER_ID_INVALID != member_impl->get_descriptor().id()); + next_id_ = member_impl->get_descriptor().id() + 1; + } + + next_index_ = static_cast(members_.size()); + } + else if (TK_UNION == type_descriptor_.kind()) + { + MemberDescriptorImpl discriminator_descriptor; + discriminator_descriptor.id(0); + discriminator_descriptor.index(0); + discriminator_descriptor.name("discriminator"); + discriminator_descriptor.type(type_descriptor.discriminator_type()); + + traits::ref_type dyn_member = std::make_shared( + discriminator_descriptor); + members_.push_back(dyn_member); + member_by_name_.emplace(std::make_pair(discriminator_descriptor.name(), dyn_member)); + member_.emplace(std::make_pair(discriminator_descriptor.id(), dyn_member)); + next_index_ = 1; + next_id_ = 1; + } +} + +ReturnCode_t DynamicTypeBuilderImpl::get_descriptor( + traits::ref_type& descriptor) noexcept +{ + if (!descriptor) + { + return RETCODE_BAD_PARAMETER; + } + + traits::narrow(descriptor)->copy_from(type_descriptor_); + return RETCODE_OK; +} + +ObjectName DynamicTypeBuilderImpl::get_name() noexcept +{ + return type_descriptor_.name(); +} + +TypeKind DynamicTypeBuilderImpl::get_kind() noexcept +{ + return type_descriptor_.kind(); +} + +ReturnCode_t DynamicTypeBuilderImpl::get_member_by_name( + traits::ref_type& member, + const ObjectName& name) noexcept +{ + auto it = member_by_name_.find(name); + + if (member_by_name_.end() == it) + { + return RETCODE_BAD_PARAMETER; + } + + member = it->second; + return RETCODE_OK; +} + +ReturnCode_t DynamicTypeBuilderImpl::get_all_members_by_name( + DynamicTypeMembersByName& member) noexcept +{ + member = member_by_name_; + return RETCODE_OK; +} + +ReturnCode_t DynamicTypeBuilderImpl::get_member( + traits::ref_type& member, + MemberId id) noexcept +{ + auto it = member_.find(id); + + if (member_.end() == it) + { + return RETCODE_BAD_PARAMETER; + } + + member = it->second; + return RETCODE_OK; +} + +ReturnCode_t DynamicTypeBuilderImpl::get_all_members( + DynamicTypeMembersById& member) noexcept +{ + member = member_; + return RETCODE_OK; +} + +uint32_t DynamicTypeBuilderImpl::get_member_count() noexcept +{ + return static_cast(members_.size()); +} + +ReturnCode_t DynamicTypeBuilderImpl::get_member_by_index( + traits::ref_type& member, + uint32_t index) noexcept +{ + if (index >= members_.size()) + { + return RETCODE_BAD_PARAMETER; + } + + member = members_.at(index); + return RETCODE_OK; +} + +uint32_t DynamicTypeBuilderImpl::get_annotation_count() noexcept +{ + return static_cast(annotation_.size()); +} + +ReturnCode_t DynamicTypeBuilderImpl::get_annotation( + traits::ref_type& descriptor, + uint32_t idx) noexcept +{ + if (!descriptor || idx >= annotation_.size()) + { + return RETCODE_BAD_PARAMETER; + } + + traits::narrow(descriptor)->copy_from(annotation_.at(idx)); + return RETCODE_OK; +} + +bool DynamicTypeBuilderImpl::equals( + traits::ref_type other) noexcept +{ + bool ret_value = true; + auto impl = traits::narrow(other); + + ret_value &= type_descriptor_.equals(impl->type_descriptor_); + if (ret_value) + { + ret_value &= annotation_.size() == impl->annotation_.size(); + if (ret_value) + { + for (size_t count {0}; ret_value && count < annotation_.size(); ++count) + { + ret_value &= annotation_.at(count).equals(impl->annotation_.at(count)); + } + } + + ret_value &= member_.size() == impl->member_.size(); + assert(TK_ANNOTATION == type_descriptor_.kind() || + TK_BITMASK == type_descriptor_.kind() || + TK_BITSET == type_descriptor_.kind() || + TK_STRUCTURE == type_descriptor_.kind() || + TK_UNION == type_descriptor_.kind() || + 0 == member_.size()); + assert(TK_ANNOTATION == impl->type_descriptor_.kind() || + TK_BITMASK == impl->type_descriptor_.kind() || + TK_BITSET == impl->type_descriptor_.kind() || + TK_STRUCTURE == impl->type_descriptor_.kind() || + TK_UNION == impl->type_descriptor_.kind() || + 0 == impl->member_.size()); + + assert(member_by_name_.size() == members_.size()); + assert(impl->member_by_name_.size() == impl->members_.size()); + ret_value &= member_by_name_.size() == impl->member_by_name_.size(); + if (ret_value) + { + auto it = member_by_name_.begin(); + auto impl_it = impl->member_by_name_.begin(); + + while (ret_value && member_by_name_.end() != it) + { + ret_value &= it->second->equals(impl_it->second); + ++it; + ++impl_it; + } + } + } + + return ret_value; +} + +ReturnCode_t DynamicTypeBuilderImpl::add_member( + traits::ref_type descriptor) noexcept +{ + auto type_descriptor_kind = type_descriptor_.kind(); + + //{{{ Auxiliary structure to revert index/id increasing. + struct RollbackIncreasing + { + RollbackIncreasing( + uint32_t& value_reference) + : value_reference_{value_reference} + { + } + + ~RollbackIncreasing() + { + if (activate) + { + --value_reference_; + } + } + + bool activate {false}; + uint32_t& value_reference_; + } + //}}} + id_reverter{next_id_}, + index_reverter{next_index_}; + + if (TK_ANNOTATION != type_descriptor_kind && + TK_BITMASK != type_descriptor_kind && + TK_BITSET != type_descriptor_kind && + TK_ENUM != type_descriptor_kind && + TK_STRUCTURE != type_descriptor_kind && + TK_UNION != type_descriptor_kind) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Type of kind " << type_descriptor_kind << " does not support adding members"); + return RETCODE_PRECONDITION_NOT_MET; + } + + if (!descriptor) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Descriptor reference is nil"); + return RETCODE_BAD_PARAMETER; + } + + auto descriptor_impl = traits::narrow(descriptor); + + + //{{{ Check on BITMASK doesn't exceed bound. + assert(TK_BITMASK != type_descriptor_kind || 1 == type_descriptor_.bound().size()); + if (TK_BITMASK == type_descriptor_kind && members_.size() >= type_descriptor_.bound().at(0)) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Adding new member in this BITMASK exceeds the bound."); + return RETCODE_BAD_PARAMETER; + } + //}}} + + //{{{ Check on BITSET new member doesn't exceed the bound vector's size. + if (TK_BITSET == type_descriptor_kind && members_.size() == type_descriptor_.bound().size()) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Adding new member in this BITSET exceeds the size of bounds."); + return RETCODE_BAD_PARAMETER; + } + //}}} + + const auto& member_name = descriptor_impl->name(); + + //{{{ Check there is already a member with same name. + auto it_by_name = member_by_name_.find(member_name); + if (member_by_name_.end() != it_by_name) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "There is already a member with name " << member_name); + return RETCODE_BAD_PARAMETER; + } + //}}} + + auto member_id = descriptor_impl->id(); + + //{{{ If member_id is MEMBER_ID_INVALID and type is aggregated, find a new one. + if (TK_ANNOTATION == type_descriptor_kind || + TK_BITMASK == type_descriptor_kind || + TK_STRUCTURE == type_descriptor_kind || + TK_UNION == type_descriptor_kind) + { + if (MEMBER_ID_INVALID == member_id) + { + member_id = next_id_++; + id_reverter.activate = true; + + } + + // Check there is already a member with same id. + auto it_by_id = member_.find(member_id); + if (member_.end() != it_by_id) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "There is already a member with MemberId " << member_id); + return RETCODE_BAD_PARAMETER; + } + } + //}}} + //{{{ Else if it is mandatory to a BITSET's member to have MemberId. + else if (TK_BITSET == type_descriptor_kind) + { + if (MEMBER_ID_INVALID == member_id) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "MemberId for BITSET must be different than MEMBER_ID_INVALID"); + return RETCODE_BAD_PARAMETER; + } + } + //}}} + //{{{ Else, TK_ENUM has to come with MEMBER_ID_INVALID. + else if (MEMBER_ID_INVALID != member_id) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "MemberId must be MEMBER_ID_INVALID"); + return RETCODE_BAD_PARAMETER; + } + //}}} + + traits::ref_type dyn_member = std::make_shared(*descriptor_impl); + dyn_member->get_descriptor().id(member_id); + //{{{ Set index + dyn_member->get_descriptor().index(next_index_++); + index_reverter.activate = true; + //}}} + + //{{{ Check bound in case of BITMASK + if (TK_BITMASK == type_descriptor_kind && member_id >= type_descriptor_.bound().at(0)) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "The BITMASK member id exceeds the bound."); + return RETCODE_BAD_PARAMETER; + } + //}}} + + //{{{ Specific checks for UNION + if (TK_UNION == type_descriptor_kind) + { + for (auto member : members_) + { + const auto member_impl {traits::narrow(member)}; + + // Check default label and label cases uniqueness. + if (descriptor_impl->is_default_label() && member_impl->member_descriptor_.is_default_label()) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, + "Member " << member_impl->member_descriptor_.name().c_str() << + " already defined as default_label"); + return RETCODE_BAD_PARAMETER; + } + for (const int32_t new_label : descriptor_impl->label()) + { + for (const int32_t label : member_impl->member_descriptor_.label()) + { + if (new_label == label) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, + "Member " << member_impl->member_descriptor_.name().c_str() << " already contains the label " << + label); + return RETCODE_BAD_PARAMETER; + } + } + + // Recalculate the default discriminator value (for default case or default implicit member). + if (new_label >= default_value_) + { + default_value_ = new_label + 1; + } + } + } + + // In case of default case, store the related MemberId. + if (descriptor_impl->is_default_label()) + { + default_union_member_ = member_id; + } + } + //}}} + //{{{ Specific checks for BITSET + else if (TK_BITSET == type_descriptor_kind) + { + const MemberId new_member_id {dyn_member->get_descriptor().id()}; + const auto new_member_bound {type_descriptor_.bound().at(dyn_member->get_descriptor().index())}; + + for (auto member : member_) + { + const MemberId mid {member.first}; + const auto member_impl {traits::narrow(member.second)}; + const auto member_index {member_impl->get_descriptor().index()}; + + if (mid == new_member_id) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Inconsistency in the new MemberId because it is equal to MemberId(" << + mid << ")"); + return RETCODE_BAD_PARAMETER; + } + else if (mid < new_member_id) + { + const auto bound {type_descriptor_.bound().at(member_index)}; + + if (new_member_id < mid + bound) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Inconsistency in the new MemberId because is less than MemberId(" << + mid << ") + Bound(" << bound << ")"); + return RETCODE_BAD_PARAMETER; + } + } + else + { + if (mid < new_member_id + new_member_bound) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Inconsistency in the new MemberId because there is a member with id " + << "less than MemberId(" << new_member_id << ") + Bound(" << new_member_bound << ")"); + return RETCODE_BAD_PARAMETER; + } + } + } + + //TODO(richiware) Not valid when bitset refactored to support more than 64bits. + if (64 < new_member_id + new_member_bound) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Inconsistency in the new MemberId because exceeds the maximum " + << "64 bits length is exceeded"); + return RETCODE_BAD_PARAMETER; + } + } + //}}} + //{{{ Specific checks for ENUM + if (TK_ENUM == type_descriptor_kind) + { + if (0 < members_.size()) + { + const auto member_impl = traits::narrow(members_.at(0)); + + if (member_impl->get_descriptor().type()->get_kind() != descriptor->type()->get_kind()) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Descriptor type kind differs from the current member types."); + return RETCODE_BAD_PARAMETER; + } + } + + if (!descriptor->default_value().empty()) + { + for (auto member : members_) + { + const auto member_impl {traits::narrow(member)}; + + // Check that there isn't already any member with the same default value. + if (0 == descriptor->default_value().compare(member_impl->get_descriptor().default_value())) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, + "Member " << member_impl->member_descriptor_.name().c_str() << + " has already the value"); + return RETCODE_BAD_PARAMETER; + } + } + TypeForKind value = TypeValueConverter::sto(descriptor->default_value()); + + if (value >= default_value_) + { + default_value_ = value + 1; + } + } + else + { + dyn_member->get_descriptor().default_value(std::to_string(default_value_++)); + } + } + //}}} + + // Set before calling is_consistent(). + dyn_member->get_descriptor().parent_kind(type_descriptor_kind); + + if (!dyn_member->get_descriptor().is_consistent()) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Descriptor is not consistent"); + return RETCODE_BAD_PARAMETER; + } + + assert(dyn_member->get_descriptor().index() <= members_.size()); + if (dyn_member->get_descriptor().index() < members_.size()) + { + auto it = members_.begin() + dyn_member->get_descriptor().index(); + it = members_.insert(it, dyn_member); + for (++it; it != members_.end(); ++it) + { + auto next_member = traits::narrow(*it); + next_member->get_descriptor().index(next_member->get_descriptor().index() + 1); + } + ++next_index_; + } + else + { + members_.push_back(dyn_member); + } + assert(next_index_ == traits::narrow( + *members_.rbegin())->get_descriptor().index() + 1); + + member_by_name_.emplace(std::make_pair(member_name, dyn_member)); + if (TK_ANNOTATION == type_descriptor_kind || + TK_BITMASK == type_descriptor_kind || + TK_BITSET == type_descriptor_kind || + TK_STRUCTURE == type_descriptor_kind || + TK_UNION == type_descriptor_kind) + { + member_.emplace(std::make_pair(member_id, dyn_member)); + } + + id_reverter.activate = false; + index_reverter.activate = false; + return RETCODE_OK; +} + +ReturnCode_t DynamicTypeBuilderImpl::apply_annotation( + traits::ref_type descriptor) noexcept +{ + if (!descriptor || !descriptor->is_consistent()) + { + return RETCODE_BAD_PARAMETER; + } + + auto descriptor_impl = traits::narrow(descriptor); + + if (annotation_.end() != std::find_if(annotation_.begin(), annotation_.end(), + [&descriptor_impl](AnnotationDescriptorImpl& x) + { + return x.equals(descriptor_impl); + })) + { + return RETCODE_BAD_PARAMETER; + } + + annotation_.emplace_back(); + annotation_.back().copy_from(*descriptor_impl); + + return RETCODE_OK; +} + +ReturnCode_t DynamicTypeBuilderImpl::apply_annotation_to_member( + MemberId member_id, + traits::ref_type descriptor) noexcept +{ + auto type_descriptor_kind = type_descriptor_.kind(); + + if (!descriptor || !descriptor->is_consistent() || + (TK_STRUCTURE != type_descriptor_kind && TK_UNION != type_descriptor_kind)) + { + return RETCODE_BAD_PARAMETER; + } + + auto it = member_.find(member_id); + + if (member_.end() == it) + { + return RETCODE_BAD_PARAMETER; + } + + auto member_impl = traits::narrow(it->second); + auto descriptor_impl = traits::narrow(descriptor); + + if (member_impl->annotation_.end() != std::find_if(member_impl->annotation_.begin(), member_impl->annotation_.end(), + [&descriptor_impl](AnnotationDescriptorImpl& x) + { + return x.equals(descriptor_impl); + })) + { + return RETCODE_BAD_PARAMETER; + } + + member_impl->annotation_.emplace_back(); + member_impl->annotation_.back().copy_from(descriptor_impl); + + return RETCODE_OK; +} + +traits::ref_type DynamicTypeBuilderImpl::build() noexcept +{ + traits::ref_type ret_val; + + if (type_descriptor_.is_consistent()) + { + bool preconditions {true}; + + // In case of BITSET, verify the TypeDescriptor's bounds size is same as number of members. + preconditions &= TK_BITSET != type_descriptor_.kind() || type_descriptor_.bound().size() == members_.size(); + if (!preconditions) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Expected more members in BITSET according to the size of bounds."); + } + + // In case of ENUM and BITSET, it must have at least one member + preconditions &= (TK_ENUM != type_descriptor_.kind() && TK_BITSET != type_descriptor_.kind()) + || 0 < members_.size(); + if (!preconditions) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Expected at least one member."); + } + + if (preconditions) + { + ret_val = std::make_shared(type_descriptor_); + for (auto& annotation : annotation_) + { + ret_val->annotation_.emplace_back(); + ret_val->annotation_.back().copy_from(annotation); + } + ret_val->member_ = member_; + ret_val->member_by_name_ = member_by_name_; + ret_val->members_ = members_; + ret_val->default_value_ = default_value_; + ret_val->default_union_member_ = default_union_member_; + } + } + + return ret_val; +} + +ReturnCode_t DynamicTypeBuilderImpl::copy_from( + traits::ref_type type) +{ + type_descriptor_.copy_from(type->type_descriptor_); + for (auto& annotation : type->annotation_) + { + annotation_.emplace_back(); + annotation_.back().copy_from(annotation); + } + member_ = type->member_; + member_by_name_ = type->member_by_name_; + members_ = type->members_; + return RETCODE_OK; +} + +traits::ref_type DynamicTypeBuilderImpl::_this() +{ + return shared_from_this(); +} + +} // namespace dds +} // namespace fastdds +} // namespace eprosima diff --git a/src/cpp/fastdds/xtypes/dynamic_types/DynamicTypeBuilderImpl.hpp b/src/cpp/fastdds/xtypes/dynamic_types/DynamicTypeBuilderImpl.hpp index ccf2e9d7b5a..d210d2e1388 100644 --- a/src/cpp/fastdds/xtypes/dynamic_types/DynamicTypeBuilderImpl.hpp +++ b/src/cpp/fastdds/xtypes/dynamic_types/DynamicTypeBuilderImpl.hpp @@ -15,11 +15,12 @@ #ifndef FASTDDS_XTYPES_DYNAMIC_TYPES_DYNAMICTYPEBUILDERIMPL_HPP #define FASTDDS_XTYPES_DYNAMIC_TYPES_DYNAMICTYPEBUILDERIMPL_HPP -#include - #include +#include + #include "AnnotationDescriptorImpl.hpp" +#include "DynamicTypeImpl.hpp" #include "TypeDescriptorImpl.hpp" namespace eprosima { @@ -34,21 +35,21 @@ class DynamicTypeBuilderImpl : public traits::base_type const TypeDescriptorImpl&) noexcept; ReturnCode_t get_descriptor( - traits::ref_type descriptor) noexcept override; + traits::ref_type& descriptor) noexcept override; ObjectName get_name() noexcept override; TypeKind get_kind() noexcept override; ReturnCode_t get_member_by_name( - traits::ref_type member, + traits::ref_type& member, const ObjectName& name) noexcept override; ReturnCode_t get_all_members_by_name( DynamicTypeMembersByName& member) noexcept override; ReturnCode_t get_member( - traits::ref_type member, + traits::ref_type& member, MemberId id) noexcept override; ReturnCode_t get_all_members( @@ -57,13 +58,13 @@ class DynamicTypeBuilderImpl : public traits::base_type uint32_t get_member_count() noexcept override; ReturnCode_t get_member_by_index( - traits::ref_type member, + traits::ref_type& member, uint32_t index) noexcept override; uint32_t get_annotation_count() noexcept override; ReturnCode_t get_annotation( - traits::ref_type descriptor, + traits::ref_type& descriptor, uint32_t idx) noexcept override; bool equals( @@ -82,23 +83,58 @@ class DynamicTypeBuilderImpl : public traits::base_type traits::ref_type build() noexcept override; + /*! + * Initialize the instance copying the information from a @ref DynamicType. + * + * @param[in] @ref DynamicType reference used to initialize the instance. + * @return Currently always return RETCODE_OK. + */ + ReturnCode_t copy_from( + traits::ref_type type); + + const TypeDescriptorImpl& get_descriptor() const noexcept + { + return type_descriptor_; + } + + TypeDescriptorImpl& get_descriptor() noexcept + { + return type_descriptor_; + } + protected: - traits::ref_type _this (); + traits::ref_type _this(); private: + //! Contains the annotations applied by the user. std::vector annotation_; + //! Contains the default value of discriminator (TK_UNION) or next literal (TK_ENUM). + //! This is calculated while the type is being built. + int32_t default_value_ {0}; + + //! Points to the default union member. + MemberId default_union_member_ {MEMBER_ID_INVALID}; + + //! Collection of all members sorted by MemberId. DynamicTypeMembersById member_; + //! Collection of all members sorted by name. DynamicTypeMembersByName member_by_name_; - std::vector::ref_type> members_; + //! Collection of all members sorted by index. + std::vector::ref_type> members_; - TypeDescriptorImpl type_descriptor_; + //! Next MemberId to be used. + MemberId next_id_ {0}; + //! Next index to be used. uint32_t next_index_ {0}; + + //! Copy of the TypeDescriptor provided by the user. + TypeDescriptorImpl type_descriptor_; }; } // namespace dds diff --git a/src/cpp/fastdds/xtypes/dynamic_types/DynamicTypeImpl.cpp b/src/cpp/fastdds/xtypes/dynamic_types/DynamicTypeImpl.cpp new file mode 100644 index 00000000000..d901ca98d1f --- /dev/null +++ b/src/cpp/fastdds/xtypes/dynamic_types/DynamicTypeImpl.cpp @@ -0,0 +1,240 @@ +// 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. + +#include "DynamicTypeImpl.hpp" + +#include +#include +#include + +namespace eprosima { +namespace fastdds { +namespace dds { + +DynamicTypeImpl::DynamicTypeImpl( + const TypeDescriptorImpl& descriptor) noexcept +{ + type_descriptor_.copy_from(descriptor); +} + +ReturnCode_t DynamicTypeImpl::get_descriptor( + traits::ref_type& descriptor) noexcept +{ + if (!descriptor) + { + return RETCODE_BAD_PARAMETER; + } + + traits::narrow(descriptor)->copy_from(type_descriptor_); + return RETCODE_OK; +} + +ObjectName DynamicTypeImpl::get_name() noexcept +{ + return type_descriptor_.name(); +} + +TypeKind DynamicTypeImpl::get_kind() noexcept +{ + return type_descriptor_.kind(); +} + +ReturnCode_t DynamicTypeImpl::get_member_by_name( + traits::ref_type& member, + const ObjectName& name) noexcept +{ + auto it = member_by_name_.find(name); + + if (member_by_name_.end() == it) + { + return RETCODE_BAD_PARAMETER; + } + + member = it->second; + return RETCODE_OK; +} + +ReturnCode_t DynamicTypeImpl::get_all_members_by_name( + DynamicTypeMembersByName& member) noexcept +{ + member = member_by_name_; + return RETCODE_OK; +} + +ReturnCode_t DynamicTypeImpl::get_member( + traits::ref_type& member, + MemberId id) noexcept +{ + auto it = member_.find(id); + + if (member_.end() == it) + { + return RETCODE_BAD_PARAMETER; + } + + member = it->second; + return RETCODE_OK; +} + +ReturnCode_t DynamicTypeImpl::get_all_members( + DynamicTypeMembersById& member) noexcept +{ + member = member_; + return RETCODE_OK; +} + +uint32_t DynamicTypeImpl::get_member_count() noexcept +{ + return static_cast(members_.size()); +} + +ReturnCode_t DynamicTypeImpl::get_member_by_index( + traits::ref_type& member, + uint32_t index) noexcept +{ + if (index >= members_.size()) + { + return RETCODE_BAD_PARAMETER; + } + + member = members_.at(index); + return RETCODE_OK; +} + +uint32_t DynamicTypeImpl::get_annotation_count() noexcept +{ + return static_cast(annotation_.size()); +} + +ReturnCode_t DynamicTypeImpl::get_annotation( + traits::ref_type& descriptor, + uint32_t idx) noexcept +{ + if (!descriptor || idx >= annotation_.size()) + { + return RETCODE_BAD_PARAMETER; + } + + traits::narrow(descriptor)->copy_from(annotation_.at(idx)); + return RETCODE_OK; +} + +uint32_t DynamicTypeImpl::get_verbatim_text_count() noexcept +{ + return static_cast(verbatim_.size()); +} + +ReturnCode_t DynamicTypeImpl::get_verbatim_text( + traits::ref_type& descriptor, + uint32_t idx) noexcept +{ + if (!descriptor || idx >= verbatim_.size()) + { + return RETCODE_BAD_PARAMETER; + } + + traits::narrow(descriptor)->copy_from(verbatim_.at(idx)); + return RETCODE_OK; +} + +bool DynamicTypeImpl::equals( + traits::ref_type other) noexcept +{ + bool ret_value = true; + auto impl = traits::narrow(other); + + ret_value &= type_descriptor_.equals(impl->type_descriptor_); + if (ret_value) + { + ret_value &= annotation_.size() == impl->annotation_.size(); + if (ret_value) + { + for (auto& annotation : annotation_) + { + ret_value &= impl->annotation_.end() != std::find_if(impl->annotation_.begin(), impl->annotation_.end(), + [&annotation](AnnotationDescriptorImpl& a) + { + return annotation.equals(a); + }); + } + } + + ret_value &= member_.size() == impl->member_.size(); + assert(TK_ANNOTATION == type_descriptor_.kind() || + TK_BITMASK == type_descriptor_.kind() || + TK_BITSET == type_descriptor_.kind() || + TK_STRUCTURE == type_descriptor_.kind() || + TK_UNION == type_descriptor_.kind() || + 0 == member_.size()); + assert(TK_ANNOTATION == impl->type_descriptor_.kind() || + TK_BITMASK == impl->type_descriptor_.kind() || + TK_BITSET == impl->type_descriptor_.kind() || + TK_STRUCTURE == impl->type_descriptor_.kind() || + TK_UNION == impl->type_descriptor_.kind() || + 0 == impl->member_.size()); + + assert(member_by_name_.size() == members_.size()); + ret_value &= member_by_name_.size() == impl->member_by_name_.size(); + if (ret_value) + { + auto it = member_by_name_.begin(); + auto impl_it = impl->member_by_name_.begin(); + + while (ret_value && member_by_name_.end() != it) + { + ret_value &= it->second->equals(impl_it->second); + ++it; + ++impl_it; + } + } + + ret_value &= verbatim_.size() == impl->verbatim_.size(); + if (ret_value) + { + for (auto& verbatim : verbatim_) + { + ret_value &= impl->verbatim_.end() != std::find_if(impl->verbatim_.begin(), impl->verbatim_.end(), + [&verbatim](VerbatimTextDescriptorImpl& v) + { + return verbatim.equals(v); + }); + } + } + } + + return ret_value; +} + +traits::ref_type DynamicTypeImpl::resolve_alias_enclosed_type() noexcept +{ + traits::ref_type ret_value = traits::narrow(_this()); + + if (TK_ALIAS == ret_value->get_kind()) + { + do { + ret_value = traits::narrow(ret_value->get_descriptor().base_type()); + } while (TK_ALIAS == ret_value->get_kind()); + } + + return ret_value; +} + +traits::ref_type DynamicTypeImpl::_this() +{ + return shared_from_this(); +} + +} // namespace dds +} // namespace fastdds +} // namespace eprosima diff --git a/src/cpp/fastdds/xtypes/dynamic_types/DynamicTypeImpl.hpp b/src/cpp/fastdds/xtypes/dynamic_types/DynamicTypeImpl.hpp index 570ced08a2e..cce3f300351 100644 --- a/src/cpp/fastdds/xtypes/dynamic_types/DynamicTypeImpl.hpp +++ b/src/cpp/fastdds/xtypes/dynamic_types/DynamicTypeImpl.hpp @@ -15,11 +15,14 @@ #ifndef _FASTDDS_XTYPES_DYNAMIC_TYPES_DYNAMIC_TYPE_IMPL_HPP_ #define _FASTDDS_XTYPES_DYNAMIC_TYPES_DYNAMIC_TYPE_IMPL_HPP_ -#include - #include +#include +#include +#include + #include "AnnotationDescriptorImpl.hpp" +#include "DynamicTypeMemberImpl.hpp" #include "TypeDescriptorImpl.hpp" #include "VerbatimTextDescriptorImpl.hpp" @@ -29,24 +32,29 @@ namespace dds { class DynamicTypeImpl : public virtual traits::base_type { + friend class DynamicTypeBuilderImpl; + public: + DynamicTypeImpl( + const TypeDescriptorImpl& descriptor) noexcept; + ReturnCode_t get_descriptor( - traits::ref_type descriptor) noexcept override; + traits::ref_type& descriptor) noexcept override; ObjectName get_name() noexcept override; TypeKind get_kind() noexcept override; ReturnCode_t get_member_by_name( - traits::ref_type member, + traits::ref_type& member, const ObjectName& name) noexcept override; ReturnCode_t get_all_members_by_name( DynamicTypeMembersByName& member) noexcept override; ReturnCode_t get_member( - traits::ref_type member, + traits::ref_type& member, MemberId id) noexcept override; ReturnCode_t get_all_members( @@ -55,38 +63,80 @@ class DynamicTypeImpl : public virtual traits::base_type uint32_t get_member_count() noexcept override; ReturnCode_t get_member_by_index( - traits::ref_type member, + traits::ref_type& member, uint32_t index) noexcept override; uint32_t get_annotation_count() noexcept override; ReturnCode_t get_annotation( - traits::ref_type descriptor, + traits::ref_type& descriptor, uint32_t idx) noexcept override; uint32_t get_verbatim_text_count() noexcept override; ReturnCode_t get_verbatim_text( - traits::ref_type descriptor, + traits::ref_type& descriptor, uint32_t idx) noexcept override; bool equals( traits::ref_type other) noexcept override; + const DynamicTypeMembersById& get_all_members() const + { + return member_; + } + + const std::vector::ref_type>& get_all_members_by_index() const + { + return members_; + } + + const TypeDescriptorImpl& get_descriptor() const noexcept + { + return type_descriptor_; + } + + int32_t default_value() const noexcept + { + return default_value_; + } + + MemberId default_union_member() const noexcept + { + return default_union_member_; + } + + traits::ref_type resolve_alias_enclosed_type() noexcept; + protected: traits::ref_type _this(); private: + //! Contains the annotations applied by the user. std::vector annotation_; + //! Contains the default value of discriminator (TK_UNION) or next literal (TK_ENUM). + //! This is calculated while the type is being built. + int32_t default_value_ {0}; + + //! Points to the default union member. + MemberId default_union_member_ {MEMBER_ID_INVALID}; + + //! Collection of all members sorted by MemberId. DynamicTypeMembersById member_; + //! Collection of all members sorted by name. DynamicTypeMembersByName member_by_name_; + //! Collection of all members sorted by index. + std::vector::ref_type> members_; + + //! Copy of the TypeDescriptor provided by the user. TypeDescriptorImpl type_descriptor_; + //! Contains the verbatim builtin annotation applied by the user. std::vector verbatim_; }; diff --git a/src/cpp/fastdds/xtypes/dynamic_types/DynamicTypeMemberImpl.cpp b/src/cpp/fastdds/xtypes/dynamic_types/DynamicTypeMemberImpl.cpp new file mode 100644 index 00000000000..b4de9e1ea02 --- /dev/null +++ b/src/cpp/fastdds/xtypes/dynamic_types/DynamicTypeMemberImpl.cpp @@ -0,0 +1,136 @@ +// 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. + +#include "DynamicTypeMemberImpl.hpp" + +#include + +#include +#include + +namespace eprosima { +namespace fastdds { +namespace dds { + +DynamicTypeMemberImpl::DynamicTypeMemberImpl( + const MemberDescriptorImpl& descriptor) noexcept +{ + member_descriptor_.copy_from(descriptor); +} + +ReturnCode_t DynamicTypeMemberImpl::get_descriptor( + traits::ref_type& descriptor) noexcept +{ + if (!descriptor) + { + return RETCODE_BAD_PARAMETER; + } + + traits::narrow(descriptor)->copy_from(member_descriptor_); + return RETCODE_OK; +} + +uint32_t DynamicTypeMemberImpl::get_annotation_count() noexcept +{ + return static_cast(annotation_.size()); +} + +ReturnCode_t DynamicTypeMemberImpl::get_annotation( + traits::ref_type& descriptor, + const uint32_t idx) noexcept +{ + if (!descriptor || idx >= annotation_.size()) + { + return RETCODE_BAD_PARAMETER; + } + + traits::narrow(descriptor)->copy_from(annotation_.at(idx)); + return RETCODE_OK; +} + +uint32_t DynamicTypeMemberImpl::get_verbatim_text_count() noexcept +{ + return static_cast(verbatim_.size()); +} + +ReturnCode_t DynamicTypeMemberImpl::get_verbatim_text( + traits::ref_type& descriptor, + const uint32_t idx) noexcept +{ + if (!descriptor || idx >= verbatim_.size()) + { + return RETCODE_BAD_PARAMETER; + } + + traits::narrow(descriptor)->copy_from(verbatim_.at(idx)); + return RETCODE_OK; +} + +bool DynamicTypeMemberImpl::equals( + traits::ref_type other) noexcept +{ + bool ret_value = true; + auto impl = traits::narrow(other); + + ret_value &= (annotation_.size() == impl->annotation_.size()); + if (ret_value) + { + for (size_t count {0}; ret_value && count < annotation_.size(); ++count) + { + auto& annotation = annotation_.at(count); + ret_value &= impl->annotation_.end() != std::find_if(impl->annotation_.begin(), impl->annotation_.end(), + [&annotation](AnnotationDescriptorImpl& a) + { + return annotation.equals(a); + }); + } + } + + ret_value &= member_descriptor_.equals(impl->member_descriptor_); + + ret_value &= (verbatim_.size() == impl->verbatim_.size()); + if (ret_value) + { + for (size_t count {0}; ret_value && count < verbatim_.size(); ++count) + { + auto& verbatim = verbatim_.at(count); + ret_value &= impl->verbatim_.end() != std::find_if(impl->verbatim_.begin(), impl->verbatim_.end(), + [&verbatim](VerbatimTextDescriptorImpl& v) + { + return verbatim.equals(v); + }); + } + } + + return ret_value; +} + +MemberId DynamicTypeMemberImpl::get_id() noexcept +{ + return member_descriptor_.id(); +} + +ObjectName DynamicTypeMemberImpl::get_name() noexcept +{ + return member_descriptor_.name(); +} + +traits::ref_type DynamicTypeMemberImpl::_this() +{ + return shared_from_this(); +} + +} // namespace dds +} // namespace fastdds +} // namespace eprosima diff --git a/src/cpp/fastdds/xtypes/dynamic_types/DynamicTypeMemberImpl.hpp b/src/cpp/fastdds/xtypes/dynamic_types/DynamicTypeMemberImpl.hpp index 9ee255c1925..3fb4bcb17cd 100644 --- a/src/cpp/fastdds/xtypes/dynamic_types/DynamicTypeMemberImpl.hpp +++ b/src/cpp/fastdds/xtypes/dynamic_types/DynamicTypeMemberImpl.hpp @@ -15,10 +15,12 @@ #ifndef FASTDDS_XTYPES_DYNAMIC_TYPES_DYNAMICTYPEMEMBERIMPL_HPP #define FASTDDS_XTYPES_DYNAMIC_TYPES_DYNAMICTYPEMEMBERIMPL_HPP -#include - #include +#include +#include +#include + #include "AnnotationDescriptorImpl.hpp" #include "MemberDescriptorImpl.hpp" #include "VerbatimTextDescriptorImpl.hpp" @@ -29,21 +31,26 @@ namespace dds { class DynamicTypeMemberImpl : public virtual traits::base_type { + friend class DynamicTypeBuilderImpl; + public: + DynamicTypeMemberImpl( + const MemberDescriptorImpl&) noexcept; + ReturnCode_t get_descriptor( - traits::ref_type md) noexcept override; + traits::ref_type& md) noexcept override; uint32_t get_annotation_count() noexcept override; ReturnCode_t get_annotation( - traits::ref_type descriptor, + traits::ref_type& descriptor, uint32_t idx) noexcept override; uint32_t get_verbatim_text_count() noexcept override; ReturnCode_t get_verbatim_text( - traits::ref_type descriptor, + traits::ref_type& descriptor, uint32_t idx) noexcept override; bool equals( @@ -53,6 +60,16 @@ class DynamicTypeMemberImpl : public virtual traits::base_typ ObjectName get_name() noexcept override; + MemberDescriptorImpl& get_descriptor() noexcept + { + return member_descriptor_; + } + + const MemberDescriptorImpl& get_descriptor() const noexcept + { + return member_descriptor_; + } + protected: traits::ref_type _this(); diff --git a/src/cpp/fastdds/xtypes/dynamic_types/MemberDescriptorImpl.cpp b/src/cpp/fastdds/xtypes/dynamic_types/MemberDescriptorImpl.cpp new file mode 100644 index 00000000000..fd6decafe00 --- /dev/null +++ b/src/cpp/fastdds/xtypes/dynamic_types/MemberDescriptorImpl.cpp @@ -0,0 +1,228 @@ +// 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. + +#include "MemberDescriptorImpl.hpp" + +#include +#include + +#include "DynamicTypeImpl.hpp" +#include "TypeValueConverter.hpp" + +namespace eprosima { +namespace fastdds { +namespace dds { + +template<> +traits::ref_type traits::make_shared() +{ + return std::make_shared(); +} + +ReturnCode_t MemberDescriptorImpl::copy_from( + traits::ref_type descriptor) noexcept +{ + if (!descriptor) + { + return RETCODE_BAD_PARAMETER; + } + + return copy_from(*traits::narrow(descriptor)); +} + +ReturnCode_t MemberDescriptorImpl::copy_from( + const MemberDescriptorImpl& descriptor) noexcept +{ + name_ = descriptor.name_; + id_ = descriptor.id_; + type_ = descriptor.type_; + default_value_ = descriptor.default_value_; + index_ = descriptor.index_; + label_ = descriptor.label_; + try_construct_kind_ = descriptor.try_construct_kind_; + is_key_ = descriptor.is_key_; + is_optional_ = descriptor.is_optional_; + is_must_understand_ = descriptor.is_must_understand_; + is_shared_ = descriptor.is_shared_; + is_default_label_ = descriptor.is_default_label_; + + return RETCODE_OK; +} + +bool MemberDescriptorImpl::equals( + traits::ref_type descriptor) noexcept +{ + return equals(*traits::narrow(descriptor)); +} + +bool MemberDescriptorImpl::equals( + MemberDescriptorImpl& descriptor) noexcept +{ + return name_ == descriptor.name_ && + id_ == descriptor.id_ && + (type_ && type_->equals(descriptor.type_)) && + default_value_ == descriptor.default_value_ && + index_ == descriptor.index_ && + label_ == descriptor.label_ && + try_construct_kind_ == descriptor.try_construct_kind_ && + is_key_ == descriptor.is_key_ && + is_optional_ == descriptor.is_optional_ && + is_must_understand_ == descriptor.is_must_understand_ && + is_shared_ == descriptor.is_shared_ && + is_default_label_ == descriptor.is_default_label_; +} + +bool MemberDescriptorImpl::is_consistent() noexcept +{ + if (TK_NONE == parent_kind_) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "To check consistency the descriptor should be added as member"); + return false; + } + + // type_ cannot be nil. + if (!type_) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Descriptor has no type and it is mandatory"); + return false; + } + + auto type = traits::narrow(type_); + + // Only aggregated types must use the ID value. + if ((MEMBER_ID_INVALID == id_ && (TK_ANNOTATION == parent_kind_ || + TK_BITMASK == parent_kind_ || + TK_BITSET == parent_kind_ || + TK_UNION == parent_kind_ || + TK_STRUCTURE == parent_kind_)) || + (MEMBER_ID_INVALID != id_ && TK_ANNOTATION != parent_kind_ && + TK_BITMASK != parent_kind_ && + TK_BITSET != parent_kind_ && + TK_UNION != parent_kind_ && + TK_STRUCTURE != parent_kind_)) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Descriptor has a wrong MemberId " << id_); + return false; + } + + // A union member cannot have the MemberId 0 because this value is for the discriminator + if (TK_UNION == parent_kind_ && 0 == id_) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, + "Parent type is an UNION and the MemberId 0 is reserved to the discriminator"); + return false; + } + + // Check default_label. + if (is_default_label_ && TK_UNION != parent_kind_) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Parent type is not a UNION and it has set is_default_label"); + return false; + } + + // Check labels + if ((TK_UNION != parent_kind_ && 0 < label_.size()) || + (TK_UNION == parent_kind_ && !is_default_label_ && 0 == label_.size())) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Descriptor is not consistent with its labels"); + return false; + } + + // Check uniqueness of labels. + if (TK_UNION == parent_kind_) + { + UnionCaseLabelSeq label_copy {label_}; + std::sort(label_copy.begin(), label_copy.end()); + auto last = std::unique(label_copy.begin(), label_copy.end()); + if (label_copy.end() != last) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Descriptor contains duplicated labels"); + return false; + } + } + + if (!default_value_.empty() && + !TypeValueConverter::is_string_consistent(type->get_kind(), type->get_all_members_by_index(), + default_value_)) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Default value is not consistent"); + return false; + } + + // Check bitfield|enum enclosing type. + if (TK_BITSET == parent_kind_ || + TK_ENUM == parent_kind_) + { + + TypeKind kind = type->resolve_alias_enclosed_type()->get_kind(); + + switch (kind) + { + case TK_INT8: + case TK_UINT8: + case TK_INT16: + case TK_UINT16: + case TK_INT32: + case TK_UINT32: + break; + case TK_INT64: + case TK_UINT64: + case TK_BOOLEAN: + case TK_BYTE: + if (TK_ENUM == parent_kind_) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Parent type is an ENUM and the enclosing type is not valid"); + return false; + } + break; + default: + EPROSIMA_LOG_ERROR(DYN_TYPES, "Parent type is an BITSET|ENUM and the enclosing type is not valid"); + return false; + break; + } + } + + // Check bitmask enclosing type. + if (TK_BITMASK == parent_kind_ && TK_BOOLEAN != type->get_kind()) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Parent type is a BITMASK and the enclosing type is not BOOLEAN"); + return false; + } + + // TK_MAP member cannot be key. + if (TK_MAP == type->get_kind() && is_key_) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "TK_MAP member cannot be part of the key."); + return false; + } + + // Check name consistency + if (0 == name_.size() && (TK_ANNOTATION == parent_kind_ || + TK_BITMASK == parent_kind_ || + TK_BITSET == parent_kind_ || + TK_ENUM == parent_kind_ || + TK_STRUCTURE == parent_kind_ || + TK_UNION == parent_kind_)) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, + "Parent type is an ANNOTATION|BITMASK|BITSET|ENUM|STRUCTURE|UNION and the member has no name."); + return false; + } + + return true; +} + +} // namespace dds +} // namespace fastdds +} // namespace eprosima diff --git a/src/cpp/fastdds/xtypes/dynamic_types/MemberDescriptorImpl.hpp b/src/cpp/fastdds/xtypes/dynamic_types/MemberDescriptorImpl.hpp index f69e3f661da..ff990a66545 100644 --- a/src/cpp/fastdds/xtypes/dynamic_types/MemberDescriptorImpl.hpp +++ b/src/cpp/fastdds/xtypes/dynamic_types/MemberDescriptorImpl.hpp @@ -15,7 +15,12 @@ #ifndef _FASTDDS_XTYPES_DYNAMIC_TYPES_MEMBER_DESCRIPTOR_IMPL_HPP_ #define _FASTDDS_XTYPES_DYNAMIC_TYPES_MEMBER_DESCRIPTOR_IMPL_HPP_ +#include + +#include +#include #include +#include namespace eprosima { namespace fastdds { @@ -23,41 +28,44 @@ namespace dds { class MemberDescriptorImpl : public virtual MemberDescriptor { - //! Name of the member - ObjectName name_; + //! Default value of the member in string form. + std::string default_value_; - //! MemberId, it should be filled automatically when the member is added. + //! MemberId, it should be filled automatically when the member is added if not set (MEMBER_ID_INVALID). MemberId id_ {MEMBER_ID_INVALID}; - //! Member's type - traits::ref_type type_; - - //! Default value of the member in string. - std::string default_value_; - //! Definition order of the member inside its parent. - uint32_t index_ {0}; - - //! Case Labels for unions. - UnionCaseLabelSeq label_; + uint32_t index_ {0xFFFFFFFF}; - //! @ref TryConstructKind - TryConstructKind try_construct_kind_ {TryConstructKind::DISCARD}; + //! If the union member is default. + bool is_default_label_ {false}; //! If the member is key. bool is_key_ {false}; - //! If the member is optional. - bool is_optional_ {false}; - //! If the member is must_understand. bool is_must_understand_ {false}; + //! If the member is optional. + bool is_optional_ {false}; + //! If the member is shared (external). bool is_shared_ {false}; - //! If the union member is default. - bool is_default_label_ {false}; + //! Case Labels for unions. + UnionCaseLabelSeq label_; + + //! Name of the member + ObjectName name_; + + //! Kind of the DynamicType which will contain this member. + TypeKind parent_kind_ {TK_NONE}; + + //! @ref TryConstructKind + TryConstructKind try_construct_kind_ {TryConstructKind::DISCARD}; + + //! Member's type + traits::ref_type type_; public: @@ -158,7 +166,7 @@ class MemberDescriptorImpl : public virtual MemberDescriptor } void index( - uint32_t index) noexcept override + uint32_t index) noexcept { index_ = index; } @@ -185,6 +193,22 @@ class MemberDescriptorImpl : public virtual MemberDescriptor label_ = std::move(label); } + TypeKind parent_kind() const noexcept + { + return parent_kind_; + } + + TypeKind& parent_kind() noexcept + { + return parent_kind_; + } + + void parent_kind( + TypeKind parent_kind) noexcept + { + parent_kind_ = parent_kind; + } + TryConstructKind try_construct_kind() const noexcept override { return try_construct_kind_; diff --git a/src/cpp/fastdds/xtypes/dynamic_types/TypeDescriptorImpl.cpp b/src/cpp/fastdds/xtypes/dynamic_types/TypeDescriptorImpl.cpp new file mode 100644 index 00000000000..eaa86e5682e --- /dev/null +++ b/src/cpp/fastdds/xtypes/dynamic_types/TypeDescriptorImpl.cpp @@ -0,0 +1,326 @@ +// 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. + +#include "TypeDescriptorImpl.hpp" + +#include +#include + +#include +#include +#include + +#include "DynamicTypeImpl.hpp" + +namespace eprosima { +namespace fastdds { +namespace dds { + +template<> +traits::ref_type traits::make_shared() +{ + return std::make_shared(); +} + +enum FSM_INPUTS +{ + LETTER = 1, + NUMBER, + UNDERSCORE, + COLON, + OTHER +}; + +enum FSM_STATES +{ + INVALID = 0, + SINGLECOLON, + DOUBLECOLON, + VALID +}; + +static const int stateTable[4][6] = +{ + /* Input: letter, number, underscore, colon, other */ + {INVALID, VALID, INVALID, INVALID, INVALID, INVALID}, + {SINGLECOLON, INVALID, INVALID, INVALID, DOUBLECOLON, INVALID}, + {DOUBLECOLON, VALID, INVALID, INVALID, INVALID, INVALID}, + {VALID, VALID, VALID, VALID, SINGLECOLON, INVALID} +}; + +bool is_type_name_consistent( + const ObjectName& sName) +{ + // Implement an FSM string parser to deal with both a plain type name + // and a fully qualified name. According to the DDS xtypes standard, + // type's fully qualified name is a concatenation of module names with + // the name of a type inside of those modules. + int currState = INVALID; + for (uint32_t i = 0; i < sName.size(); ++i) + { + int col = 0; + if (std::isalpha(sName[i])) + { + col = LETTER; + } + else if (std::isdigit(sName[i])) + { + col = NUMBER; + } + else if (sName[i] == '_') + { + col = UNDERSCORE; + } + else if (sName[i] == ':') + { + col = COLON; + } + else + { + col = OTHER; + } + currState = stateTable[currState][col]; + if (currState == INVALID) + { + return false; + } + } + return true; +} + +TypeDescriptorImpl::TypeDescriptorImpl( + TypeKind kind, + const ObjectName& name) + : kind_(kind) + , name_(name) +{ +} + +ReturnCode_t TypeDescriptorImpl::copy_from( + traits::ref_type descriptor) noexcept +{ + if (!descriptor) + { + return RETCODE_BAD_PARAMETER; + } + + return copy_from(*traits::narrow(descriptor)); +} + +ReturnCode_t TypeDescriptorImpl::copy_from( + const TypeDescriptorImpl& descriptor) noexcept +{ + kind_ = descriptor.kind_; + name_ = descriptor.name_; + base_type_ = descriptor.base_type_; + discriminator_type_ = descriptor.discriminator_type_; + bound_ = descriptor.bound_; + element_type_ = descriptor.element_type_; + key_element_type_ = descriptor.key_element_type_; + extensibility_kind_ = descriptor.extensibility_kind_; + is_nested_ = descriptor.is_nested_; + + return RETCODE_OK; +} + +bool TypeDescriptorImpl::equals( + traits::ref_type descriptor) noexcept +{ + return equals(*traits::narrow(descriptor)); +} + +bool TypeDescriptorImpl::equals( + TypeDescriptorImpl& descriptor) noexcept +{ + return kind_ == descriptor.kind_ && + name_ == descriptor.name_ && + ((!base_type_ && !descriptor.base_type_) || (base_type_ && base_type_->equals(descriptor.base_type_))) && + ((!discriminator_type_ && !descriptor.discriminator_type_) || + (discriminator_type_ && discriminator_type_->equals(descriptor.discriminator_type_))) && + bound_ == descriptor.bound_ && + ((!element_type_ && !descriptor.element_type_) || + (element_type_ && element_type_->equals(descriptor.element_type_))) && + ((!key_element_type_ && !descriptor.key_element_type_) || + (key_element_type_ && key_element_type_->equals(descriptor.key_element_type_))) && + extensibility_kind_ == descriptor.extensibility_kind_ && + is_nested_ == descriptor.is_nested_; +} + +bool TypeDescriptorImpl::is_consistent() noexcept +{ + // Alias Types need the base type to indicate what type has been aliased. + if (TK_ALIAS == kind_ && !base_type_) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Descriptor describes an ALIAS but the base_type was not set"); + return false; + } + + // Alias must have base type, and structures and bitsets optionally can have it. + if (base_type_ && + TK_ALIAS != kind_ && + TK_BITSET != kind_ && + TK_STRUCTURE != kind_) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, + "Descriptor doesn't describe an ALIAS|BITSET|STRUCTURE but the base_type was set"); + return false; + } + + // Check the parent is of the same kind. + if (base_type_ && TK_ALIAS != kind_) + { + auto base_type = + traits::narrow(base_type_)->resolve_alias_enclosed_type(); + + if (kind_ != base_type->get_kind()) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Descriptor type and the base_type are not of the same kind"); + return false; + } + } + + // Arrays need one or more bound fields with the lenghts of each dimension. + if (TK_ARRAY == kind_ && 0 == bound_.size()) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Descriptor describes an ARRAY but bound is empty"); + return false; + } + + // These types need one bound with the length of the field. + if (1 != bound_.size() && ( + TK_SEQUENCE == kind_ || + TK_MAP == kind_ || + TK_BITMASK == kind_ || + TK_STRING8 == kind_ || + TK_STRING16 == kind_)) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, + "Descriptor describes an SEQUENCE|MAP|BITMASK|STRING but bound doesn't contain only one element"); + return false; + } + + // Check no bound is zero. + if (bound_.end() != std::find_if(bound_.begin(), bound_.end(), + [](uint32_t bound) + { + return 0 == bound; + })) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Bounds contains a zero and it is not a valid value."); + return false; + } + + // Bitmask bound must be greater than zero and no greater than 64. + if (TK_BITMASK == kind_ && (0 == bound_.at(0) || 64 < bound_.at(0))) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, + "Descriptor describes an BITMASK but bound is not valid."); + return false; + } + + // Only union types need the discriminator of the union + if (TK_UNION == kind_) + { + if (!discriminator_type_) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Descriptor describes an UNION but discriminant_type was not set"); + return false; + } + else + { + // Check discriminator kind and the type is a integer (labels are int32_t). + // boolean, byte, char8, char16, int8, uint8, int16, uint16, int32, uint32, enum, alias + TypeKind discriminator_kind = + traits::narrow(discriminator_type_)->resolve_alias_enclosed_type() + ->get_kind(); + + switch (discriminator_kind) + { + case TK_BOOLEAN: + case TK_BYTE: + case TK_CHAR8: + case TK_CHAR16: + case TK_INT8: + case TK_UINT8: + case TK_INT16: + case TK_UINT16: + case TK_INT32: + case TK_UINT32: + case TK_INT64: + case TK_UINT64: + case TK_ENUM: + break; + default: + EPROSIMA_LOG_ERROR(DYN_TYPES, "Discriminantor kind was not valid"); + return false; + break; + } + } + } + + // ElementType is used by these types to set the "value" type of the element, otherwise it should be null. + if (!element_type_ && ( + TK_ARRAY == kind_ || + TK_SEQUENCE == kind_ || + TK_STRING8 == kind_ || + TK_STRING16 == kind_ || + TK_MAP == kind_ || + TK_BITMASK == kind_)) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, + "Descriptor describes an ARRAY|SEQUENCE|MAP|BITMASK|STRING but element_type was not set"); + return false; + } + + // For Bitmask types is mandatory that this element is boolean. + if (TK_BITMASK == kind_ && TK_BOOLEAN != element_type_->get_kind()) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Descriptor describes a BITMASK but element_type is not of BOOLEAN type"); + return false; + } + + // Only map types need the keyElementType to store the "Key" type of the pair. + if (TK_MAP == kind_ && !key_element_type_) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Descriptor describes a MAP but key_element_type was not set"); + return false; + } + + if (TK_MAP == kind_ && (TK_ANNOTATION == key_element_type()->get_kind() || + TK_ARRAY == key_element_type()->get_kind() || + TK_BITSET == key_element_type()->get_kind() || + TK_BITMASK == key_element_type()->get_kind() || + TK_MAP == key_element_type()->get_kind() || + TK_SEQUENCE == key_element_type()->get_kind() || + TK_STRING16 == key_element_type()->get_kind() || + TK_STRUCTURE == key_element_type()->get_kind() || + TK_UNION == key_element_type()->get_kind() + )) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Descriptor describes a MAP with an invalid key_element_type"); + return false; + } + + if (!is_type_name_consistent(name_)) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Descriptor name is not a fully qualified name"); + return false; + } + + return true; +} + +} // namespace dds +} // namespace fastdds +} // namespace eprosima diff --git a/src/cpp/fastdds/xtypes/dynamic_types/TypeForKind.hpp b/src/cpp/fastdds/xtypes/dynamic_types/TypeForKind.hpp new file mode 100644 index 00000000000..173c0f56a76 --- /dev/null +++ b/src/cpp/fastdds/xtypes/dynamic_types/TypeForKind.hpp @@ -0,0 +1,399 @@ +// Copyright 2024 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef FASTDDS_XTYPES_DYNAMIC_TYPES_TYPEFORKIND_HPP +#define FASTDDS_XTYPES_DYNAMIC_TYPES_TYPEFORKIND_HPP + +#include + +#include +#include + +namespace eprosima { +namespace fastdds { +namespace dds { + +//{{{ Type traits + +template +struct TypeForKind_; + +template <> +struct TypeForKind_ +{ + using type = int8_t; + using sequence_type = Int8Seq; +}; + +template <> +struct TypeForKind_ +{ + using type = uint8_t; + using sequence_type = UInt8Seq; +}; + +template <> +struct TypeForKind_ +{ + using type = int16_t; + using sequence_type = Int16Seq; +}; + +template <> +struct TypeForKind_ +{ + using type = uint16_t; + using sequence_type = UInt16Seq; +}; + +template <> +struct TypeForKind_ +{ + using type = int32_t; + using sequence_type = Int32Seq; +}; + +template <> +struct TypeForKind_ +{ + using type = uint32_t; + using sequence_type = UInt32Seq; +}; + +template <> +struct TypeForKind_ +{ + using type = int64_t; + using sequence_type = Int64Seq; +}; + +template <> +struct TypeForKind_ +{ + using type = uint64_t; + using sequence_type = UInt64Seq; +}; + +template <> +struct TypeForKind_ +{ + using type = float; + using sequence_type = Float32Seq; +}; + +template <> +struct TypeForKind_ +{ + using type = double; + using sequence_type = Float64Seq; +}; + +template <> +struct TypeForKind_ +{ + using type = long double; + using sequence_type = Float128Seq; +}; + +template <> +struct TypeForKind_ +{ + using type = char; + using sequence_type = CharSeq; +}; + +template <> +struct TypeForKind_ +{ + using type = wchar_t; + using sequence_type = WcharSeq; +}; + +template <> +struct TypeForKind_ +{ + using type = eprosima::fastrtps::rtps::octet; + using sequence_type = ByteSeq; +}; + + +template <> +struct TypeForKind_ +{ + using type = bool; + using sequence_type = BooleanSeq; +}; + +template <> +struct TypeForKind_ +{ + using type = std::string; + using sequence_type = StringSeq; +}; + +template <> +struct TypeForKind_ +{ + using type = std::wstring; + using sequence_type = WstringSeq; +}; + +template +using TypeForKind = typename TypeForKind_::type; + +template +using SequenceTypeForKind = typename TypeForKind_::sequence_type; + +//}}} + +//{{{ Promotion traits + +template +struct TypePromotion : std::false_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +//}}} + +} // namespace dds +} // namespace fastdds +} // namespace eprosima + +#endif // FASTDDS_XTYPES_DYNAMIC_TYPES_TYPEFORKIND_HPP diff --git a/src/cpp/fastdds/xtypes/dynamic_types/TypeValueConverter.hpp b/src/cpp/fastdds/xtypes/dynamic_types/TypeValueConverter.hpp new file mode 100644 index 00000000000..f7d531f4d3d --- /dev/null +++ b/src/cpp/fastdds/xtypes/dynamic_types/TypeValueConverter.hpp @@ -0,0 +1,255 @@ +// Copyright 2024 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef FASTDDS_XTYPES_DYNAMIC_TYPES_TYPEVALUECONVERTER_HPP +#define FASTDDS_XTYPES_DYNAMIC_TYPES_TYPEVALUECONVERTER_HPP + +#include + +#include "DynamicTypeMemberImpl.hpp" +#include "TypeForKind.hpp" + +namespace eprosima { +namespace fastdds { +namespace dds { + +const char* const CONST_TRUE = "true"; +const char* const CONST_FALSE = "false"; + +namespace detail { + +struct converter +{ + const std::string& x; + template operator T() + { + return 0; + } + +}; + + +template <> inline converter::operator TypeForKind() +{ + return static_cast(std::stoul(x)); +} + +template <> inline converter::operator TypeForKind() +{ + return static_cast(std::stol(x)); +} + +template <> inline converter::operator TypeForKind() +{ + return static_cast(std::stoul(x)); +} + +template <> inline converter::operator TypeForKind() +{ + return static_cast(std::stol(x)); +} + +template <> inline converter::operator TypeForKind() +{ + return static_cast(std::stoul(x)); +} + +template <> inline converter::operator TypeForKind() +{ + return static_cast(std::stoll(x)); +} + +template <> inline converter::operator TypeForKind() +{ + return static_cast(std::stoull(x)); +} + +template <> inline converter::operator TypeForKind() +{ + return std::stof(x); +} + +template <> inline converter::operator TypeForKind() +{ + return std::stod(x); +} + +template <> inline converter::operator TypeForKind() +{ + return std::stold(x); +} + +template <> inline converter::operator TypeForKind() +{ + if (0 == x.compare(CONST_TRUE)) + { + return true; + } + if (0 == x.compare(CONST_FALSE)) + { + return false; + } + + return 0 < stoul(x) ? true : false; +} + +} // namespace detail + +class TypeValueConverter final +{ +public: + + static detail::converter sto( + const std::string& str) + { + return {str}; + } + + static bool is_string_consistent( + TypeKind kind, + const std::vector::ref_type>& members, + const std::string& str) + { + + if (str.empty()) + { + return false; + } + bool ret_value = true; + + try + { + switch (kind) + { + case TK_INT32: + { + TypeForKind value = sto(str); + static_cast(value); + } + break; + case TK_UINT32: + { + TypeForKind value = sto(str); + static_cast(value); + } + break; + case TK_INT8: + { + TypeForKind value = sto(str); + static_cast(value); + } + break; + case TK_INT16: + { + TypeForKind value = sto(str); + static_cast(value); + } + break; + case TK_UINT16: + { + TypeForKind value = sto(str); + static_cast(value); + } + break; + case TK_INT64: + { + TypeForKind value = sto(str); + static_cast(value); + } + break; + case TK_UINT64: + { + TypeForKind value = sto(str); + static_cast(value); + } + break; + case TK_FLOAT32: + { + TypeForKind value = sto(str); + static_cast(value); + } + break; + case TK_FLOAT64: + { + TypeForKind value = sto(str); + static_cast(value); + } + break; + case TK_FLOAT128: + { + TypeForKind value = sto(str); + static_cast(value); + } + break; + case TK_CHAR8: + case TK_CHAR16: + { + if (str.size() != 1) + { + ret_value = false; + } + } + break; + case TK_BOOLEAN: + { + TypeForKind value = sto(str); + static_cast(value); + } + break; + case TK_BYTE: + { + TypeForKind value = sto(str); + static_cast(value); + } + break; + case TK_UINT8: + { + TypeForKind value = sto(str); + static_cast(value); + } + break; + case TK_STRING8: + case TK_STRING16: + break; + case TK_ENUM: + ret_value = false; + for (auto& member : members) + { + if (0 == str.compare(member->get_name().to_string())) + { + ret_value = true; + break; + } + } + break; + default: + ret_value = false; + break; + } + } + catch (...) + { + ret_value = false; + } + + return ret_value; + } + +}; + +} // namespace dds +} // namespace fastdds +} // namespace eprosima + +#endif // FASTDDS_XTYPES_DYNAMIC_TYPES_TYPEVALUECONVERTER_HPP diff --git a/src/cpp/fastdds/xtypes/dynamic_types/VerbatimTextDescriptorImpl.cpp b/src/cpp/fastdds/xtypes/dynamic_types/VerbatimTextDescriptorImpl.cpp new file mode 100644 index 00000000000..8787c0284d2 --- /dev/null +++ b/src/cpp/fastdds/xtypes/dynamic_types/VerbatimTextDescriptorImpl.cpp @@ -0,0 +1,68 @@ +// 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. + +#include "VerbatimTextDescriptorImpl.hpp" + +namespace eprosima { +namespace fastdds { +namespace dds { + +template<> +traits::ref_type traits::make_shared() +{ + return std::make_shared(); +} + +ReturnCode_t VerbatimTextDescriptorImpl::copy_from( + traits::ref_type descriptor) noexcept +{ + if (!descriptor) + { + return RETCODE_BAD_PARAMETER; + } + + return copy_from(*traits::narrow(descriptor)); +} + +ReturnCode_t VerbatimTextDescriptorImpl::copy_from( + const VerbatimTextDescriptorImpl& descriptor) noexcept +{ + placement_ = descriptor.placement_; + text_ = descriptor.text_; + + return RETCODE_OK; +} + +bool VerbatimTextDescriptorImpl::equals( + traits::ref_type descriptor) noexcept +{ + return equals(*traits::narrow(descriptor)); +} + +bool VerbatimTextDescriptorImpl::equals( + VerbatimTextDescriptorImpl& descriptor) noexcept +{ + return placement_ == descriptor.placement_ && + text_ == descriptor.text_; +} + +bool VerbatimTextDescriptorImpl::is_consistent() noexcept +{ + //TODO + return true; +} + +} // namespace dds +} // namespace fastdds +} // namespace eprosima diff --git a/src/cpp/fastdds/xtypes/dynamic_types/common.hpp b/src/cpp/fastdds/xtypes/dynamic_types/common.hpp new file mode 100644 index 00000000000..f9ac3d31b02 --- /dev/null +++ b/src/cpp/fastdds/xtypes/dynamic_types/common.hpp @@ -0,0 +1,62 @@ +// Copyright 2024 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef FASTDDS_XTYPES_DYNAMIC_TYPES_COMMON_HPP +#define FASTDDS_XTYPES_DYNAMIC_TYPES_COMMON_HPP + +#include + +#include + +namespace eprosima { +namespace fastdds { +namespace dds { + +inline eprosima::fastcdr::EncodingAlgorithmFlag get_fastcdr_encoding_flag( + ExtensibilityKind ext_kind, + eprosima::fastcdr::CdrVersion cdr_version) +{ + eprosima::fastcdr::EncodingAlgorithmFlag ret_value {eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR}; + + if (eprosima::fastcdr::CdrVersion::XCDRv2 == cdr_version) + { + switch (ext_kind) + { + case ExtensibilityKind::MUTABLE: + ret_value = eprosima::fastcdr::EncodingAlgorithmFlag::PL_CDR2; + break; + case ExtensibilityKind::APPENDABLE: + ret_value = eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2; + break; + case ExtensibilityKind::FINAL: + ret_value = eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2; + break; + } + } + else + { + if (ExtensibilityKind::MUTABLE == ext_kind) + { + ret_value = eprosima::fastcdr::EncodingAlgorithmFlag::PL_CDR; + } + } + + return ret_value; +} + +} // namespace dds +} // namespace fastdds +} // namespace eprosima + +#endif // FASTDDS_XTYPES_DYNAMIC_TYPES_COMMON_HPP diff --git a/src/cpp/rtps/RTPSDomain.cpp b/src/cpp/rtps/RTPSDomain.cpp index 42881204e5d..2103a14f6e3 100644 --- a/src/cpp/rtps/RTPSDomain.cpp +++ b/src/cpp/rtps/RTPSDomain.cpp @@ -120,6 +120,9 @@ void RTPSDomainImpl::stopAll() instance->removeRTPSParticipant_nts(participant); lock.lock(); } + + xmlparser::XMLProfileManager::DeleteInstance(); + EPROSIMA_LOG_INFO(RTPS_PARTICIPANT, "RTPSParticipants deleted correctly "); std::this_thread::sleep_for(std::chrono::milliseconds(100)); } diff --git a/src/cpp/rtps/builtin/data/ReaderProxyData.cpp b/src/cpp/rtps/builtin/data/ReaderProxyData.cpp index e4b84b6b5db..884844d3b9d 100644 --- a/src/cpp/rtps/builtin/data/ReaderProxyData.cpp +++ b/src/cpp/rtps/builtin/data/ReaderProxyData.cpp @@ -288,11 +288,11 @@ uint32_t ReaderProxyData::get_serialized_size( ret_val += fastdds::dds::QosPoliciesSerializer::cdr_serialized_size( m_qos.m_disablePositiveACKs); } - if (m_type_id && m_type_id->m_type_identifier._d() != 0) + if (m_type_id && m_type_id->m_type_identifier._d() != fastdds::dds::xtypes::TK_NONE) { ret_val += fastdds::dds::QosPoliciesSerializer::cdr_serialized_size(*m_type_id); } - if (m_type && m_type->m_type_object._d() != 0) + if (m_type && m_type->m_type_object._d() != fastdds::dds::xtypes::TK_NONE) { ret_val += fastdds::dds::QosPoliciesSerializer::cdr_serialized_size(*m_type); } @@ -550,7 +550,7 @@ bool ReaderProxyData::writeToCDRMessage( } } - if (m_type_id && m_type_id->m_type_identifier._d() != 0) + if (m_type_id && m_type_id->m_type_identifier._d() != fastdds::dds::xtypes::TK_NONE) { if (!fastdds::dds::QosPoliciesSerializer::add_to_cdr_message(*m_type_id, msg)) { @@ -558,7 +558,7 @@ bool ReaderProxyData::writeToCDRMessage( } } - if (m_type && m_type->m_type_object._d() != 0) + if (m_type && m_type->m_type_object._d() != fastdds::dds::xtypes::TK_NONE) { if (!fastdds::dds::QosPoliciesSerializer::add_to_cdr_message(*m_type, msg)) { diff --git a/src/cpp/rtps/builtin/data/WriterProxyData.cpp b/src/cpp/rtps/builtin/data/WriterProxyData.cpp index b2e5a900d98..43deb3299df 100644 --- a/src/cpp/rtps/builtin/data/WriterProxyData.cpp +++ b/src/cpp/rtps/builtin/data/WriterProxyData.cpp @@ -296,11 +296,11 @@ uint32_t WriterProxyData::get_serialized_size( { ret_val += fastdds::dds::QosPoliciesSerializer::cdr_serialized_size(m_qos.m_groupData); } - if (m_type_id && m_type_id->m_type_identifier._d() != 0) + if (m_type_id && m_type_id->m_type_identifier._d() != fastdds::dds::xtypes::TK_NONE) { ret_val += fastdds::dds::QosPoliciesSerializer::cdr_serialized_size(*m_type_id); } - if (m_type && m_type->m_type_object._d() != 0) + if (m_type && m_type->m_type_object._d() != fastdds::dds::xtypes::TK_NONE) { ret_val += fastdds::dds::QosPoliciesSerializer::cdr_serialized_size(*m_type); } @@ -564,7 +564,7 @@ bool WriterProxyData::writeToCDRMessage( } } - if (m_type_id && m_type_id->m_type_identifier._d() != 0) + if (m_type_id && m_type_id->m_type_identifier._d() != fastdds::dds::xtypes::TK_NONE) { if (!fastdds::dds::QosPoliciesSerializer::add_to_cdr_message(*m_type_id, msg)) { @@ -572,7 +572,7 @@ bool WriterProxyData::writeToCDRMessage( } } - if (m_type && m_type->m_type_object._d() != 0) + if (m_type && m_type->m_type_object._d() != fastdds::dds::xtypes::TK_NONE) { if (!fastdds::dds::QosPoliciesSerializer::add_to_cdr_message(*m_type, msg)) { diff --git a/src/cpp/rtps/builtin/discovery/endpoint/EDP.cpp b/src/cpp/rtps/builtin/discovery/endpoint/EDP.cpp index 8d4310241d4..e19ee3b65e1 100644 --- a/src/cpp/rtps/builtin/discovery/endpoint/EDP.cpp +++ b/src/cpp/rtps/builtin/discovery/endpoint/EDP.cpp @@ -1380,7 +1380,6 @@ bool EDP::pairing_remote_writer_with_local_reader_after_security( { found = true; - // TODO(richiware) Implement and use move with attributes if (r.matched_writer_add(remote_writer_data)) { EPROSIMA_LOG_INFO(RTPS_EDP, "Valid Matching to local reader: " << readerGUID.entityId); diff --git a/src/cpp/rtps/builtin/discovery/participant/PDP.cpp b/src/cpp/rtps/builtin/discovery/participant/PDP.cpp index bf4ef84a7a7..3699f3fc6b4 100644 --- a/src/cpp/rtps/builtin/discovery/participant/PDP.cpp +++ b/src/cpp/rtps/builtin/discovery/participant/PDP.cpp @@ -41,8 +41,6 @@ #include #include -#include - #include #include diff --git a/src/cpp/rtps/history/History.cpp b/src/cpp/rtps/history/History.cpp index f2b12f971f7..8d87f2eab50 100644 --- a/src/cpp/rtps/history/History.cpp +++ b/src/cpp/rtps/history/History.cpp @@ -56,7 +56,7 @@ History::const_iterator History::find_change_nts( return std::find_if(changesBegin(), changesEnd(), [this, ch](const CacheChange_t* chi) { - // use the derived classes comparisson criteria for searching + // use the derived classes comparison criteria for searching return this->matches_change(chi, ch); }); } diff --git a/src/cpp/statistics/fastdds/domain/DomainParticipantImpl.hpp b/src/cpp/statistics/fastdds/domain/DomainParticipantImpl.hpp index eab1b53c11d..96333049707 100644 --- a/src/cpp/statistics/fastdds/domain/DomainParticipantImpl.hpp +++ b/src/cpp/statistics/fastdds/domain/DomainParticipantImpl.hpp @@ -25,6 +25,7 @@ #include +#include #include #include #include @@ -35,7 +36,6 @@ #include #include #include -#include #include diff --git a/src/cpp/xmlparser/XMLDynamicParser.cpp b/src/cpp/xmlparser/XMLDynamicParser.cpp index 416d40baf36..1625937b4f4 100644 --- a/src/cpp/xmlparser/XMLDynamicParser.cpp +++ b/src/cpp/xmlparser/XMLDynamicParser.cpp @@ -14,27 +14,117 @@ // #include +#include #include +#include +#include +#include #include #include #include #include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include #include #include +#include "../fastdds/xtypes/dynamic_types/AnnotationDescriptorImpl.hpp" +#include "../fastdds/xtypes/dynamic_types/DynamicTypeImpl.hpp" +#include "../fastdds/xtypes/dynamic_types/MemberDescriptorImpl.hpp" +#include "../fastdds/xtypes/dynamic_types/TypeDescriptorImpl.hpp" +using namespace eprosima::fastdds::dds; using namespace eprosima::fastrtps; using namespace eprosima::fastrtps::rtps; using namespace eprosima::fastrtps::xmlparser; +//{{{ Auxiliary constexpr function to get the length of a const char* in C++11. +constexpr size_t constexpr_strlen_rec( + const char* const str, + size_t length) +{ + return '\0' == str[length] ? length : constexpr_strlen_rec(str, length + 1); +} + +constexpr size_t constexpr_strlen( + const char* const str) +{ + return constexpr_strlen_rec(str, 0) + 1; +} + +//}}} + +// TYPES parser +constexpr const char* const BOOLEAN = "boolean"; +constexpr size_t BOOLEAN_len = constexpr_strlen(BOOLEAN); +constexpr const char* const CHAR = "char8"; +constexpr size_t CHAR_len = constexpr_strlen(CHAR); +constexpr const char* const WCHAR = "char16"; +constexpr size_t WCHAR_len = constexpr_strlen(WCHAR); +constexpr const char* const TBYTE = "byte"; +constexpr size_t TBYTE_len = constexpr_strlen(TBYTE); +constexpr const char* const OCTET = "octet"; +constexpr size_t OCTET_len = constexpr_strlen(OCTET); +constexpr const char* const UINT8 = "uint8"; +constexpr size_t UINT8_len = constexpr_strlen(UINT8); +constexpr const char* const INT8 = "int8"; +constexpr size_t INT8_len = constexpr_strlen(INT8); +constexpr const char* const SHORT = "int16"; +constexpr size_t SHORT_len = constexpr_strlen(SHORT); +constexpr const char* const LONG = "int32"; +constexpr size_t LONG_len = constexpr_strlen(LONG); +constexpr const char* const USHORT = "uint16"; +constexpr size_t USHORT_len = constexpr_strlen(USHORT); +constexpr const char* const ULONG = "uint32"; +constexpr size_t ULONG_len = constexpr_strlen(ULONG); +constexpr const char* const LONGLONG = "int64"; +constexpr size_t LONGLONG_len = constexpr_strlen(LONGLONG); +constexpr const char* const ULONGLONG = "uint64"; +constexpr size_t ULONGLONG_len = constexpr_strlen(ULONGLONG); +constexpr const char* const FLOAT = "float32"; +constexpr size_t FLOAT_len = constexpr_strlen(FLOAT); +constexpr const char* const DOUBLE = "float64"; +constexpr size_t DOUBLE_len = constexpr_strlen(DOUBLE); +constexpr const char* const LONGDOUBLE = "float128"; +constexpr size_t LONGDOUBLE_len = constexpr_strlen(LONGDOUBLE); +constexpr const char* const STRING = "string"; +constexpr size_t STRING_len = constexpr_strlen(STRING); +constexpr const char* const WSTRING = "wstring"; +constexpr size_t WSTRING_len = constexpr_strlen(WSTRING); +constexpr const char* const STRUCT = "struct"; +constexpr const char* const UNION = "union"; +constexpr const char* const TYPEDEF = "typedef"; +constexpr const char* const BITSET = "bitset"; +constexpr const char* const BITMASK = "bitmask"; +constexpr const char* const ENUM = "enum"; +constexpr const char* const CASE = "case"; +constexpr const char* const DEFAULT = "default"; +constexpr const char* const DISCRIMINATOR = "discriminator"; +constexpr const char* const CASE_DISCRIMINATOR = "caseDiscriminator"; +constexpr size_t CASE_DISCRIMINATOR_len = constexpr_strlen(CASE_DISCRIMINATOR); +constexpr const char* const ARRAY_DIMENSIONS = "arrayDimensions"; +constexpr const char* const STR_MAXLENGTH = "stringMaxLength"; +constexpr const char* const SEQ_MAXLENGTH = "sequenceMaxLength"; +constexpr const char* const MAP_MAXLENGTH = "mapMaxLength"; +constexpr const char* const MAP_KEY_TYPE = "key_type"; +constexpr const char* const ENUMERATOR = "enumerator"; +constexpr const char* const NON_BASIC_TYPE = "nonBasic"; +constexpr const char* const NON_BASIC_TYPE_NAME = "nonBasicTypeName"; +constexpr const char* const KEY = "key"; +constexpr const char* const MEMBER = "member"; +constexpr const char* const BITFIELD = "bitfield"; +constexpr const char* const BIT_VALUE = "bit_value"; +constexpr const char* const POSITION = "position"; +constexpr const char* const BIT_BOUND = "bit_bound"; +constexpr const char* const BASE_TYPE = "baseType"; + XMLP_ret XMLParser::parseXMLDynamicType( tinyxml2::XMLElement* p_root) { @@ -155,7 +245,7 @@ XMLP_ret XMLParser::parseXMLTypes( XMLP_ret XMLParser::parseXMLBitvalueDynamicType( tinyxml2::XMLElement* p_root, - p_dynamictypebuilder_t p_dynamictype, + DynamicTypeBuilder::_ref_type builder, uint16_t& field_position) { /* @@ -170,6 +260,12 @@ XMLP_ret XMLParser::parseXMLBitvalueDynamicType( return XMLP_ret::XML_ERROR; } + if (!builder) + { + EPROSIMA_LOG_ERROR(XMLPARSER, "Error parsing bitmask: builder is nil."); + return XMLP_ret::XML_ERROR; + } + const char* memberName = p_root->Attribute(NAME); const char* position = p_root->Attribute(POSITION); @@ -186,27 +282,25 @@ XMLP_ret XMLParser::parseXMLBitvalueDynamicType( } } - if (memberName == nullptr && p_dynamictype != nullptr) + if (memberName == nullptr) { EPROSIMA_LOG_ERROR(XMLPARSER, "Error parsing bit_value name: Not found."); return XMLP_ret::XML_ERROR; } - p_dynamictype->add_empty_member(field_position, memberName); - //p_dynamictype->apply_annotation_to_member( - // p_dynamictype->get_member_id_by_name(memberName), ANNOTATION_POSITION_ID, "value", position); + MemberDescriptor::_ref_type md {traits::make_shared()}; + md->id(field_position); + md->name(memberName); + md->type(DynamicTypeBuilderFactory::get_instance()->get_primitive_type(TK_BOOLEAN)); + builder->add_member(md); ++field_position; return XMLP_ret::XML_OK; } -static p_dynamictypebuilder_t getDiscriminatorTypeBuilder( +static DynamicType::_ref_type getDiscriminatorTypeBuilder( const std::string& disc, - uint32_t bound = 0); - -static p_dynamictypebuilder_t getDiscriminatorTypeBuilder( - const std::string& disc, - uint32_t bound) + uint32_t bound = 0) { /* mKind == TK_BOOLEAN || mKind == TK_BYTE || mKind == TK_INT16 || mKind == TK_INT32 || @@ -214,72 +308,80 @@ static p_dynamictypebuilder_t getDiscriminatorTypeBuilder( mKind == TK_FLOAT32 || mKind == TK_FLOAT64 || mKind == TK_FLOAT128 || mKind == TK_CHAR8 || mKind == TK_CHAR16 || mKind == TK_STRING8 || mKind == TK_STRING16 || mKind == TK_ENUM || mKind == TK_BITMASK */ - types::DynamicTypeBuilderFactory* factory = types::DynamicTypeBuilderFactory::get_instance(); - if (disc.compare(BOOLEAN) == 0) + auto factory = DynamicTypeBuilderFactory::get_instance(); + if (0 == disc.compare(BOOLEAN)) { - return factory->create_bool_builder(); + return factory->get_primitive_type(TK_BOOLEAN); } - else if (disc.compare(TBYTE) == 0 - || disc.compare(OCTET) == 0 - || disc.compare(INT8) == 0 - || disc.compare(UINT8) == 0) + else if (0 == disc.compare(TBYTE) || + 0 == disc.compare(OCTET)) { - return factory->create_byte_builder(); + return factory->get_primitive_type(TK_BYTE); } - else if (disc.compare(SHORT) == 0) + else if (0 == disc.compare(INT8)) { - return factory->create_int16_builder(); + return factory->get_primitive_type(TK_INT8); } - else if (disc.compare(LONG) == 0) + else if (0 == disc.compare(UINT8)) { - return factory->create_int32_builder(); + return factory->get_primitive_type(TK_UINT8); } - else if (disc.compare(LONGLONG) == 0) + else if (0 == disc.compare(SHORT)) { - return factory->create_int64_builder(); + return factory->get_primitive_type(TK_INT16); } - else if (disc.compare(USHORT) == 0) + else if (0 == disc.compare(LONG)) { - return factory->create_uint16_builder(); + return factory->get_primitive_type(TK_INT32); } - else if (disc.compare(ULONG) == 0) + else if (0 == disc.compare(LONGLONG)) { - return factory->create_uint32_builder(); + return factory->get_primitive_type(TK_INT64); } - else if (disc.compare(ULONGLONG) == 0) + else if (0 == disc.compare(USHORT)) { - return factory->create_uint64_builder(); + return factory->get_primitive_type(TK_UINT16); } - else if (disc.compare(FLOAT) == 0) + else if (0 == disc.compare(ULONG)) { - return factory->create_float32_builder(); + return factory->get_primitive_type(TK_UINT32); } - else if (disc.compare(DOUBLE) == 0) + else if (0 == disc.compare(ULONGLONG)) { - return factory->create_float64_builder(); + return factory->get_primitive_type(TK_UINT64); } - else if (disc.compare(LONGDOUBLE) == 0) + else if (0 == disc.compare(FLOAT)) { - return factory->create_float128_builder(); + return factory->get_primitive_type(TK_FLOAT32); } - else if (disc.compare(CHAR) == 0) + else if (0 == disc.compare(DOUBLE)) { - return factory->create_char8_builder(); + return factory->get_primitive_type(TK_FLOAT64); } - else if (disc.compare(WCHAR) == 0) + else if (0 == disc.compare(LONGDOUBLE)) { - return factory->create_char16_builder(); + return factory->get_primitive_type(TK_FLOAT128); } - else if (disc.compare(STRING) == 0) + else if (0 == disc.compare(CHAR)) { - return factory->create_string_builder(bound); + return factory->get_primitive_type(TK_CHAR8); } - else if (disc.compare(WSTRING) == 0) + else if (0 == disc.compare(WCHAR)) { - return factory->create_wstring_builder(bound); + return factory->get_primitive_type(TK_CHAR16); + } + else if (0 == disc.compare(STRING)) + { + return factory->create_string_type(0 == bound ? static_cast(LENGTH_UNLIMITED) : bound)->build(); + } + else if (0 == disc.compare(WSTRING)) + { + return factory->create_wstring_type(0 == bound ? static_cast(LENGTH_UNLIMITED) : bound)->build(); } - return XMLProfileManager::getDynamicTypeByName(disc); + DynamicType::_ref_type ret; + XMLProfileManager::getDynamicTypeByName(ret, disc); + return ret; } XMLP_ret XMLParser::parseXMLAliasDynamicType( @@ -319,12 +421,12 @@ XMLP_ret XMLParser::parseXMLAliasDynamicType( } } - p_dynamictypebuilder_t valueBuilder; + DynamicType::_ref_type value_type; if ((p_root->Attribute(ARRAY_DIMENSIONS) != nullptr) || (p_root->Attribute(SEQ_MAXLENGTH) != nullptr) || (p_root->Attribute(MAP_MAXLENGTH) != nullptr)) { - valueBuilder = parseXMLMemberDynamicType(p_root, nullptr, types::MEMBER_ID_INVALID); + value_type = parseXMLMemberDynamicType(p_root); } else { @@ -332,19 +434,24 @@ XMLP_ret XMLParser::parseXMLAliasDynamicType( const char* boundStr = p_root->Attribute(STR_MAXLENGTH); if (boundStr != nullptr) { - bound = static_cast(std::atoi(boundStr)); + bound = static_cast(std::stoul(boundStr)); } - valueBuilder = getDiscriminatorTypeBuilder(type, bound); + value_type = getDiscriminatorTypeBuilder(type, bound); } - if (valueBuilder != nullptr) + if (value_type) { const char* name = p_root->Attribute(NAME); if (name != nullptr) { - p_dynamictypebuilder_t typeBuilder = - types::DynamicTypeBuilderFactory::get_instance()->create_alias_builder(valueBuilder, name); - XMLProfileManager::insertDynamicTypeByName(name, typeBuilder); + + TypeDescriptor::_ref_type alias_descriptor {traits::make_shared()}; + alias_descriptor->kind(TK_ALIAS); + alias_descriptor->name(name); + alias_descriptor->base_type(value_type); + DynamicTypeBuilder::_ref_type builder {DynamicTypeBuilderFactory::get_instance()->create_type( + alias_descriptor)}; + XMLProfileManager::insertDynamicTypeByName(name, builder->build()); } else { @@ -389,8 +496,6 @@ XMLP_ret XMLParser::parseXMLBitsetDynamicType( */ XMLP_ret ret = XMLP_ret::XML_OK; - p_dynamictypebuilder_t typeBuilder; - uint32_t mId = 0; const char* name = p_root->Attribute(NAME); if (nullptr == name) @@ -399,13 +504,40 @@ XMLP_ret XMLParser::parseXMLBitsetDynamicType( return XMLP_ret::XML_ERROR; } + TypeDescriptor::_ref_type bitset_descriptor {traits::make_shared()}; + bitset_descriptor->kind(TK_BITSET); + bitset_descriptor->name(name); + + //{{{ Retrieve bounds + for (tinyxml2::XMLElement* p_element = p_root->FirstChildElement(); + p_element != nullptr; p_element = p_element->NextSiblingElement()) + { + const char* member_name = p_element->Attribute(NAME); + const char* bit_bound = p_element->Attribute(BIT_BOUND); + + if (bit_bound == nullptr) + { + EPROSIMA_LOG_ERROR(XMLPARSER, "Error parsing bitfield bit_bound: Not found."); + return XMLP_ret::XML_ERROR; + } + + if (nullptr != member_name) + { + bitset_descriptor->bound().push_back(static_cast(std::stoul(bit_bound))); + } + } + //}}} + const char* baseType = p_root->Attribute(BASE_TYPE); if (baseType != nullptr) { - p_dynamictypebuilder_t parentType = XMLProfileManager::getDynamicTypeByName(baseType); - if (parentType != nullptr && parentType->get_kind() == eprosima::fastdds::dds::xtypes::TK_BITSET) + DynamicType::_ref_type parent_type; + XMLProfileManager::getDynamicTypeByName(parent_type, baseType); + if (parent_type && (TK_BITSET == parent_type->get_kind() || + TK_BITSET == + traits::narrow(parent_type)->resolve_alias_enclosed_type()->get_kind())) { - typeBuilder = types::DynamicTypeBuilderFactory::get_instance()->create_child_struct_builder(parentType); + bitset_descriptor->base_type(parent_type); } else { @@ -413,25 +545,19 @@ XMLP_ret XMLParser::parseXMLBitsetDynamicType( return XMLP_ret::XML_ERROR; } } - else - { - typeBuilder = types::DynamicTypeBuilderFactory::get_instance()->create_bitset_builder(); - } - typeBuilder->set_name(name); - const char* element_name = nullptr; - uint16_t position = 0; + DynamicTypeBuilder::_ref_type type_builder = + DynamicTypeBuilderFactory::get_instance()->create_type(bitset_descriptor); + + const char* element_name {nullptr}; + MemberId position {0}; for (tinyxml2::XMLElement* p_element = p_root->FirstChildElement(); p_element != nullptr; p_element = p_element->NextSiblingElement()) { element_name = p_element->Name(); if (strcmp(element_name, BITFIELD) == 0) { - p_dynamictypebuilder_t mType = parseXMLBitfieldDynamicType(p_element, typeBuilder, mId++, position); - if (mType == nullptr) - { - return XMLP_ret::XML_ERROR; - } + ret = parseXMLBitfieldDynamicType(p_element, type_builder, position); } else { @@ -440,15 +566,18 @@ XMLP_ret XMLParser::parseXMLBitsetDynamicType( } } - XMLProfileManager::insertDynamicTypeByName(name, typeBuilder); + if (XMLP_ret::XML_OK == ret) + { + XMLProfileManager::insertDynamicTypeByName(name, type_builder->build()); + } + return ret; } -p_dynamictypebuilder_t XMLParser::parseXMLBitfieldDynamicType( +XMLP_ret XMLParser::parseXMLBitfieldDynamicType( tinyxml2::XMLElement* p_root, - p_dynamictypebuilder_t p_dynamictype, - types::MemberId mId, - uint16_t& position) + DynamicTypeBuilder::_ref_type builder, + MemberId& position) { /* @@ -460,135 +589,130 @@ p_dynamictypebuilder_t XMLParser::parseXMLBitfieldDynamicType( if (p_root == nullptr) { EPROSIMA_LOG_ERROR(XMLPARSER, "Error parsing bitfield: Node not found."); - return nullptr; + return XMLP_ret::XML_ERROR; + } + + if (!builder) + { + EPROSIMA_LOG_ERROR(XMLPARSER, "Error parsing bitfield: builder is nil."); + return XMLP_ret::XML_ERROR; } const char* memberType = p_root->Attribute(TYPE); const char* memberName = p_root->Attribute(NAME); const char* bit_bound = p_root->Attribute(BIT_BOUND); - if (bit_bound == nullptr && p_dynamictype != nullptr) + if (bit_bound == nullptr) { EPROSIMA_LOG_ERROR(XMLPARSER, "Error parsing bitfield bit_bound: Not found."); - return nullptr; + return XMLP_ret::XML_ERROR; } - if (memberName == nullptr) + DynamicType::_ref_type member_type; + DynamicTypeBuilderFactory::_ref_type factory = DynamicTypeBuilderFactory::get_instance(); + uint32_t size {0}; + + try { - memberName = ""; + size = static_cast(std::stoul(bit_bound)); + } + catch (...) + { + EPROSIMA_LOG_ERROR(XMLPARSER, "Failed creating bitfield, invalid bit_bound (must be an unsigned short): " + << bit_bound); + return XMLP_ret::XML_ERROR; } - - types::DynamicTypeBuilder* memberBuilder = nullptr; - types::DynamicTypeBuilderFactory* factory = types::DynamicTypeBuilderFactory::get_instance(); if (memberType == nullptr) { - try + if (1 == size) { - uint16_t size = static_cast(std::stoul(bit_bound)); - if (size == 1) - { - memberType = BOOLEAN; - } - else if (size <= 8) - { - memberType = CHAR; - } - else if (size <= 16) - { - memberType = USHORT; - } - else if (size <= 32) - { - memberType = ULONG; - } - else if (size <= 64) - { - memberType = ULONGLONG; - } - else - { - EPROSIMA_LOG_ERROR(XMLPARSER, "Failed creating bitfield, size too big: " << bit_bound); - return nullptr; - } + memberType = BOOLEAN; } - catch (...) + else if (9 > size) { - EPROSIMA_LOG_ERROR(XMLPARSER, "Failed creating bitfield, invalid bit_bound (must be an unsigned short): " - << bit_bound); - return nullptr; + memberType = UINT8; + } + else if (17 > size) + { + memberType = USHORT; + } + else if (33 > size) + { + memberType = ULONG; + } + else if (65 > size) + { + memberType = ULONGLONG; + } + else + { + EPROSIMA_LOG_ERROR(XMLPARSER, "Failed creating bitfield, size too big: " << bit_bound); + return XMLP_ret::XML_ERROR; } } - if (strncmp(memberType, BOOLEAN, 8) == 0) - { - memberBuilder = factory->create_bool_builder(); - } - else if (strncmp(memberType, CHAR, 5) == 0) - { - memberBuilder = factory->create_char8_builder(); - } - else if (strncmp(memberType, WCHAR, 6) == 0) - { - memberBuilder = factory->create_char16_builder(); - } - else if (strncmp(memberType, TBYTE, 6) == 0 - || strncmp(memberType, OCTET, 6) == 0 - || strncmp(memberType, UINT8, 6) == 0 - || strncmp(memberType, INT8, 5) == 0) - { - memberBuilder = factory->create_byte_builder(); - } - else if (strncmp(memberType, SHORT, 6) == 0) - { - memberBuilder = factory->create_int16_builder(); - } - else if (strncmp(memberType, LONG, 5) == 0) - { - memberBuilder = factory->create_int32_builder(); - } - else if (strncmp(memberType, ULONG, 13) == 0) - { - memberBuilder = factory->create_uint32_builder(); - } - else if (strncmp(memberType, USHORT, 14) == 0) - { - memberBuilder = factory->create_uint16_builder(); - } - else if (strncmp(memberType, LONGLONG, 9) == 0) - { - memberBuilder = factory->create_int64_builder(); - } - else if (strncmp(memberType, ULONGLONG, 17) == 0) - { - memberBuilder = factory->create_uint64_builder(); - } - else // Unsupported type? - { - EPROSIMA_LOG_ERROR(XMLPARSER, - "Failed creating bitfield " << memberName << ": Type " << memberType << " unsupported."); - } - - - if (memberBuilder == nullptr) + if (nullptr != memberName) { - EPROSIMA_LOG_ERROR(XMLPARSER, "Failed creating " << memberType << ": " << memberName); - } - if (p_dynamictype != nullptr) - { - p_dynamictype->add_member(mId, memberName, memberBuilder); - if (!std::string(memberName).empty()) + if (0 == strncmp(memberType, BOOLEAN, BOOLEAN_len)) + { + member_type = factory->get_primitive_type(TK_BOOLEAN); + } + else if (0 == strncmp(memberType, TBYTE, TBYTE_len) + || 0 == strncmp(memberType, OCTET, 6)) + { + member_type = factory->get_primitive_type(TK_BYTE); + } + else if (0 == strncmp(memberType, INT8, INT8_len)) + { + member_type = factory->get_primitive_type(TK_INT8); + } + else if (0 == strncmp(memberType, UINT8, UINT8_len)) { - p_dynamictype->apply_annotation_to_member(mId, types::ANNOTATION_BIT_BOUND_ID, "value", bit_bound); - //position += static_cast(mId); - p_dynamictype->apply_annotation_to_member(mId, types::ANNOTATION_POSITION_ID, "value", - std::to_string(position)); + member_type = factory->get_primitive_type(TK_UINT8); } - position += static_cast(atoi(bit_bound)); + else if (0 == strncmp(memberType, SHORT, SHORT_len)) + { + member_type = factory->get_primitive_type(TK_INT16); + } + else if (0 == strncmp(memberType, LONG, LONG_len)) + { + member_type = factory->get_primitive_type(TK_INT32); + } + else if (0 == strncmp(memberType, ULONG, ULONG_len)) + { + member_type = factory->get_primitive_type(TK_UINT32); + } + else if (0 == strncmp(memberType, USHORT, USHORT_len)) + { + member_type = factory->get_primitive_type(TK_UINT16); + } + else if (0 == strncmp(memberType, LONGLONG, LONGLONG_len)) + { + member_type = factory->get_primitive_type(TK_INT64); + } + else if (0 == strncmp(memberType, ULONGLONG, ULONGLONG_len)) + { + member_type = factory->get_primitive_type(TK_UINT64); + } + else // Unsupported type + { + EPROSIMA_LOG_ERROR(XMLPARSER, + "Failed creating bitfield " << memberName << ": Type " << memberType << " unsupported."); + return XMLP_ret::XML_ERROR; + } + + MemberDescriptor::_ref_type md {traits::make_shared()}; + md->id(position); + md->name(memberName); + md->type(member_type); + builder->add_member(md); } - return memberBuilder; + position += size; + + return XMLP_ret::XML_OK; } XMLP_ret XMLParser::parseXMLBitmaskDynamicType( @@ -628,9 +752,13 @@ XMLP_ret XMLParser::parseXMLBitmaskDynamicType( { return XMLP_ret::XML_ERROR; } - p_dynamictypebuilder_t typeBuilder = - types::DynamicTypeBuilderFactory::get_instance()->create_bitmask_builder(bit_bound); - typeBuilder->set_name(name); + TypeDescriptor::_ref_type bitmask_descriptor {traits::make_shared()}; + bitmask_descriptor->kind(TK_BITMASK); + bitmask_descriptor->name(name); + bitmask_descriptor->element_type(DynamicTypeBuilderFactory::get_instance()->get_primitive_type(TK_BOOLEAN)); + bitmask_descriptor->bound().push_back(bit_bound); + DynamicTypeBuilder::_ref_type type_builder { + DynamicTypeBuilderFactory::get_instance()->create_type(bitmask_descriptor)}; uint16_t position = 0; const char* element_name = nullptr; @@ -640,7 +768,7 @@ XMLP_ret XMLParser::parseXMLBitmaskDynamicType( element_name = p_element->Name(); if (strcmp(element_name, BIT_VALUE) == 0) { - if (parseXMLBitvalueDynamicType(p_element, typeBuilder, position) != XMLP_ret::XML_OK) + if (parseXMLBitvalueDynamicType(p_element, type_builder, position) != XMLP_ret::XML_OK) { return XMLP_ret::XML_ERROR; } @@ -652,7 +780,7 @@ XMLP_ret XMLParser::parseXMLBitmaskDynamicType( } } - XMLProfileManager::insertDynamicTypeByName(name, typeBuilder); + XMLProfileManager::insertDynamicTypeByName(name, type_builder->build()); return ret; } @@ -683,8 +811,13 @@ XMLP_ret XMLParser::parseXMLEnumDynamicType( return XMLP_ret::XML_ERROR; } - p_dynamictypebuilder_t typeBuilder = types::DynamicTypeBuilderFactory::get_instance()->create_enum_builder(); - uint32_t currValue = 0; + + TypeDescriptor::_ref_type enum_descriptor {traits::make_shared()}; + enum_descriptor->kind(TK_ENUM); + enum_descriptor->name(enumName); + DynamicTypeBuilder::_ref_type type_builder {DynamicTypeBuilderFactory::get_instance()->create_type( + enum_descriptor)}; + for (tinyxml2::XMLElement* literal = p_root->FirstChildElement(ENUMERATOR); literal != nullptr; literal = literal->NextSiblingElement(ENUMERATOR)) { @@ -695,15 +828,20 @@ XMLP_ret XMLParser::parseXMLEnumDynamicType( return XMLP_ret::XML_ERROR; } + MemberDescriptor::_ref_type md {traits::make_shared()}; + md->type(DynamicTypeBuilderFactory::get_instance()->get_primitive_type(TK_UINT32)); + md->name(name); + const char* value = literal->Attribute(VALUE); if (value != nullptr) { - currValue = static_cast(std::atoi(value)); + md->default_value(value); } - typeBuilder->add_empty_member(currValue++, name); + + type_builder->add_member(md); } - XMLProfileManager::insertDynamicTypeByName(enumName, typeBuilder); + XMLProfileManager::insertDynamicTypeByName(enumName, type_builder->build()); return ret; } @@ -722,24 +860,30 @@ XMLP_ret XMLParser::parseXMLStructDynamicType( */ XMLP_ret ret = XMLP_ret::XML_OK; + MemberId mId{0}; const char* name = p_root->Attribute(NAME); + if (nullptr == name || name[0] == '\0') { EPROSIMA_LOG_ERROR(XMLPARSER, "Missing required attribute 'name' in 'structDcl'."); return XMLP_ret::XML_ERROR; } - p_dynamictypebuilder_t typeBuilder; // = types::DynamicTypeBuilderFactory::get_instance()->create_struct_builder(); - //typeBuilder->set_name(name); - uint32_t mId = 0; + TypeDescriptor::_ref_type structure_descriptor {traits::make_shared()}; + structure_descriptor->kind(TK_STRUCTURE); + structure_descriptor->name(name); const char* baseType = p_root->Attribute(BASE_TYPE); if (baseType != nullptr) { - p_dynamictypebuilder_t parentType = XMLProfileManager::getDynamicTypeByName(baseType); - if (parentType != nullptr && parentType->get_kind() == eprosima::fastdds::dds::xtypes::TK_STRUCTURE) + DynamicType::_ref_type parent_type; + XMLProfileManager::getDynamicTypeByName(parent_type, baseType); + + if (parent_type && (TK_STRUCTURE == parent_type->get_kind() || + TK_STRUCTURE == + traits::narrow(parent_type)->resolve_alias_enclosed_type()->get_kind())) { - typeBuilder = types::DynamicTypeBuilderFactory::get_instance()->create_child_struct_builder(parentType); + structure_descriptor->base_type(parent_type); } else { @@ -747,11 +891,9 @@ XMLP_ret XMLParser::parseXMLStructDynamicType( return XMLP_ret::XML_ERROR; } } - else - { - typeBuilder = types::DynamicTypeBuilderFactory::get_instance()->create_struct_builder(); - } - typeBuilder->set_name(name); + + DynamicTypeBuilder::_ref_type type_builder = DynamicTypeBuilderFactory::get_instance()->create_type( + structure_descriptor); const char* element_name = nullptr; for (tinyxml2::XMLElement* p_element = p_root->FirstChildElement(); @@ -760,8 +902,7 @@ XMLP_ret XMLParser::parseXMLStructDynamicType( element_name = p_element->Name(); if (strcmp(element_name, MEMBER) == 0) { - p_dynamictypebuilder_t mType = parseXMLMemberDynamicType(p_element, typeBuilder, mId++); - if (mType == nullptr) + if (!parseXMLMemberDynamicType(p_element, type_builder, mId++)) { return XMLP_ret::XML_ERROR; } @@ -773,7 +914,7 @@ XMLP_ret XMLParser::parseXMLStructDynamicType( } } - XMLProfileManager::insertDynamicTypeByName(name, typeBuilder); + XMLProfileManager::insertDynamicTypeByName(name, type_builder->build()); return ret; } @@ -808,8 +949,8 @@ XMLP_ret XMLParser::parseXMLUnionDynamicType( if (p_element != nullptr) { const char* disc = p_element->Attribute(TYPE); - p_dynamictypebuilder_t discriminator = getDiscriminatorTypeBuilder(disc); - if (discriminator == nullptr) + DynamicType::_ref_type disc_type = getDiscriminatorTypeBuilder(disc); + if (!disc_type) { EPROSIMA_LOG_ERROR(XMLPARSER, "Error parsing union discriminator: Only primitive types allowed (found type " << disc << ")."); @@ -817,11 +958,14 @@ XMLP_ret XMLParser::parseXMLUnionDynamicType( } else { - p_dynamictypebuilder_t typeBuilder = types::DynamicTypeBuilderFactory::get_instance()->create_union_builder( - discriminator); - typeBuilder->set_name(name); + TypeDescriptor::_ref_type union_descriptor {traits::make_shared()}; + union_descriptor->kind(TK_UNION); + union_descriptor->name(name); + union_descriptor->discriminator_type(disc_type); + DynamicTypeBuilder::_ref_type type_builder {DynamicTypeBuilderFactory::get_instance()-> + create_type(union_descriptor)}; - uint32_t mId = 0; + MemberId mId{1}; for (p_element = p_root->FirstChildElement(CASE); p_element != nullptr; p_element = p_element->NextSiblingElement(CASE)) { @@ -847,15 +991,14 @@ XMLP_ret XMLParser::parseXMLUnionDynamicType( } tinyxml2::XMLElement* caseElement = p_element->FirstChildElement(); - while (caseElement != nullptr && strncmp(caseElement->Value(), CASE_DISCRIMINATOR, 10) == 0) + while (caseElement != nullptr && + strncmp(caseElement->Value(), CASE_DISCRIMINATOR, CASE_DISCRIMINATOR_len) == 0) { caseElement = caseElement->NextSiblingElement(); } if (caseElement != nullptr) { - p_dynamictypebuilder_t mType = parseXMLMemberDynamicType - (caseElement, typeBuilder, mId++, valuesStr); - if (mType == nullptr) + if (!parseXMLMemberDynamicType(caseElement, type_builder, mId++, valuesStr)) { return XMLP_ret::XML_ERROR; } @@ -867,7 +1010,7 @@ XMLP_ret XMLParser::parseXMLUnionDynamicType( } } - XMLProfileManager::insertDynamicTypeByName(name, typeBuilder); + XMLProfileManager::insertDynamicTypeByName(name, type_builder->build()); } } else @@ -896,7 +1039,7 @@ static void dimensionsToArrayBounds( static bool dimensionsToLabels( const std::string& labelStr, - std::vector& labels) + UnionCaseLabelSeq& labels) { std::stringstream ss(labelStr); std::string item; @@ -911,26 +1054,15 @@ static bool dimensionsToLabels( } else { - labels.push_back(static_cast(std::atoi(item.c_str()))); + labels.push_back(static_cast(std::stol(item.c_str()))); } } return def; } -p_dynamictypebuilder_t XMLParser::parseXMLMemberDynamicType( - tinyxml2::XMLElement* p_root, - p_dynamictypebuilder_t p_dynamictype, - types::MemberId mId) -{ - return parseXMLMemberDynamicType(p_root, p_dynamictype, mId, ""); -} - -p_dynamictypebuilder_t XMLParser::parseXMLMemberDynamicType( - tinyxml2::XMLElement* p_root, - p_dynamictypebuilder_t p_dynamictype, - types::MemberId mId, - const std::string& values) +DynamicType::_ref_type XMLParser:: parseXMLMemberDynamicType( + tinyxml2::XMLElement* p_root) { /* @@ -948,23 +1080,23 @@ p_dynamictypebuilder_t XMLParser::parseXMLMemberDynamicType( if (p_root == nullptr) { EPROSIMA_LOG_ERROR(XMLPARSER, "Error parsing member: Node not found."); - return nullptr; + return {}; } const char* memberType = p_root->Attribute(TYPE); const char* memberName = p_root->Attribute(NAME); bool isArray = false; - if (memberName == nullptr && p_dynamictype != nullptr) + if (memberName == nullptr) { EPROSIMA_LOG_ERROR(XMLPARSER, "Error parsing member name: Not found."); - return nullptr; + return {}; } if (memberType == nullptr) { EPROSIMA_LOG_ERROR(XMLPARSER, "Error parsing member type: Not found."); - return nullptr; + return {}; } const char* memberArray = p_root->Attribute(ARRAY_DIMENSIONS); @@ -983,12 +1115,12 @@ p_dynamictypebuilder_t XMLParser::parseXMLMemberDynamicType( else { EPROSIMA_LOG_ERROR(XMLPARSER, "Error parsing member type: Not found."); - return nullptr; + return {}; } } - types::DynamicTypeBuilder* memberBuilder = nullptr; - types::DynamicTypeBuilderFactory* factory = types::DynamicTypeBuilderFactory::get_instance(); + DynamicType::_ref_type member; + DynamicTypeBuilderFactory::_ref_type factory {DynamicTypeBuilderFactory::get_instance()}; const char* memberSequence = p_root->Attribute(SEQ_MAXLENGTH); if (memberSequence != nullptr) @@ -1001,39 +1133,34 @@ p_dynamictypebuilder_t XMLParser::parseXMLMemberDynamicType( In this example, inner sequence's name is ignored and can be omited. */ - p_dynamictypebuilder_t contentType = getDiscriminatorTypeBuilder(memberType); - if (contentType == nullptr) + DynamicType::_ref_type content_type {getDiscriminatorTypeBuilder(memberType)}; + if (!content_type) { EPROSIMA_LOG_ERROR(XMLPARSER, "Error parsing sequence element type: Cannot be recognized: " << memberType); - return nullptr; + return {}; } - const char* lengthStr = p_root->Attribute(SEQ_MAXLENGTH); - uint32_t length = types::MAX_ELEMENTS_COUNT; - if (lengthStr != nullptr) + uint32_t length {0}; + try { - try - { - length = static_cast(std::stoi(lengthStr)); - } - catch (const std::exception&) - { - EPROSIMA_LOG_ERROR(XMLPARSER, "Error parsing member sequence length in line " << p_root->GetLineNum()); - return nullptr; - } + length = static_cast(std::stoul(memberSequence)); + } + catch (const std::exception&) + { + EPROSIMA_LOG_ERROR(XMLPARSER, "Error parsing member sequence length in line " << p_root->GetLineNum()); + return {}; } if (!isArray) { - memberBuilder = factory->create_sequence_builder(contentType, length); + member = factory->create_sequence_type(content_type, length)->build(); } else { - types::DynamicTypeBuilder* innerBuilder = factory->create_sequence_builder(contentType, length); + DynamicTypeBuilder::_ref_type inner_builder {factory->create_sequence_type(content_type, length)}; std::vector bounds; dimensionsToArrayBounds(memberArray, bounds); - memberBuilder = factory->create_array_builder(innerBuilder, bounds); - //factory->DeleteBuilder(innerBuilder); + member = factory->create_array_type(inner_builder->build(), bounds)->build(); } } else if (p_root->Attribute(MAP_MAXLENGTH) != nullptr) @@ -1058,329 +1185,363 @@ p_dynamictypebuilder_t XMLParser::parseXMLMemberDynamicType( // Parse key //const char* keyType = p_root->Attribute(KEY); - p_dynamictypebuilder_t keyTypeBuilder = nullptr; + DynamicType::_ref_type key_type; const char* memberMapKeyType = p_root->Attribute(MAP_KEY_TYPE); if (memberMapKeyType != nullptr) { - keyTypeBuilder = getDiscriminatorTypeBuilder(memberMapKeyType); - if (keyTypeBuilder == nullptr) + key_type = getDiscriminatorTypeBuilder(memberMapKeyType); + if (!key_type) { EPROSIMA_LOG_ERROR(XMLPARSER, "Error parsing map's key element type: Cannot be recognized."); - return nullptr; + return {}; } } else { EPROSIMA_LOG_ERROR(XMLPARSER, "Error parsing key_type element: Not found."); - return nullptr; + return {}; } // Parse value - p_dynamictypebuilder_t valueTypeBuilder; + DynamicType::_ref_type value_type; if (memberType != nullptr) { - valueTypeBuilder = getDiscriminatorTypeBuilder(memberType); - if (valueTypeBuilder == nullptr) + value_type = getDiscriminatorTypeBuilder(memberType); + if (!value_type) { EPROSIMA_LOG_ERROR(XMLPARSER, "Error parsing map's value element type: Cannot be recognized."); - return nullptr; + return {}; } } else { EPROSIMA_LOG_ERROR(XMLPARSER, "Error parsing value_value element: Not found."); - return nullptr; + return {}; } const char* lengthStr = p_root->Attribute(MAP_MAXLENGTH); - uint32_t length = types::MAX_ELEMENTS_COUNT; - if (lengthStr != nullptr) + uint32_t length {0}; + try { - try - { - length = static_cast(std::stoi(lengthStr)); - } - catch (const std::exception&) - { - EPROSIMA_LOG_ERROR(XMLPARSER, - "Error parsing map member sequence length in line " << p_root->GetLineNum()); - return nullptr; - } + length = static_cast(std::stoul(lengthStr)); + } + catch (const std::exception&) + { + EPROSIMA_LOG_ERROR(XMLPARSER, + "Error parsing map member sequence length in line " << p_root->GetLineNum()); + return {}; } if (!isArray) { - memberBuilder = factory->create_map_builder(keyTypeBuilder, valueTypeBuilder, length); + member = factory->create_map_type(key_type, value_type, length)->build(); } else { - types::DynamicTypeBuilder* innerBuilder = - factory->create_map_builder(keyTypeBuilder, valueTypeBuilder, length); + DynamicTypeBuilder::_ref_type inner_builder {factory->create_map_type(key_type, value_type, + length)}; std::vector bounds; dimensionsToArrayBounds(memberArray, bounds); - memberBuilder = factory->create_array_builder(innerBuilder, bounds); - //factory->DeleteBuilder(innerBuilder); + member = factory->create_array_type( + inner_builder->build(), + bounds)->build(); } } - else if (strncmp(memberType, BOOLEAN, 8) == 0) + else if (strncmp(memberType, BOOLEAN, BOOLEAN_len) == 0) { if (!isArray) { - memberBuilder = factory->create_bool_builder(); + member = factory->get_primitive_type(TK_BOOLEAN); } else { - types::DynamicTypeBuilder* innerBuilder = factory->create_bool_builder(); std::vector bounds; dimensionsToArrayBounds(memberArray, bounds); - memberBuilder = factory->create_array_builder(innerBuilder, bounds); - //factory->DeleteBuilder(innerBuilder); + member = factory->create_array_type( + factory->get_primitive_type(TK_BOOLEAN), + bounds)->build(); } } - else if (strncmp(memberType, CHAR, 5) == 0) + else if (strncmp(memberType, CHAR, CHAR_len) == 0) { if (!isArray) { - memberBuilder = factory->create_char8_builder(); + member = factory->get_primitive_type(TK_CHAR8); } else { - types::DynamicTypeBuilder* innerBuilder = factory->create_char8_builder(); std::vector bounds; dimensionsToArrayBounds(memberArray, bounds); - memberBuilder = factory->create_array_builder(innerBuilder, bounds); - //factory->DeleteBuilder(innerBuilder); + member = factory->create_array_type( + factory->get_primitive_type(TK_CHAR8), + bounds)->build(); } } - else if (strncmp(memberType, WCHAR, 6) == 0) + else if (strncmp(memberType, WCHAR, WCHAR_len) == 0) { if (!isArray) { - memberBuilder = factory->create_char16_builder(); + member = factory->get_primitive_type(TK_CHAR16); } else { - types::DynamicTypeBuilder* innerBuilder = factory->create_char16_builder(); std::vector bounds; dimensionsToArrayBounds(memberArray, bounds); - memberBuilder = factory->create_array_builder(innerBuilder, bounds); - //factory->DeleteBuilder(innerBuilder); + member = factory->create_array_type( + factory->get_primitive_type(TK_CHAR16), + bounds)->build(); } } - else if (strncmp(memberType, TBYTE, 6) == 0 - || strncmp(memberType, OCTET, 6) == 0 - || strncmp(memberType, UINT8, 6) == 0 - || strncmp(memberType, INT8, 5) == 0) + else if (strncmp(memberType, TBYTE, TBYTE_len) == 0 + || strncmp(memberType, OCTET, OCTET_len) == 0) { if (!isArray) { - memberBuilder = factory->create_byte_builder(); + member = factory->get_primitive_type(TK_BYTE); } else { - types::DynamicTypeBuilder* innerBuilder = factory->create_byte_builder(); std::vector bounds; dimensionsToArrayBounds(memberArray, bounds); - memberBuilder = factory->create_array_builder(innerBuilder, bounds); - //factory->DeleteBuilder(innerBuilder); + member = factory->create_array_type( + factory->get_primitive_type(TK_BYTE), + bounds)->build(); } } - else if (strncmp(memberType, SHORT, 6) == 0) + else if (strncmp(memberType, UINT8, UINT8_len) == 0) { if (!isArray) { - memberBuilder = factory->create_int16_builder(); + member = factory->get_primitive_type(TK_UINT8); } else { - types::DynamicTypeBuilder* innerBuilder = factory->create_int16_builder(); std::vector bounds; dimensionsToArrayBounds(memberArray, bounds); - memberBuilder = factory->create_array_builder(innerBuilder, bounds); - //factory->DeleteBuilder(innerBuilder); + member = factory->create_array_type( + factory->get_primitive_type(TK_UINT8), + bounds)->build(); } } - else if (strncmp(memberType, LONG, 5) == 0) + else if (strncmp(memberType, INT8, INT8_len) == 0) { if (!isArray) { - memberBuilder = factory->create_int32_builder(); + member = factory->get_primitive_type(TK_INT8); } else { - types::DynamicTypeBuilder* innerBuilder = factory->create_int32_builder(); std::vector bounds; dimensionsToArrayBounds(memberArray, bounds); - memberBuilder = factory->create_array_builder(innerBuilder, bounds); - //factory->DeleteBuilder(innerBuilder); + member = factory->create_array_type( + factory->get_primitive_type(TK_INT8), + bounds)->build(); } } - else if (strncmp(memberType, ULONG, 13) == 0) + else if (strncmp(memberType, SHORT, SHORT_len) == 0) { if (!isArray) { - memberBuilder = factory->create_uint32_builder(); + member = factory->get_primitive_type(TK_INT16); } else { - types::DynamicTypeBuilder* innerBuilder = factory->create_uint32_builder(); std::vector bounds; dimensionsToArrayBounds(memberArray, bounds); - memberBuilder = factory->create_array_builder(innerBuilder, bounds); - //factory->DeleteBuilder(innerBuilder); + member = factory->create_array_type( + factory->get_primitive_type(TK_INT16), + bounds)->build(); } } - else if (strncmp(memberType, USHORT, 14) == 0) + else if (strncmp(memberType, LONG, LONG_len) == 0) { if (!isArray) { - memberBuilder = factory->create_uint16_builder(); + member = factory->get_primitive_type(TK_INT32); } else { - types::DynamicTypeBuilder* innerBuilder = factory->create_uint16_builder(); std::vector bounds; dimensionsToArrayBounds(memberArray, bounds); - memberBuilder = factory->create_array_builder(innerBuilder, bounds); - //factory->DeleteBuilder(innerBuilder); + member = factory->create_array_type( + factory->get_primitive_type(TK_INT32), + bounds)->build(); } } - else if (strncmp(memberType, LONGLONG, 9) == 0) + else if (strncmp(memberType, ULONG, ULONG_len) == 0) { if (!isArray) { - memberBuilder = factory->create_int64_builder(); + member = factory->get_primitive_type(TK_UINT32); } else { - types::DynamicTypeBuilder* innerBuilder = factory->create_int64_builder(); std::vector bounds; dimensionsToArrayBounds(memberArray, bounds); - memberBuilder = factory->create_array_builder(innerBuilder, bounds); - //factory->DeleteBuilder(innerBuilder); + member = factory->create_array_type( + factory->get_primitive_type(TK_UINT32), + bounds)->build(); } } - else if (strncmp(memberType, ULONGLONG, 17) == 0) + else if (strncmp(memberType, USHORT, USHORT_len) == 0) { if (!isArray) { - memberBuilder = factory->create_uint64_builder(); + member = factory->get_primitive_type(TK_UINT16); } else { - types::DynamicTypeBuilder* innerBuilder = factory->create_uint64_builder(); std::vector bounds; dimensionsToArrayBounds(memberArray, bounds); - memberBuilder = factory->create_array_builder(innerBuilder, bounds); - //factory->DeleteBuilder(innerBuilder); + member = factory->create_array_type( + factory->get_primitive_type(TK_UINT16), + bounds)->build(); } } - else if (strncmp(memberType, FLOAT, 6) == 0) + else if (strncmp(memberType, LONGLONG, LONGLONG_len) == 0) { if (!isArray) { - memberBuilder = factory->create_float32_builder(); + member = factory->get_primitive_type(TK_INT64); } else { - types::DynamicTypeBuilder* innerBuilder = factory->create_float32_builder(); std::vector bounds; dimensionsToArrayBounds(memberArray, bounds); - memberBuilder = factory->create_array_builder(innerBuilder, bounds); - //factory->DeleteBuilder(innerBuilder); + member = factory->create_array_type( + factory->get_primitive_type(TK_INT64), + bounds)->build(); } } - else if (strncmp(memberType, DOUBLE, 7) == 0) + else if (strncmp(memberType, ULONGLONG, ULONGLONG_len) == 0) { if (!isArray) { - memberBuilder = factory->create_float64_builder(); + member = factory->get_primitive_type(TK_UINT64); } else { - types::DynamicTypeBuilder* innerBuilder = factory->create_float64_builder(); std::vector bounds; dimensionsToArrayBounds(memberArray, bounds); - memberBuilder = factory->create_array_builder(innerBuilder, bounds); - //factory->DeleteBuilder(innerBuilder); + member = factory->create_array_type( + factory->get_primitive_type(TK_UINT64), + bounds)->build(); } } - else if (strncmp(memberType, LONGDOUBLE, 11) == 0) + else if (strncmp(memberType, FLOAT, FLOAT_len) == 0) { if (!isArray) { - memberBuilder = factory->create_float128_builder(); + member = factory->get_primitive_type(TK_FLOAT32); } else { - types::DynamicTypeBuilder* innerBuilder = factory->create_float128_builder(); std::vector bounds; dimensionsToArrayBounds(memberArray, bounds); - memberBuilder = factory->create_array_builder(innerBuilder, bounds); - //factory->DeleteBuilder(innerBuilder); + member = factory->create_array_type( + factory->get_primitive_type(TK_FLOAT32), + bounds)->build(); } } - else if (strncmp(memberType, STRING, 7) == 0) + else if (strncmp(memberType, DOUBLE, DOUBLE_len) == 0) + { + if (!isArray) + { + member = factory->get_primitive_type(TK_FLOAT64); + } + else + { + std::vector bounds; + dimensionsToArrayBounds(memberArray, bounds); + member = factory->create_array_type( + factory->get_primitive_type(TK_FLOAT64), + bounds)->build(); + } + } + else if (strncmp(memberType, LONGDOUBLE, LONGDOUBLE_len) == 0) + { + if (!isArray) + { + member = factory->get_primitive_type(TK_FLOAT128); + } + else + { + std::vector bounds; + dimensionsToArrayBounds(memberArray, bounds); + member = factory->create_array_type( + factory->get_primitive_type(TK_FLOAT128), + bounds)->build(); + } + } + else if (strncmp(memberType, STRING, STRING_len) == 0) { - uint32_t bound = 0; const char* boundStr = p_root->Attribute(STR_MAXLENGTH); - if (boundStr != nullptr) + uint32_t bound = static_cast(LENGTH_UNLIMITED); + + if (nullptr != boundStr) { - bound = static_cast(std::atoi(boundStr)); + bound = static_cast(std::stoul(boundStr)); } + + DynamicTypeBuilder::_ref_type string_builder = factory->create_string_type(bound); + if (!isArray) { - memberBuilder = factory->create_string_builder(bound); + member = string_builder->build(); } else { - types::DynamicTypeBuilder* innerBuilder = factory->create_string_builder(bound); std::vector boundsArray; dimensionsToArrayBounds(memberArray, boundsArray); - memberBuilder = factory->create_array_builder(innerBuilder, boundsArray); - //factory->DeleteBuilder(innerBuilder); + member = factory->create_array_type( + string_builder->build(), + boundsArray)->build(); } } - else if (strncmp(memberType, WSTRING, 8) == 0) + else if (strncmp(memberType, WSTRING, WSTRING_len) == 0) { - uint32_t bound = 0; const char* boundStr = p_root->Attribute(STR_MAXLENGTH); - if (boundStr != nullptr) + uint32_t bound = static_cast(LENGTH_UNLIMITED); + + if (nullptr != boundStr) { - bound = static_cast(std::atoi(boundStr)); + bound = static_cast(std::stoul(boundStr)); } + + DynamicTypeBuilder::_ref_type wstring_builder = factory->create_wstring_type(bound); + if (!isArray) { - memberBuilder = factory->create_wstring_builder(bound); + member = wstring_builder->build(); } else { - types::DynamicTypeBuilder* innerBuilder = factory->create_wstring_builder(bound); std::vector boundsArray; dimensionsToArrayBounds(memberArray, boundsArray); - memberBuilder = factory->create_array_builder(innerBuilder, boundsArray); - //factory->DeleteBuilder(innerBuilder); + member = factory->create_array_type( + wstring_builder->build(), + boundsArray)->build(); } } else // Complex type? { - p_dynamictypebuilder_t typePtr = XMLProfileManager::getDynamicTypeByName(memberType); + DynamicType::_ref_type type; + XMLProfileManager::getDynamicTypeByName(type, memberType); if (!isArray) { - memberBuilder = typePtr; + member = type; } - else + else if (type) { - types::DynamicTypeBuilder* innerBuilder = typePtr; std::vector bounds; dimensionsToArrayBounds(memberArray, bounds); - memberBuilder = factory->create_array_builder(innerBuilder, bounds); - // Don't delete innerBuilder, it will be freed on destructors. + member = factory->create_array_type( + type, + bounds)->build(); } } - - if (memberBuilder == nullptr) + if (!member) { if (!isArray) { @@ -1391,39 +1552,62 @@ p_dynamictypebuilder_t XMLParser::parseXMLMemberDynamicType( EPROSIMA_LOG_ERROR(XMLPARSER, "Failed creating " << memberType << " array: " << (memberName ? memberName : "")); } - return nullptr; + return {}; } - const char* memberTopicKey = p_root->Attribute(KEY); - if (memberTopicKey != nullptr) + return member; +} + +DynamicType::_ref_type XMLParser::parseXMLMemberDynamicType( + tinyxml2::XMLElement* p_root, + DynamicTypeBuilder::_ref_type& builder, + MemberId mId) +{ + return parseXMLMemberDynamicType(p_root, builder, mId, ""); +} + +DynamicType::_ref_type XMLParser::parseXMLMemberDynamicType( + tinyxml2::XMLElement* p_root, + DynamicTypeBuilder::_ref_type& builder, + MemberId mId, + const std::string& values) +{ + DynamicType::_ref_type member {parseXMLMemberDynamicType(p_root)}; + + if (!member) { - if (strncmp(memberTopicKey, "true", 5) == 0) - { - memberBuilder->apply_annotation(types::ANNOTATION_KEY_ID, "value", "true"); - if (p_dynamictype != nullptr) - { - p_dynamictype->apply_annotation(types::ANNOTATION_KEY_ID, "value", "true"); - } - } + return {}; + } + + const char* memberName = p_root->Attribute(NAME); + + MemberDescriptor::_ref_type md {traits::make_shared()}; + md->id(mId); + md->name(memberName); + md->type(member); + + if (memberName != nullptr && !values.empty()) + { + UnionCaseLabelSeq labels; + bool defaultLabel = dimensionsToLabels(values, labels); + + md->label(labels); + md->is_default_label(defaultLabel); } - if (p_dynamictype != nullptr) + //{{{ Check @key annotation + const char* memberTopicKey = p_root->Attribute(KEY); + + if (memberTopicKey != nullptr && strncmp(memberTopicKey, "true", 5) == 0) { - if (!values.empty()) - { - std::vector labels; - bool defaultLabel = dimensionsToLabels(values, labels); - p_dynamictype->add_member(mId, memberName, memberBuilder, - "", labels, defaultLabel); - } - else - { - p_dynamictype->add_member(mId, memberName, memberBuilder); - } + md->is_key(true); } - //factory->DeleteBuilder(memberBuilder); + //}}} + + + builder->add_member(md); - return memberBuilder; + return member; } XMLP_ret XMLParser::parseXMLDynamicTypes( diff --git a/src/cpp/xmlparser/XMLParser.h b/src/cpp/xmlparser/XMLParser.h index 938c39e9c4f..6f82a57822b 100644 --- a/src/cpp/xmlparser/XMLParser.h +++ b/src/cpp/xmlparser/XMLParser.h @@ -23,6 +23,8 @@ #include #include +#include +#include #include #include #include @@ -33,8 +35,6 @@ #include #include #include -#include -#include #include @@ -58,8 +58,7 @@ typedef node_att_map_t::const_iterator node_att_map_cit_t; typedef std::shared_ptr sp_transport_t; typedef std::map sp_transport_map_t; -typedef types::DynamicTypeBuilder* p_dynamictypebuilder_t; -typedef std::map p_dynamictype_map_t; +typedef std::map p_dynamictype_map_t; typedef std::unique_ptr up_participantfactory_t; typedef DataNode node_participantfactory_t; @@ -291,26 +290,28 @@ class XMLParser static XMLP_ret parseXMLBitmaskDynamicType( tinyxml2::XMLElement* p_root); - static p_dynamictypebuilder_t parseXMLBitfieldDynamicType( + static XMLP_ret parseXMLBitfieldDynamicType( tinyxml2::XMLElement* p_root, - p_dynamictypebuilder_t p_dynamictype, - types::MemberId mId, - uint16_t& position); + fastdds::dds::DynamicTypeBuilder::_ref_type builder, + fastdds::dds::MemberId& position); static XMLP_ret parseXMLBitvalueDynamicType( tinyxml2::XMLElement* p_root, - p_dynamictypebuilder_t p_dynamictype, + fastdds::dds::DynamicTypeBuilder::_ref_type builder, uint16_t& position); - static p_dynamictypebuilder_t parseXMLMemberDynamicType( + static fastdds::dds::DynamicType::_ref_type parseXMLMemberDynamicType( + tinyxml2::XMLElement* p_root); + + static fastdds::dds::DynamicType::_ref_type parseXMLMemberDynamicType( tinyxml2::XMLElement* p_root, - p_dynamictypebuilder_t p_dynamictype, - types::MemberId mId); + fastdds::dds::DynamicTypeBuilder::_ref_type& builder, + fastdds::dds::MemberId mId); - static p_dynamictypebuilder_t parseXMLMemberDynamicType( + static fastdds::dds::DynamicType::_ref_type parseXMLMemberDynamicType( tinyxml2::XMLElement* p_root, - p_dynamictypebuilder_t p_dynamictype, - types::MemberId mId, + fastdds::dds::DynamicTypeBuilder::_ref_type& builder, + fastdds::dds::MemberId mId, const std::string& values); static XMLP_ret fillDataNode( diff --git a/src/cpp/xmlparser/XMLParserCommon.cpp b/src/cpp/xmlparser/XMLParserCommon.cpp index 46b95d6d7ae..df1783b73dc 100644 --- a/src/cpp/xmlparser/XMLParserCommon.cpp +++ b/src/cpp/xmlparser/XMLParserCommon.cpp @@ -363,54 +363,6 @@ const char* EPROSIMA_UNKNOWN_STRING = "EPROSIMA_UNKNOWN_STRING"; const char* _OWNERSHIP_KIND_NOT_PRESENT = "OWNERSHIP_KIND_NOT_PRESENT"; const char* STRENGTH = "strength"; -// TYPES parser -const char* BOOLEAN = "boolean"; -const char* CHAR = "char8"; -const char* WCHAR = "char16"; -const char* TBYTE = "byte"; -const char* OCTET = "octet"; -const char* UINT8 = "uint8"; -const char* INT8 = "int8"; -const char* SHORT = "int16"; -const char* LONG = "int32"; -const char* USHORT = "uint16"; -const char* ULONG = "uint32"; -const char* LONGLONG = "int64"; -const char* ULONGLONG = "uint64"; -const char* FLOAT = "float32"; -const char* DOUBLE = "float64"; -const char* LONGDOUBLE = "float128"; -const char* STRING = "string"; -const char* WSTRING = "wstring"; -const char* LITERAL = "literal"; -const char* STRUCT = "struct"; -const char* UNION = "union"; -const char* SEQUENCE = "sequence"; -const char* MAP = "map"; -const char* TYPEDEF = "typedef"; -const char* BITSET = "bitset"; -const char* BITMASK = "bitmask"; -const char* ENUM = "enum"; -const char* CASE = "case"; -const char* DEFAULT = "default"; -const char* DISCRIMINATOR = "discriminator"; -const char* CASE_DISCRIMINATOR = "caseDiscriminator"; -const char* ARRAY_DIMENSIONS = "arrayDimensions"; -const char* STR_MAXLENGTH = "stringMaxLength"; -const char* SEQ_MAXLENGTH = "sequenceMaxLength"; -const char* MAP_MAXLENGTH = "mapMaxLength"; -const char* MAP_KEY_TYPE = "key_type"; -const char* ENUMERATOR = "enumerator"; -const char* NON_BASIC_TYPE = "nonBasic"; -const char* NON_BASIC_TYPE_NAME = "nonBasicTypeName"; -const char* KEY = "key"; -const char* MEMBER = "member"; -const char* BITFIELD = "bitfield"; -const char* BIT_VALUE = "bit_value"; -const char* POSITION = "position"; -const char* BIT_BOUND = "bit_bound"; -const char* BASE_TYPE = "baseType"; - // LOG const char* USE_DEFAULT = "use_default"; const char* CONSUMER = "consumer"; diff --git a/src/cpp/xmlparser/XMLParserCommon.h b/src/cpp/xmlparser/XMLParserCommon.h index e66f389736b..4a508279403 100644 --- a/src/cpp/xmlparser/XMLParserCommon.h +++ b/src/cpp/xmlparser/XMLParserCommon.h @@ -376,54 +376,6 @@ extern const char* _TRANSIENT_LOCAL_DURABILITY_QOS; extern const char* _VOLATILE_DURABILITY_QOS; extern const char* STRENGTH; -// TYPES parser -extern const char* BOOLEAN; -extern const char* CHAR; -extern const char* WCHAR; -extern const char* TBYTE; -extern const char* OCTET; -extern const char* UINT8; -extern const char* INT8; -extern const char* SHORT; -extern const char* LONG; -extern const char* USHORT; -extern const char* ULONG; -extern const char* LONGLONG; -extern const char* ULONGLONG; -extern const char* FLOAT; -extern const char* DOUBLE; -extern const char* LONGDOUBLE; -extern const char* STRING; -extern const char* WSTRING; -extern const char* LITERAL; -extern const char* STRUCT; -extern const char* UNION; -extern const char* SEQUENCE; -extern const char* MAP; -extern const char* TYPEDEF; -extern const char* BITSET; -extern const char* BITMASK; -extern const char* ENUM; -extern const char* CASE; -extern const char* DEFAULT; -extern const char* DISCRIMINATOR; -extern const char* CASE_DISCRIMINATOR; -extern const char* ARRAY_DIMENSIONS; -extern const char* STR_MAXLENGTH; -extern const char* SEQ_MAXLENGTH; -extern const char* MAP_MAXLENGTH; -extern const char* MAP_KEY_TYPE; -extern const char* ENUMERATOR; -extern const char* NON_BASIC_TYPE; -extern const char* NON_BASIC_TYPE_NAME; -extern const char* KEY; -extern const char* MEMBER; -extern const char* BITFIELD; -extern const char* BIT_VALUE; -extern const char* POSITION; -extern const char* BIT_BOUND; -extern const char* BASE_TYPE; - // LOG extern const char* USE_DEFAULT; extern const char* CONSUMER; diff --git a/src/cpp/xmlparser/XMLProfileManager.cpp b/src/cpp/xmlparser/XMLProfileManager.cpp index f861d6c2fde..ffe340dc9ad 100644 --- a/src/cpp/xmlparser/XMLProfileManager.cpp +++ b/src/cpp/xmlparser/XMLProfileManager.cpp @@ -660,25 +660,28 @@ sp_transport_t XMLProfileManager::getTransportById( bool XMLProfileManager::insertDynamicTypeByName( const std::string& type_name, - p_dynamictypebuilder_t type) + const eprosima::fastdds::dds::DynamicType::_ref_type& type) { if (dynamic_types_.find(type_name) == dynamic_types_.end()) { - dynamic_types_[type_name] = type; + dynamic_types_.emplace(std::make_pair(type_name, type)); return true; } EPROSIMA_LOG_ERROR(XMLPARSER, "Error adding the type " << type_name << ". There is other type with the same name."); return false; } -p_dynamictypebuilder_t XMLProfileManager::getDynamicTypeByName( +XMLP_ret XMLProfileManager::getDynamicTypeByName( + eprosima::fastdds::dds::DynamicType::_ref_type& dynamic_type, const std::string& type_name) { if (dynamic_types_.find(type_name) != dynamic_types_.end()) { - return dynamic_types_[type_name]; + dynamic_type = dynamic_types_[type_name]; + return XMLP_ret::XML_OK; } - return nullptr; + + return XMLP_ret::XML_ERROR; } XMLP_ret XMLProfileManager::extractTopicProfile( diff --git a/src/cpp/xmlparser/XMLProfileManager.h b/src/cpp/xmlparser/XMLProfileManager.h index 353f3ade898..ab710bc234f 100644 --- a/src/cpp/xmlparser/XMLProfileManager.h +++ b/src/cpp/xmlparser/XMLProfileManager.h @@ -20,13 +20,11 @@ #include #include -#include +#include +#include #include #include #include -#include -#include -#include #include #include @@ -217,13 +215,12 @@ class XMLProfileManager //!Add a new dynamic type instance along with its name. static bool insertDynamicTypeByName( const std::string& type_name, - p_dynamictypebuilder_t type); + const fastdds::dds::DynamicType::_ref_type& type); - //!Retrieves a transport instance by its name. - static p_dynamictypebuilder_t getDynamicTypeByName( + static XMLP_ret getDynamicTypeByName( + fastdds::dds::DynamicType::_ref_type& dynamic_type, const std::string& type_name); - /** * Search for the profile specified and fill the structure. * @param profile_name Name for the profile to be used to fill the structure. @@ -260,6 +257,7 @@ class XMLProfileManager topic_profiles_.clear(); xml_files_.clear(); transport_profiles_.clear(); + dynamic_types_.clear(); } /** @@ -267,12 +265,12 @@ class XMLProfileManager * Any instance retrieve by calling this method must be deleted calling the * XMLProfileManager::DeleteDynamicPubSubType method. */ - static types::DynamicPubSubType* CreateDynamicPubSubType( + static eprosima::fastdds::dds::DynamicPubSubType* CreateDynamicPubSubType( const std::string& type_name) { if (dynamic_types_.find(type_name) != dynamic_types_.end()) { - return new types::DynamicPubSubType(dynamic_types_[type_name]->build()); + return new eprosima::fastdds::dds::DynamicPubSubType(dynamic_types_[type_name]); } return nullptr; } @@ -282,7 +280,7 @@ class XMLProfileManager * XMLProfileManager::CreateDynamicPubSubType method. */ static void DeleteDynamicPubSubType( - types::DynamicPubSubType* type) + eprosima::fastdds::dds::DynamicPubSubType* type) { delete type; } diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 584ea1bf063..916884e90b2 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -45,10 +45,12 @@ endif(WIN32) # Testing ############################################################################### if(EPROSIMA_BUILD_TESTS) + find_package(GTest CONFIG REQUIRED) include(${PROJECT_SOURCE_DIR}/cmake/testing/GoogleTest.cmake) add_subdirectory(blackbox) + add_subdirectory(feature) add_subdirectory(unittest) add_subdirectory(dds/communication) add_subdirectory(dds/communication/security) @@ -72,8 +74,7 @@ endif() if(NOT ((MSVC OR MSVC_IDE)) AND PROFILING_TESTS) find_program(CTEST_MEMORYCHECK_COMMAND NAMES valgrind) if(CTEST_MEMORYCHECK_COMMAND) - # TODO(jlbueno) Migrate tests to Fast DDS API - # add_subdirectory(profiling) + add_subdirectory(profiling) endif() endif() diff --git a/test/blackbox/api/dds-pim/PubSubReader.hpp b/test/blackbox/api/dds-pim/PubSubReader.hpp index 1ba78a749c7..aa0e724a4de 100644 --- a/test/blackbox/api/dds-pim/PubSubReader.hpp +++ b/test/blackbox/api/dds-pim/PubSubReader.hpp @@ -54,13 +54,13 @@ #include #include -using DomainParticipantFactory = eprosima::fastdds::dds::DomainParticipantFactory; -using eprosima::fastrtps::rtps::IPLocator; +using eprosima::fastdds::dds::DomainParticipantFactory; +using eprosima::fastdds::dds::ReturnCode_t; using eprosima::fastdds::rtps::UDPTransportDescriptor; using eprosima::fastdds::rtps::UDPv4TransportDescriptor; using eprosima::fastdds::rtps::UDPv6TransportDescriptor; +using eprosima::fastrtps::rtps::IPLocator; -using ReturnCode_t = eprosima::fastdds::dds::ReturnCode_t; using SampleLostStatusFunctor = std::function; using SampleRejectedStatusFunctor = std::function; diff --git a/test/blackbox/api/dds-pim/PubSubWriter.hpp b/test/blackbox/api/dds-pim/PubSubWriter.hpp index deb80346b7c..d35e0345df4 100644 --- a/test/blackbox/api/dds-pim/PubSubWriter.hpp +++ b/test/blackbox/api/dds-pim/PubSubWriter.hpp @@ -53,11 +53,11 @@ #include #include -using DomainParticipantFactory = eprosima::fastdds::dds::DomainParticipantFactory; -using eprosima::fastrtps::rtps::IPLocator; +using eprosima::fastdds::dds::DomainParticipantFactory; using eprosima::fastdds::rtps::UDPTransportDescriptor; using eprosima::fastdds::rtps::UDPv4TransportDescriptor; using eprosima::fastdds::rtps::UDPv6TransportDescriptor; +using eprosima::fastrtps::rtps::IPLocator; template class PubSubWriter diff --git a/test/blackbox/common/DDSBlackboxTestsAckPositive.cpp b/test/blackbox/common/DDSBlackboxTestsAckPositive.cpp index e8cdc11e1e1..d6407136d4e 100644 --- a/test/blackbox/common/DDSBlackboxTestsAckPositive.cpp +++ b/test/blackbox/common/DDSBlackboxTestsAckPositive.cpp @@ -38,7 +38,6 @@ #include #include #include -#include // TODO(jlbueno): remove private headers #include diff --git a/test/blackbox/common/DDSBlackboxTestsContentFilter.cpp b/test/blackbox/common/DDSBlackboxTestsContentFilter.cpp index 7c2d8c14986..dc72f1e5479 100644 --- a/test/blackbox/common/DDSBlackboxTestsContentFilter.cpp +++ b/test/blackbox/common/DDSBlackboxTestsContentFilter.cpp @@ -15,6 +15,7 @@ #include #include +#include #include #include #include @@ -34,8 +35,6 @@ namespace eprosima { namespace fastdds { namespace dds { -using ReturnCode_t = eprosima::fastdds::dds::ReturnCode_t; - struct ContentFilterInfoCounter { std::atomic_size_t user_data_count; diff --git a/test/blackbox/common/DDSBlackboxTestsFindTopic.cpp b/test/blackbox/common/DDSBlackboxTestsFindTopic.cpp index 801b7e2477a..9e4575c735a 100644 --- a/test/blackbox/common/DDSBlackboxTestsFindTopic.cpp +++ b/test/blackbox/common/DDSBlackboxTestsFindTopic.cpp @@ -13,7 +13,6 @@ // limitations under the License. - #include #include #include diff --git a/test/blackbox/common/DDSBlackboxTestsSecurity.cpp b/test/blackbox/common/DDSBlackboxTestsSecurity.cpp index 619ed439d91..4fc76084742 100644 --- a/test/blackbox/common/DDSBlackboxTestsSecurity.cpp +++ b/test/blackbox/common/DDSBlackboxTestsSecurity.cpp @@ -28,16 +28,14 @@ #include #include #include +#include +#include +#include #include -#include -#include -#include -#include namespace fastdds = ::eprosima::fastdds::dds; using namespace eprosima::fastrtps; using namespace eprosima::fastrtps::rtps; -using namespace eprosima::fastrtps::types; void set_authentication_config( rtps::PropertySeq& props) @@ -106,14 +104,13 @@ void test_big_message_corner_case( auto participant = fastdds::DomainParticipantFactory::get_instance()->create_participant(0, qos); ASSERT_NE(nullptr, participant); - std::vector lengths = { array_length }; - DynamicType_ptr base_type = DynamicTypeBuilderFactory::get_instance()->create_char8_type(); - DynamicTypeBuilder_ptr builder = - DynamicTypeBuilderFactory::get_instance()->create_array_builder(base_type, lengths); - builder->set_name(name); - DynamicType_ptr array_type = builder->build(); + fastdds::BoundSeq lengths = { array_length }; + fastdds::DynamicTypeBuilder::_ref_type builder = + fastdds::DynamicTypeBuilderFactory::get_instance()->create_array_type( + fastdds::DynamicTypeBuilderFactory::get_instance()->get_primitive_type(fastdds::TK_CHAR8), lengths); + fastdds::DynamicType::_ref_type array_type = builder->build(); - fastdds::TypeSupport type_support(new eprosima::fastrtps::types::DynamicPubSubType(array_type)); + fastdds::TypeSupport type_support(new fastdds::DynamicPubSubType(array_type)); type_support.get()->auto_fill_type_information(false); EXPECT_EQ(fastdds::RETCODE_OK, participant->register_type(type_support)); @@ -138,14 +135,14 @@ void test_big_message_corner_case( std::this_thread::sleep_for(std::chrono::milliseconds(100)); } - auto data = eprosima::fastrtps::types::DynamicDataFactory::get_instance()->create_data(array_type); - EXPECT_EQ(fastdds::RETCODE_OK, writer->write(data, fastdds::HANDLE_NIL)); + auto data = fastdds::DynamicDataFactory::get_instance()->create_data(array_type); + EXPECT_EQ(fastdds::RETCODE_OK, writer->write(&data, fastdds::HANDLE_NIL)); fastdds::SampleInfo info{}; bool taken = false; for (size_t n_tries = 0; n_tries < 6u; ++n_tries) { - if (fastdds::RETCODE_OK == reader->take_next_sample(data, &info)) + if (fastdds::RETCODE_OK == reader->take_next_sample(&data, &info)) { taken = true; break; diff --git a/test/blackbox/common/DDSBlackboxTestsStatisticsDomainParticipant.cpp b/test/blackbox/common/DDSBlackboxTestsStatisticsDomainParticipant.cpp index e4d7b03a48f..96eb9961bbe 100644 --- a/test/blackbox/common/DDSBlackboxTestsStatisticsDomainParticipant.cpp +++ b/test/blackbox/common/DDSBlackboxTestsStatisticsDomainParticipant.cpp @@ -20,9 +20,9 @@ #include #include #include -#include #include +#include #include "../types/statistics/types.hpp" #include "../types/statistics/typesPubSubTypes.h" #include "BlackboxTests.hpp" diff --git a/test/dds/communication/PublisherDynamic.cpp b/test/dds/communication/PublisherDynamic.cpp index e05de6dbe38..5523e66acc7 100644 --- a/test/dds/communication/PublisherDynamic.cpp +++ b/test/dds/communication/PublisherDynamic.cpp @@ -32,7 +32,9 @@ #include #include #include -#include +#include +#include +#include using namespace eprosima::fastdds::dds; using namespace eprosima::fastrtps; @@ -240,17 +242,16 @@ int main( return 1; } - types::DynamicTypeBuilder* dyn_type_builder = nullptr; + DynamicType::_ref_type dyn_type; if (RETCODE_OK != DomainParticipantFactory::get_instance()->get_dynamic_type_builder_from_xml_by_name("TypeLookup", - dyn_type_builder)) + dyn_type)) { std::cout << "Error getting dynamic type from XML file" << std::endl; return 1; } - types::DynamicType_ptr dyn_type = dyn_type_builder->build(); - TypeSupport type(new types::DynamicPubSubType(dyn_type)); + TypeSupport type(new DynamicPubSubType(dyn_type)); type.register_type(participant); PubListener listener; @@ -300,16 +301,15 @@ int main( }); } - types::DynamicData_ptr data(types::DynamicDataFactory::get_instance()->create_data(dyn_type)); - data->set_string_value("Hello DDS Dynamic World", 0); + DynamicData::_ref_type data {DynamicDataFactory::get_instance()->create_data(dyn_type)}; + data->set_string_value(0, "Hello DDS Dynamic World"); data->set_uint32_value(1, 1); - types::DynamicData* inner = data->loan_value(2); - inner->set_byte_value(10, 0); - data->return_loaned_value(inner); + DynamicData::_ref_type inner {data->loan_value(2)}; + inner->set_byte_value(0, 10); while (run) { - writer->write(data.get()); + writer->write(&data); uint32_t index; data->get_uint32_value(index, 1); @@ -320,14 +320,13 @@ int main( } else { - data->set_uint32_value(index + 1, 1); + data->set_uint32_value(1, index + 1); } inner = data->loan_value(2); octet inner_count; inner->get_byte_value(inner_count, 0); - inner->set_byte_value(inner_count + 1, 0); - data->return_loaned_value(inner); + inner->set_byte_value(0, inner_count + 1); std::this_thread::sleep_for(std::chrono::milliseconds(250)); } diff --git a/test/dds/communication/SubscriberDynamic.cpp b/test/dds/communication/SubscriberDynamic.cpp index 604f3766054..cc0cf764fe3 100644 --- a/test/dds/communication/SubscriberDynamic.cpp +++ b/test/dds/communication/SubscriberDynamic.cpp @@ -34,8 +34,9 @@ #include #include #include +#include +#include #include -#include using namespace eprosima::fastdds::dds; using namespace eprosima::fastdds::dds::xtypes; @@ -253,12 +254,13 @@ int main( auto& topic_name = remote_names.first; auto& type_name = remote_names.second; - eprosima::fastrtps::types::DynamicType_ptr type; + DynamicType::_ref_type type; { TypeObjectPair type_objects; if (RETCODE_OK != DomainParticipantFactory::get_instance()->type_object_registry().get_type_objects( type_name, type_objects)) + { std::cout << "ERROR: TypeObject cannot be retrieved for type: " << type_name << std::endl; @@ -268,7 +270,7 @@ int main( // TODO(XTypes): PENDING DynamicTypeBuilderFactory::create_type_w_type_object // type = types::TypeObjectFactory::get_instance()->build_dynamic_type(type_name, ident, obj); - if (type == nullptr) + if (!type) { std::cout << "ERROR: DynamicType cannot be created for type: " << type_name << std::endl; throw 1; @@ -307,12 +309,11 @@ int main( while ((notexit || number_samples < samples ) && listener.run_) { // loop taking samples - eprosima::fastrtps::types::DynamicPubSubType pst(type); - eprosima::fastrtps::types::DynamicData_ptr sample(static_cast(pst. - createData())); + DynamicPubSubType pst(type); + DynamicData* sample {static_cast(pst.createData())}; eprosima::fastdds::dds::SampleInfo info; - if (RETCODE_OK == reader->take_next_sample(sample.get(), &info)) + if (RETCODE_OK == reader->take_next_sample(sample, &info)) { if (info.valid_data) { @@ -325,7 +326,7 @@ int main( sample->get_string_value(message, 0); sample->get_uint32_value(index, 1); - eprosima::fastrtps::types::DynamicData* inner = sample->loan_value(2); + DynamicData::_ref_type inner {sample->loan_value(2)}; inner->get_byte_value(count, 0); sample->return_loaned_value(inner); diff --git a/test/feature/CMakeLists.txt b/test/feature/CMakeLists.txt new file mode 100644 index 00000000000..4f3a784ba97 --- /dev/null +++ b/test/feature/CMakeLists.txt @@ -0,0 +1,13 @@ +# Copyright 2024 Proyectos y Sistemas de Mantenimiento SL (eProsima). +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/test/mock/dds/DomainParticipantImpl/fastdds/domain/DomainParticipantImpl.hpp b/test/mock/dds/DomainParticipantImpl/fastdds/domain/DomainParticipantImpl.hpp index afc49d4a938..3cd5b11f3cb 100644 --- a/test/mock/dds/DomainParticipantImpl/fastdds/domain/DomainParticipantImpl.hpp +++ b/test/mock/dds/DomainParticipantImpl/fastdds/domain/DomainParticipantImpl.hpp @@ -22,6 +22,7 @@ #include #include +#include #include #include #include @@ -39,7 +40,6 @@ #include #include #include -#include #include #include diff --git a/test/mock/dds/Publisher/fastdds/dds/publisher/Publisher.hpp b/test/mock/dds/Publisher/fastdds/dds/publisher/Publisher.hpp index 3b19b3375c6..208b1d9fdb8 100644 --- a/test/mock/dds/Publisher/fastdds/dds/publisher/Publisher.hpp +++ b/test/mock/dds/Publisher/fastdds/dds/publisher/Publisher.hpp @@ -20,12 +20,12 @@ #include #include +#include #include #include #include #include #include -#include #include diff --git a/test/performance/latency/LatencyTestPublisher.cpp b/test/performance/latency/LatencyTestPublisher.cpp index 2bfee08fbaf..ae89e8433a1 100644 --- a/test/performance/latency/LatencyTestPublisher.cpp +++ b/test/performance/latency/LatencyTestPublisher.cpp @@ -32,6 +32,11 @@ #include #include #include +#include +#include +#include +#include +#include #include #include #include @@ -574,12 +579,16 @@ void LatencyTestPublisher::LatencyDataReaderListener::on_data_available( } // Check if is the expected echo message - if ((pub->dynamic_types_ - && (pub->dynamic_data_in_->get_uint32_value(0) - != pub->dynamic_data_out_->get_uint32_value(0))) - || (!pub->dynamic_types_ - && (pub->latency_data_in_->seqnum - != pub->latency_data_out_->seqnum))) + uint32_t dyn_value_in {0}; + uint32_t dyn_value_out {0}; + if (pub->dynamic_types_) + { + (*pub->dynamic_data_in_)->get_uint32_value(dyn_value_in, 0); + (*pub->dynamic_data_out_)->get_uint32_value(dyn_value_out, 0); + } + + if ((pub->dynamic_types_ && dyn_value_in != dyn_value_out) + || (!pub->dynamic_types_ && pub->latency_data_in_->seqnum != pub->latency_data_out_->seqnum)) { EPROSIMA_LOG_INFO(LatencyTest, "Echo message received is not the expected one"); } @@ -604,7 +613,7 @@ void LatencyTestPublisher::LatencyDataReaderListener::on_data_available( // Reset seqnum from out data if (pub->dynamic_types_) { - pub->dynamic_data_out_->set_uint32_value(0, 0); + (*pub->dynamic_data_out_)->set_uint32_value(0, 0); } else { @@ -699,43 +708,39 @@ bool LatencyTestPublisher::test( if (dynamic_types_) { - dynamic_data_in_ = static_cast(dynamic_pub_sub_type_->createData()); - dynamic_data_out_ = static_cast(dynamic_pub_sub_type_->createData()); + dynamic_data_in_ = static_cast(dynamic_pub_sub_type_->createData()); + dynamic_data_out_ = static_cast(dynamic_pub_sub_type_->createData()); if (nullptr == dynamic_data_in_) { EPROSIMA_LOG_ERROR(LATENCYPUBLISHER, - "Iteration failed: Failed to create eprosima::fastrtps::types::Dynamic Data In"); + "Iteration failed: Failed to create Dynamic Data In"); return false; } if (nullptr == dynamic_data_out_) { EPROSIMA_LOG_ERROR(LATENCYPUBLISHER, - "Iteration failed: Failed to create eprosima::fastrtps::types::Dynamic Data Out"); + "Iteration failed: Failed to create Dynamic Data Out"); return false; } - eprosima::fastrtps::types::MemberId id_in; - eprosima::fastrtps::types::MemberId id_out; - eprosima::fastrtps::types::DynamicData* data_in = dynamic_data_in_->loan_value( - dynamic_data_in_->get_member_id_at_index(1)); - eprosima::fastrtps::types::DynamicData* data_out = dynamic_data_out_->loan_value( - dynamic_data_out_->get_member_id_at_index(1)); + DynamicData::_ref_type data_in = (*dynamic_data_in_)->loan_value( + (*dynamic_data_in_)->get_member_id_at_index(1)); + DynamicData::_ref_type data_out = (*dynamic_data_out_)->loan_value( + (*dynamic_data_out_)->get_member_id_at_index(1)); // fill until complete the desired payload size uint32_t padding = datasize - 4; // sequence number is a DWORD for (uint32_t i = 0; i < padding; ++i) { - data_in->insert_sequence_data(id_in); - data_in->set_byte_value(0, id_in); - data_out->insert_sequence_data(id_out); - data_out->set_byte_value(0, id_out); + data_in->set_byte_value(i, 0); + data_out->set_byte_value(i, 0); } - dynamic_data_in_->return_loaned_value(data_in); - dynamic_data_out_->return_loaned_value(data_out); + (*dynamic_data_in_)->return_loaned_value(data_in); + (*dynamic_data_out_)->return_loaned_value(data_out); } else if (init_static_types(datasize) && create_data_endpoints()) { @@ -784,12 +789,12 @@ bool LatencyTestPublisher::test( // The first measurement it's usually not representative, so we take one more and then drop the first one. for (unsigned int count = 1; count <= samples_ + 1; ++count) { - void* data = nullptr; + void* data {nullptr}; if (dynamic_types_) { - dynamic_data_in_->set_uint32_value(0, 0); - dynamic_data_out_->set_uint32_value(count, 0); + (*dynamic_data_in_)->set_uint32_value(0, 0); + (*dynamic_data_out_)->set_uint32_value(0, count); data = dynamic_data_out_; } else @@ -890,8 +895,8 @@ bool LatencyTestPublisher::test( // Delete Data Sample if (dynamic_types_) { - eprosima::fastrtps::types::DynamicDataFactory::get_instance()->delete_data(dynamic_data_in_); - eprosima::fastrtps::types::DynamicDataFactory::get_instance()->delete_data(dynamic_data_out_); + dynamic_pub_sub_type_->deleteData(dynamic_data_in_); + dynamic_pub_sub_type_->deleteData(dynamic_data_out_); } else { @@ -1064,20 +1069,24 @@ bool LatencyTestPublisher::init_dynamic_types() } // Dummy type registration + DynamicTypeBuilderFactory::_ref_type factory {DynamicTypeBuilderFactory::get_instance()}; // Create basic builders - eprosima::fastrtps::types::DynamicTypeBuilder_ptr struct_type_builder(eprosima::fastrtps::types:: - DynamicTypeBuilderFactory::get_instance()-> - create_struct_builder()); + TypeDescriptor::_ref_type type_descriptor {traits::make_shared()}; + type_descriptor->kind(TK_STRUCTURE); + type_descriptor->name(LatencyDataType::type_name_); + + DynamicTypeBuilder::_ref_type struct_type_builder {factory->create_type(type_descriptor)}; // Add members to the struct. - struct_type_builder->add_member(0, "seqnum", - eprosima::fastrtps::types::DynamicTypeBuilderFactory::get_instance()->create_uint32_type()); - struct_type_builder->add_member(1, "data", - eprosima::fastrtps::types::DynamicTypeBuilderFactory::get_instance()->create_sequence_builder( - eprosima::fastrtps::types::DynamicTypeBuilderFactory::get_instance()->create_byte_type(), - eprosima::fastrtps::types::BOUND_UNLIMITED)); - struct_type_builder->set_name(LatencyDataType::type_name_); - dynamic_pub_sub_type_.reset(new eprosima::fastrtps::types::DynamicPubSubType(struct_type_builder->build())); + MemberDescriptor::_ref_type member_descriptor {traits::make_shared()}; + member_descriptor->name("seqnum"); + member_descriptor->type(factory->get_primitive_type(TK_UINT32)); + struct_type_builder->add_member(member_descriptor); + member_descriptor->name("data"); + member_descriptor->type(factory->create_sequence_type( + factory->get_primitive_type(TK_BYTE), static_cast(LENGTH_UNLIMITED))->build()); + struct_type_builder->add_member(member_descriptor); + dynamic_pub_sub_type_.reset(new DynamicPubSubType(struct_type_builder->build())); // Register the data type if (RETCODE_OK != dynamic_pub_sub_type_.register_type(participant_)) @@ -1264,7 +1273,7 @@ bool LatencyTestPublisher::destroy_data_endpoints() latency_data_type_.reset(); dynamic_pub_sub_type_.reset(); - eprosima::fastrtps::types::DynamicTypeBuilderFactory::delete_instance(); + DynamicTypeBuilderFactory::delete_instance(); return true; } diff --git a/test/performance/latency/LatencyTestPublisher.hpp b/test/performance/latency/LatencyTestPublisher.hpp index efd327eb0b3..f9aa04a26b3 100644 --- a/test/performance/latency/LatencyTestPublisher.hpp +++ b/test/performance/latency/LatencyTestPublisher.hpp @@ -31,15 +31,7 @@ #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include #include "LatencyTestTypes.hpp" #include "../optionarg.hpp" @@ -225,8 +217,8 @@ class LatencyTestPublisher eprosima::fastdds::dds::TypeSupport latency_command_type_; /* Dynamic Types */ - eprosima::fastrtps::types::DynamicData* dynamic_data_in_ = nullptr; - eprosima::fastrtps::types::DynamicData* dynamic_data_out_ = nullptr; + eprosima::fastdds::dds::DynamicData::_ref_type* dynamic_data_in_ {nullptr}; + eprosima::fastdds::dds::DynamicData::_ref_type* dynamic_data_out_ {nullptr}; eprosima::fastdds::dds::TypeSupport dynamic_pub_sub_type_; std::vector data_size_pub_; diff --git a/test/performance/latency/LatencyTestSubscriber.cpp b/test/performance/latency/LatencyTestSubscriber.cpp index 0cc35abbad8..5fcffcfe673 100644 --- a/test/performance/latency/LatencyTestSubscriber.cpp +++ b/test/performance/latency/LatencyTestSubscriber.cpp @@ -28,12 +28,17 @@ #include #include #include +#include +#include +#include +#include +#include #include #include #include -using namespace eprosima::fastrtps::rtps; using namespace eprosima::fastdds::dds; +using namespace eprosima::fastrtps::rtps; LatencyTestSubscriber::LatencyTestSubscriber() : latency_command_type_(new TestCommandDataType()) @@ -650,29 +655,27 @@ bool LatencyTestSubscriber::test( if (dynamic_types_) { // Create the data sample - eprosima::fastrtps::types::MemberId id; - dynamic_data_ = static_cast(dynamic_pub_sub_type_->createData()); + dynamic_data_ = static_cast(dynamic_pub_sub_type_->createData()); if (nullptr == dynamic_data_) { EPROSIMA_LOG_ERROR(LatencyTest, - "Iteration failed: Failed to create eprosima::fastrtps::types::Dynamic Data"); + "Iteration failed: Failed to create Dynamic Data"); return false; } // Modify the data Sample - eprosima::fastrtps::types::DynamicData* member_data = dynamic_data_->loan_value( - dynamic_data_->get_member_id_at_index(1)); + DynamicData::_ref_type member_data = (*dynamic_data_)->loan_value( + (*dynamic_data_)->get_member_id_at_index(1)); // fill until complete the desired payload size uint32_t padding = datasize - 4; // sequence number is a DWORD for (uint32_t i = 0; i < padding; ++i) { - member_data->insert_sequence_data(id); - member_data->set_byte_value(0, id); + member_data->set_byte_value(i, 0); } - dynamic_data_->return_loaned_value(member_data); + (*dynamic_data_)->return_loaned_value(member_data); } // Create the static type for the given buffer size and the endpoints else if (init_static_types(datasize) && create_data_endpoints()) @@ -719,7 +722,6 @@ bool LatencyTestSubscriber::test( if (dynamic_types_) { dynamic_pub_sub_type_->deleteData(dynamic_data_); - // eprosima::fastrtps::types::DynamicDataFactory::get_instance()->delete_data(dynamic_data_); // // Reset history for the new test size_t removed; @@ -793,20 +795,24 @@ bool LatencyTestSubscriber::init_dynamic_types() } // Dummy type registration + DynamicTypeBuilderFactory::_ref_type factory {DynamicTypeBuilderFactory::get_instance()}; // Create basic builders - eprosima::fastrtps::types::DynamicTypeBuilder_ptr struct_type_builder(eprosima::fastrtps::types:: - DynamicTypeBuilderFactory::get_instance()-> - create_struct_builder()); + TypeDescriptor::_ref_type type_descriptor {traits::make_shared()}; + type_descriptor->kind(TK_STRUCTURE); + type_descriptor->name(LatencyDataType::type_name_); + + DynamicTypeBuilder::_ref_type struct_type_builder {factory->create_type(type_descriptor)}; // Add members to the struct. - struct_type_builder->add_member(0, "seqnum", - eprosima::fastrtps::types::DynamicTypeBuilderFactory::get_instance()->create_uint32_type()); - struct_type_builder->add_member(1, "data", - eprosima::fastrtps::types::DynamicTypeBuilderFactory::get_instance()->create_sequence_builder( - eprosima::fastrtps::types::DynamicTypeBuilderFactory::get_instance()->create_byte_type(), - eprosima::fastrtps::types::BOUND_UNLIMITED)); - struct_type_builder->set_name(LatencyDataType::type_name_); - dynamic_pub_sub_type_.reset(new eprosima::fastrtps::types::DynamicPubSubType(struct_type_builder->build())); + MemberDescriptor::_ref_type member_descriptor {traits::make_shared()}; + member_descriptor->name("seqnum"); + member_descriptor->type(factory->get_primitive_type(TK_UINT32)); + struct_type_builder->add_member(member_descriptor); + member_descriptor->name("data"); + member_descriptor->type(factory->create_sequence_type( + factory->get_primitive_type(TK_BYTE), static_cast(LENGTH_UNLIMITED))->build()); + struct_type_builder->add_member(member_descriptor); + dynamic_pub_sub_type_.reset(new DynamicPubSubType(struct_type_builder->build())); // Register the data type if (RETCODE_OK != dynamic_pub_sub_type_.register_type(participant_)) @@ -988,7 +994,7 @@ bool LatencyTestSubscriber::destroy_data_endpoints() latency_data_type_.reset(); dynamic_pub_sub_type_.reset(); - eprosima::fastrtps::types::DynamicTypeBuilderFactory::delete_instance(); + DynamicTypeBuilderFactory::delete_instance(); return true; } diff --git a/test/performance/latency/LatencyTestSubscriber.hpp b/test/performance/latency/LatencyTestSubscriber.hpp index 958f7e94cbc..8d1f45d3583 100644 --- a/test/performance/latency/LatencyTestSubscriber.hpp +++ b/test/performance/latency/LatencyTestSubscriber.hpp @@ -29,15 +29,7 @@ #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include #include "LatencyTestTypes.hpp" #include "../optionarg.hpp" @@ -150,7 +142,7 @@ class LatencyTestSubscriber eprosima::fastdds::dds::TypeSupport latency_command_type_; /* Dynamic Types */ - eprosima::fastrtps::types::DynamicData* dynamic_data_ = nullptr; + eprosima::fastdds::dds::DynamicData::_ref_type* dynamic_data_ {nullptr}; eprosima::fastdds::dds::TypeSupport dynamic_pub_sub_type_; std::vector data_size_sub_; diff --git a/test/performance/latency/LatencyTestTypes.cpp b/test/performance/latency/LatencyTestTypes.cpp index 1812c973d22..350e36c149e 100644 --- a/test/performance/latency/LatencyTestTypes.cpp +++ b/test/performance/latency/LatencyTestTypes.cpp @@ -38,7 +38,7 @@ bool LatencyDataType::compare_data( return false; } - // bouncing time is ignored on comparisson + // bouncing time is ignored on comparison return 0 == memcmp(lt1.data, lt2.data, buffer_size_); } diff --git a/test/performance/throughput/ThroughputPublisher.cpp b/test/performance/throughput/ThroughputPublisher.cpp index 47fce4fca44..b6d610d3fc4 100644 --- a/test/performance/throughput/ThroughputPublisher.cpp +++ b/test/performance/throughput/ThroughputPublisher.cpp @@ -32,6 +32,11 @@ #include #include #include +#include +#include +#include +#include +#include #include #include #include @@ -424,7 +429,7 @@ void ThroughputPublisher::run( uint32_t test_time, uint32_t recovery_time_ms, int demand, - int msg_size, + uint32_t msg_size, uint32_t subscribers) { subscribers_ = subscribers; @@ -545,27 +550,25 @@ void ThroughputPublisher::run( { assert(nullptr == dynamic_data_); // Create the data sample - eprosima::fastrtps::types::MemberId id; - dynamic_data_ = static_cast(dynamic_pub_sub_type_->createData()); + dynamic_data_ = static_cast(dynamic_pub_sub_type_->createData()); if (nullptr == dynamic_data_) { EPROSIMA_LOG_ERROR(THROUGHPUTPUBLISHER, - "Iteration failed: Failed to create eprosima::fastrtps::types::Dynamic Data"); + "Iteration failed: Failed to create Dynamic Data"); return; } // Modify the data Sample - dynamic_data_->set_uint32_value(0, 0); - eprosima::fastrtps::types::DynamicData* member_data = dynamic_data_->loan_value( - dynamic_data_->get_member_id_at_index(1)); + (*dynamic_data_)->set_uint32_value(0, 0); + DynamicData::_ref_type member_data = (*dynamic_data_)->loan_value( + (*dynamic_data_)->get_member_id_at_index(1)); - for (int i = 0; i < msg_size; ++i) + for (uint32_t i = 0; i < msg_size; ++i) { - member_data->insert_sequence_data(id); - member_data->set_byte_value(0, id); + member_data->set_byte_value(i, 0); } - dynamic_data_->return_loaned_value(member_data); + (*dynamic_data_)->return_loaned_value(member_data); } else { @@ -640,7 +643,7 @@ void ThroughputPublisher::run( // Delete the Data Sample if (dynamic_types_) { - eprosima::fastrtps::types::DynamicDataFactory::get_instance()->delete_data(dynamic_data_); + dynamic_pub_sub_type_.delete_data(dynamic_data_); dynamic_data_ = nullptr; } else @@ -737,7 +740,7 @@ bool ThroughputPublisher::test( { if (dynamic_types_) { - dynamic_data_->set_uint32_value(++seqnum, 0); + (*dynamic_data_)->set_uint32_value(0, ++seqnum); data_writer_->write(dynamic_data_); } else if (data_loans_) @@ -1040,20 +1043,24 @@ bool ThroughputPublisher::init_dynamic_types() } // Dummy type registration + DynamicTypeBuilderFactory::_ref_type factory {DynamicTypeBuilderFactory::get_instance()}; // Create basic builders - eprosima::fastrtps::types::DynamicTypeBuilder_ptr struct_type_builder(eprosima::fastrtps::types:: - DynamicTypeBuilderFactory::get_instance()-> - create_struct_builder()); + TypeDescriptor::_ref_type type_descriptor {traits::make_shared()}; + type_descriptor->kind(TK_STRUCTURE); + type_descriptor->name(ThroughputDataType::type_name_); + + DynamicTypeBuilder::_ref_type struct_type_builder {factory->create_type(type_descriptor)}; // Add members to the struct. - struct_type_builder->add_member(0, "seqnum", - eprosima::fastrtps::types::DynamicTypeBuilderFactory::get_instance()->create_uint32_type()); - struct_type_builder->add_member(1, "data", - eprosima::fastrtps::types::DynamicTypeBuilderFactory::get_instance()->create_sequence_builder( - eprosima::fastrtps::types::DynamicTypeBuilderFactory::get_instance()->create_byte_type(), - eprosima::fastrtps::types::BOUND_UNLIMITED)); - struct_type_builder->set_name(ThroughputDataType::type_name_); - dynamic_pub_sub_type_.reset(new eprosima::fastrtps::types::DynamicPubSubType(struct_type_builder->build())); + MemberDescriptor::_ref_type member_descriptor {traits::make_shared()}; + member_descriptor->name("seqnum"); + member_descriptor->type(factory->get_primitive_type(TK_UINT32)); + struct_type_builder->add_member(member_descriptor); + member_descriptor->name("data"); + member_descriptor->type(factory->create_sequence_type( + factory->get_primitive_type(TK_BYTE), static_cast(LENGTH_UNLIMITED))->build()); + struct_type_builder->add_member(member_descriptor); + dynamic_pub_sub_type_.reset(new DynamicPubSubType(struct_type_builder->build())); // Register the data type if (RETCODE_OK diff --git a/test/performance/throughput/ThroughputPublisher.hpp b/test/performance/throughput/ThroughputPublisher.hpp index 9ce65eeaeb6..8505369a865 100644 --- a/test/performance/throughput/ThroughputPublisher.hpp +++ b/test/performance/throughput/ThroughputPublisher.hpp @@ -34,17 +34,8 @@ #include #include #include +#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include "../optionarg.hpp" #include "ThroughputTypes.hpp" @@ -79,7 +70,7 @@ class ThroughputPublisher uint32_t test_time, uint32_t recovery_time_ms, int demand, - int msg_size, + uint32_t msg_size, uint32_t subscribers); private: @@ -135,7 +126,7 @@ class ThroughputPublisher ThroughputType* throughput_data_ = nullptr; eprosima::fastdds::dds::TypeSupport throughput_data_type_; // Dynamic Data - eprosima::fastrtps::types::DynamicData* dynamic_data_ = nullptr; + eprosima::fastdds::dds::DynamicData::_ref_type* dynamic_data_ {nullptr}; eprosima::fastdds::dds::TypeSupport dynamic_pub_sub_type_; // QoS Profiles eprosima::fastdds::dds::DataWriterQos dw_qos_; diff --git a/test/performance/throughput/ThroughputSubscriber.cpp b/test/performance/throughput/ThroughputSubscriber.cpp index bb2cc83065f..504c494311b 100644 --- a/test/performance/throughput/ThroughputSubscriber.cpp +++ b/test/performance/throughput/ThroughputSubscriber.cpp @@ -30,6 +30,11 @@ #include #include #include +#include +#include +#include +#include +#include #include #include #include @@ -145,9 +150,16 @@ void ThroughputSubscriber::DataReaderListener::on_data_available( { if (info_.valid_data) { - uint32_t seq_num = sub.dynamic_types_ - ? sub.dynamic_data_->get_uint32_value(0) - : sub.throughput_data_->seqnum; + uint32_t seq_num {0}; + + if (sub.dynamic_types_) + { + (*sub.dynamic_data_)->get_uint32_value(seq_num, 0); + } + else + { + seq_num = sub.throughput_data_->seqnum; + } if ((last_seq_num_ + 1) < seq_num) { @@ -546,27 +558,25 @@ int ThroughputSubscriber::process_message() assert(nullptr == dynamic_data_); // Create the data sample - eprosima::fastrtps::types::MemberId id; dynamic_data_ = - static_cast(dynamic_pub_sub_type_->createData()); + static_cast(dynamic_pub_sub_type_->createData()); if (nullptr == dynamic_data_) { EPROSIMA_LOG_ERROR(THROUGHPUTSUBSCRIBER, - "Iteration failed: Failed to create eprosima::fastrtps::types::Dynamic Data"); + "Iteration failed: Failed to create Dynamic Data"); return 2; } // Modify the data Sample - eprosima::fastrtps::types::DynamicData* member_data = dynamic_data_->loan_value( - dynamic_data_->get_member_id_at_index(1)); + DynamicData::_ref_type member_data = (*dynamic_data_)->loan_value( + (*dynamic_data_)->get_member_id_at_index(1)); for (uint32_t i = 0; i < command.m_size; ++i) { - member_data->insert_sequence_data(id); - member_data->set_byte_value(0, id); + member_data->set_byte_value(i, 0); } - dynamic_data_->return_loaned_value(member_data); + (*dynamic_data_)->return_loaned_value(member_data); } else { @@ -675,7 +685,7 @@ int ThroughputSubscriber::process_message() // Remove the dynamic_data_ object, protect form ongoing callbacks if (dynamic_types_) { - eprosima::fastrtps::types::DynamicDataFactory::get_instance()->delete_data(dynamic_data_); + dynamic_pub_sub_type_.delete_data(dynamic_data_); dynamic_data_ = nullptr; } else @@ -817,20 +827,24 @@ bool ThroughputSubscriber::init_dynamic_types() } // Dummy type registration + DynamicTypeBuilderFactory::_ref_type factory {DynamicTypeBuilderFactory::get_instance()}; // Create basic builders - eprosima::fastrtps::types::DynamicTypeBuilder_ptr struct_type_builder(eprosima::fastrtps::types:: - DynamicTypeBuilderFactory::get_instance()-> - create_struct_builder()); + TypeDescriptor::_ref_type type_descriptor {traits::make_shared()}; + type_descriptor->kind(TK_STRUCTURE); + type_descriptor->name(ThroughputDataType::type_name_); + + DynamicTypeBuilder::_ref_type struct_type_builder {factory->create_type(type_descriptor)}; // Add members to the struct. - struct_type_builder->add_member(0, "seqnum", - eprosima::fastrtps::types::DynamicTypeBuilderFactory::get_instance()->create_uint32_type()); - struct_type_builder->add_member(1, "data", - eprosima::fastrtps::types::DynamicTypeBuilderFactory::get_instance()->create_sequence_builder( - eprosima::fastrtps::types::DynamicTypeBuilderFactory::get_instance()->create_byte_type(), - eprosima::fastrtps::types::BOUND_UNLIMITED)); - struct_type_builder->set_name(ThroughputDataType::type_name_); - dynamic_pub_sub_type_.reset(new eprosima::fastrtps::types::DynamicPubSubType(struct_type_builder->build())); + MemberDescriptor::_ref_type member_descriptor {traits::make_shared()}; + member_descriptor->name("seqnum"); + member_descriptor->type(factory->get_primitive_type(TK_UINT32)); + struct_type_builder->add_member(member_descriptor); + member_descriptor->name("data"); + member_descriptor->type(factory->create_sequence_type( + factory->get_primitive_type(TK_BYTE), static_cast(LENGTH_UNLIMITED))->build()); + struct_type_builder->add_member(member_descriptor); + dynamic_pub_sub_type_.reset(new DynamicPubSubType(struct_type_builder->build())); // Register the data type if (RETCODE_OK diff --git a/test/performance/throughput/ThroughputSubscriber.hpp b/test/performance/throughput/ThroughputSubscriber.hpp index dbe07747b80..be2f6b595d6 100644 --- a/test/performance/throughput/ThroughputSubscriber.hpp +++ b/test/performance/throughput/ThroughputSubscriber.hpp @@ -32,16 +32,9 @@ #include #include #include +#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "ThroughputTypes.hpp" #include "../optionarg.hpp" #include "ThroughputTypes.hpp" @@ -119,7 +112,7 @@ class ThroughputSubscriber ThroughputType* throughput_data_ = nullptr; eprosima::fastdds::dds::TypeSupport throughput_data_type_; // Dynamic Data - eprosima::fastrtps::types::DynamicData* dynamic_data_ = nullptr; + eprosima::fastdds::dds::DynamicData::_ref_type* dynamic_data_ {nullptr}; eprosima::fastdds::dds::TypeSupport dynamic_pub_sub_type_; // QoS Profiles eprosima::fastdds::dds::DataReaderQos dr_qos_; diff --git a/test/performance/throughput/main_ThroughputTest.cpp b/test/performance/throughput/main_ThroughputTest.cpp index 13713991514..33b6dd01d1f 100644 --- a/test/performance/throughput/main_ThroughputTest.cpp +++ b/test/performance/throughput/main_ThroughputTest.cpp @@ -154,7 +154,7 @@ int main( uint32_t test_time_sec = 5; uint32_t recovery_time_ms = 5; int demand = 10000; - int msg_size = 1024; + uint32_t msg_size = 1024; bool reliable = false; uint32_t seed = 80; bool hostname = false; @@ -262,7 +262,7 @@ int main( break; case MSG_SIZE: - msg_size = strtol(opt.arg, nullptr, 10); + msg_size = strtoul(opt.arg, nullptr, 10); break; case FILE_R: diff --git a/test/profiling/MemoryTestPublisher.cpp b/test/profiling/MemoryTestPublisher.cpp index eb31bdb9118..7c8fa03c446 100644 --- a/test/profiling/MemoryTestPublisher.cpp +++ b/test/profiling/MemoryTestPublisher.cpp @@ -25,9 +25,15 @@ #include #include -#include +#include +#include #include #include +#include +#include +#include +#include +#include #ifndef _WIN32 #define localtime_s(X, Y) localtime_r(Y, X) @@ -35,42 +41,18 @@ #define TIME_LIMIT_US 10000 -using namespace eprosima; -using namespace eprosima::fastrtps; -using namespace eprosima::fastrtps::rtps; -using namespace eprosima::fastrtps::types; - -using std::cout; -using std::endl; +using namespace eprosima::fastdds::dds; MemoryTestPublisher::MemoryTestPublisher() - : mp_participant(nullptr) - , mp_datapub(nullptr) - , mp_commandpub(nullptr) - , mp_commandsub(nullptr) - , n_subscribers(0) - , n_samples(0) - , disc_count_(0) - , comm_count_(0) - , data_count_(0) - , m_status(0) - , n_received(0) - , m_datapublistener(nullptr) - , m_commandpublistener(nullptr) - , m_commandsublistener(nullptr) - , m_data_size(0) - , dynamic_data(false) - , mp_memory(nullptr) { - m_datapublistener.mp_up = this; - m_commandpublistener.mp_up = this; - m_commandsublistener.mp_up = this; - m_exportPrefix = ""; + m_datapublistener.up_ = this; + m_commandpublistener.up_ = this; + m_commandsublistener.up_ = this; } MemoryTestPublisher::~MemoryTestPublisher() { - Domain::removeParticipant(mp_participant); + participant_->delete_contained_entities(); } bool MemoryTestPublisher::init( @@ -81,8 +63,8 @@ bool MemoryTestPublisher::init( bool hostname, bool export_csv, const std::string& export_prefix, - const PropertyPolicy& part_property_policy, - const PropertyPolicy& property_policy, + const eprosima::fastrtps::rtps::PropertyPolicy& part_property_policy, + const eprosima::fastrtps::rtps::PropertyPolicy& property_policy, const std::string& sXMLConfigFile, uint32_t data_size, bool dynamic_types) @@ -94,103 +76,127 @@ bool MemoryTestPublisher::init( m_exportPrefix = export_prefix; reliable_ = reliable; m_data_size = data_size; - dynamic_data = dynamic_types; + dynamic_data_ = dynamic_types; - if (dynamic_data) // Dummy type registration + if (dynamic_data_) // Dummy type registration { + DynamicTypeBuilderFactory::_ref_type factory {DynamicTypeBuilderFactory::get_instance()}; + // Create basic builders - DynamicTypeBuilder_ptr struct_type_builder(DynamicTypeBuilderFactory::get_instance()->create_struct_builder()); + TypeDescriptor::_ref_type type_descriptor {traits::make_shared()}; + type_descriptor->kind(TK_STRUCTURE); + type_descriptor->name("MemoryType"); + DynamicTypeBuilder::_ref_type struct_type_builder(factory->create_type(type_descriptor)); // Add members to the struct. - struct_type_builder->add_member(0, "seqnum", DynamicTypeBuilderFactory::get_instance()->create_uint32_type()); - struct_type_builder->add_member(1, "data", - DynamicTypeBuilderFactory::get_instance()->create_sequence_builder( - DynamicTypeBuilderFactory::get_instance()->create_byte_type(), ::dds::core::LENGTH_UNLIMITED - )); - struct_type_builder->set_name("MemoryType"); + MemberDescriptor::_ref_type member_descriptor {traits::make_shared()}; + member_descriptor->type(factory->get_primitive_type(eprosima::fastdds::dds::TK_UINT32)); + member_descriptor->name("seqnum"); + struct_type_builder->add_member(member_descriptor); + member_descriptor = traits::make_shared(); + member_descriptor->type(factory->create_sequence_type(factory->get_primitive_type(eprosima::fastdds::dds:: + TK_BYTE), static_cast(LENGTH_UNLIMITED))->build()); + member_descriptor->name("data"); + struct_type_builder->add_member(member_descriptor); m_pDynType = struct_type_builder->build(); - m_DynType.SetDynamicType(m_pDynType); } // Create RTPSParticipant std::string participant_profile_name = "participant_profile"; - ParticipantAttributes PParam; - PParam.domainId = pid % 230; - PParam.rtps.properties = part_property_policy; - PParam.rtps.setName("Participant_pub"); + DomainParticipantQos participant_qos; + participant_qos.name("MemoryTest_Participant_Publisher"); + participant_qos.properties(part_property_policy); if (m_sXMLConfigFile.length() > 0) { - mp_participant = Domain::createParticipant(participant_profile_name); + participant_ = DomainParticipantFactory::get_instance()->create_participant_with_profile(pid % 230, + participant_profile_name); } else { - mp_participant = Domain::createParticipant(PParam); + participant_ = DomainParticipantFactory::get_instance()->create_participant(pid % 230, participant_qos); } - if (mp_participant == nullptr) + if (nullptr == participant_) { return false; } // Register the type - if (dynamic_data) + if (dynamic_data_) { - Domain::registerType(mp_participant, &m_DynType); + dynamic_type_support_ = new DynamicPubSubType(m_pDynType); + data_type_ = TypeSupport{dynamic_type_support_}; } else { - Domain::registerType(mp_participant, (TopicDataType*)&memory_t); + data_type_ = TypeSupport{new MemoryDataType()}; } - Domain::registerType(mp_participant, (TopicDataType*)&command_t); + participant_->register_type(data_type_); + participant_->register_type(command_type_); - // Create Sending Publisher - std::string profile_name = "publisher_profile"; - PublisherAttributes PubDataparam; - PubDataparam.topic.topicDataType = "MemoryType"; - PubDataparam.topic.topicKind = NO_KEY; - std::ostringstream pt; - pt << "MemoryTest_"; + publisher_ = participant_->create_publisher(PUBLISHER_QOS_DEFAULT); + + if (nullptr == publisher_) + { + return false; + } + + subscriber_ = participant_->create_subscriber(SUBSCRIBER_QOS_DEFAULT); + + if (nullptr == subscriber_) + { + return false; + } + + std::ostringstream st; + st << "MemoryTest_"; if (hostname) { - pt << asio::ip::host_name() << "_"; + st << asio::ip::host_name() << "_"; } - pt << pid << "_PUB2SUB"; - PubDataparam.topic.topicName = pt.str(); + st << pid << "_PUB2SUB"; + data_topic_ = participant_->create_topic(st.str(), "MemoryType", TOPIC_QOS_DEFAULT); + + if (nullptr == data_topic_) + { + return false; + } + + // Create Sending Publisher + std::string profile_name = "publisher_profile"; + DataWriterQos writer_qos; if (!reliable) { - PubDataparam.qos.m_reliability.kind = BEST_EFFORT_RELIABILITY_QOS; + writer_qos.reliability().kind = BEST_EFFORT_RELIABILITY_QOS; } - PubDataparam.properties = property_policy; + writer_qos.properties(property_policy); + if (m_data_size > 60000) { - PubDataparam.historyMemoryPolicy = eprosima::fastrtps::rtps::PREALLOCATED_WITH_REALLOC_MEMORY_MODE; - PubDataparam.qos.m_publishMode.kind = - eprosima::fastdds::dds::PublishModeQosPolicyKind::ASYNCHRONOUS_PUBLISH_MODE; + writer_qos.endpoint().history_memory_policy = + eprosima::fastrtps::rtps::MemoryManagementPolicy::PREALLOCATED_WITH_REALLOC_MEMORY_MODE; + writer_qos.publish_mode().kind = ASYNCHRONOUS_PUBLISH_MODE; } if (m_sXMLConfigFile.length() > 0) { - mp_datapub = - Domain::createPublisher(mp_participant, profile_name, (PublisherListener*)&this->m_datapublistener); + data_writer_ = publisher_->create_datawriter_with_profile(data_topic_, profile_name, &this->m_datapublistener); } else { - mp_datapub = - Domain::createPublisher(mp_participant, PubDataparam, (PublisherListener*)&this->m_datapublistener); + data_writer_ = publisher_->create_datawriter(data_topic_, writer_qos, &this->m_datapublistener); } - if (mp_datapub == nullptr) + if (nullptr == data_writer_) { return false; } + std::cout << "Publisher created" << std::endl; //COMMAND PUBLISHER - PublisherAttributes PubCommandParam; - PubCommandParam.topic.topicDataType = "TestCommandType"; - PubCommandParam.topic.topicKind = NO_KEY; std::ostringstream pct; pct << "MemoryTest_Command_"; if (hostname) @@ -198,22 +204,26 @@ bool MemoryTestPublisher::init( pct << asio::ip::host_name() << "_"; } pct << pid << "_PUB2SUB"; - PubCommandParam.topic.topicName = pct.str(); - PubCommandParam.topic.historyQos.kind = KEEP_ALL_HISTORY_QOS; - PubCommandParam.qos.m_durability.kind = TRANSIENT_LOCAL_DURABILITY_QOS; - PubCommandParam.qos.m_reliability.kind = RELIABLE_RELIABILITY_QOS; - PubCommandParam.qos.m_publishMode.kind = eprosima::fastdds::dds::PublishModeQosPolicyKind::SYNCHRONOUS_PUBLISH_MODE; + command_pub_topic_ = participant_->create_topic(pct.str(), "TestCommandType", TOPIC_QOS_DEFAULT); + + if (nullptr == command_pub_topic_) + { + return false; + } + + DataWriterQos command_writer_qos; + command_writer_qos.history().kind = KEEP_ALL_HISTORY_QOS; + command_writer_qos.durability().kind = TRANSIENT_LOCAL_DURABILITY_QOS; + command_writer_qos.reliability().kind = RELIABLE_RELIABILITY_QOS; - mp_commandpub = Domain::createPublisher(mp_participant, PubCommandParam, &this->m_commandpublistener); + command_writer_ = publisher_->create_datawriter(command_pub_topic_, command_writer_qos, + &this->m_commandpublistener); - if (mp_commandpub == nullptr) + if (nullptr == command_writer_) { return false; } - SubscriberAttributes SubCommandParam; - SubCommandParam.topic.topicDataType = "TestCommandType"; - SubCommandParam.topic.topicKind = NO_KEY; std::ostringstream sct; sct << "MemoryTest_Command_"; if (hostname) @@ -221,140 +231,132 @@ bool MemoryTestPublisher::init( sct << asio::ip::host_name() << "_"; } sct << pid << "_SUB2PUB"; - SubCommandParam.topic.topicName = sct.str(); - SubCommandParam.topic.historyQos.kind = KEEP_ALL_HISTORY_QOS; - SubCommandParam.qos.m_reliability.kind = RELIABLE_RELIABILITY_QOS; - SubCommandParam.qos.m_durability.kind = TRANSIENT_LOCAL_DURABILITY_QOS; + command_sub_topic_ = participant_->create_topic(sct.str(), "TestCommandType", TOPIC_QOS_DEFAULT); - mp_commandsub = Domain::createSubscriber(mp_participant, SubCommandParam, &this->m_commandsublistener); - - if (mp_commandsub == nullptr) + if (nullptr == command_sub_topic_) { return false; } - if (dynamic_data) + DataReaderQos reader_qos; + reader_qos.history().kind = KEEP_ALL_HISTORY_QOS; + reader_qos.durability().kind = TRANSIENT_LOCAL_DURABILITY_QOS; + reader_qos.reliability().kind = RELIABLE_RELIABILITY_QOS; + + command_reader_ = subscriber_->create_datareader(command_sub_topic_, reader_qos, &this->m_commandsublistener); + + if (nullptr == command_reader_) { - DynamicTypeBuilderFactory::delete_instance(); - pubAttr = mp_datapub->getAttributes(); - Domain::removePublisher(mp_datapub); - Domain::unregisterType(mp_participant, "MemoryType"); // Unregister as we will register it later with correct size + return false; } return true; } -void MemoryTestPublisher::DataPubListener::onPublicationMatched( - Publisher* /*pub*/, - MatchingInfo& info) +void MemoryTestPublisher::DataPubListener::on_publication_matched( + DataWriter*, + const PublicationMatchedStatus& info) { - std::unique_lock lock(mp_up->mutex_); + std::unique_lock lock(up_->mutex_); - if (info.status == MATCHED_MATCHING) + if (0 < info.current_count_change) { - cout << C_MAGENTA << "Data Pub Matched " << C_DEF << endl; + std::cout << C_MAGENTA << "Data Pub Matched " << C_DEF << std::endl; - n_matched++; - if (n_matched > mp_up->n_subscribers) + n_matched = info.total_count; + if (n_matched > up_->n_subscribers) { std::cout << "More matched subscribers than expected" << std::endl; - mp_up->m_status = -1; + up_->m_status = -1; } - ++mp_up->disc_count_; } else { - cout << C_MAGENTA << "Data Pub Unmatched " << C_DEF << endl; - --mp_up->disc_count_; + std::cout << C_MAGENTA << "Data Pub Unmatched " << C_DEF << std::endl; } + up_->disc_count_ += info.current_count_change; lock.unlock(); - mp_up->disc_cond_.notify_one(); + up_->disc_cond_.notify_one(); } -void MemoryTestPublisher::CommandPubListener::onPublicationMatched( - Publisher* /*pub*/, - MatchingInfo& info) +void MemoryTestPublisher::CommandPubListener::on_publication_matched( + DataWriter*, + const PublicationMatchedStatus& info) { - std::unique_lock lock(mp_up->mutex_); + std::unique_lock lock(up_->mutex_); - if (info.status == MATCHED_MATCHING) + if (0 < info.current_count_change) { - cout << C_MAGENTA << "Command Pub Matched " << C_DEF << endl; + std::cout << C_MAGENTA << "Command Pub Matched " << C_DEF << std::endl; - n_matched++; - if (n_matched > mp_up->n_subscribers) + n_matched = info.total_count; + if (n_matched > up_->n_subscribers) { std::cout << "More matched subscribers than expected" << std::endl; - mp_up->m_status = -1; + up_->m_status = -1; } - - ++mp_up->disc_count_; } else { - cout << C_MAGENTA << "Command Pub unmatched " << C_DEF << endl; - --mp_up->disc_count_; + std::cout << C_MAGENTA << "Command Pub unmatched " << C_DEF << std::endl; } + up_->disc_count_ += info.current_count_change; lock.unlock(); - mp_up->disc_cond_.notify_one(); + up_->disc_cond_.notify_one(); } -void MemoryTestPublisher::CommandSubListener::onSubscriptionMatched( - Subscriber* /*sub*/, - MatchingInfo& info) +void MemoryTestPublisher::CommandSubListener::on_subscription_matched( + DataReader*, + const SubscriptionMatchedStatus& info) { - std::unique_lock lock(mp_up->mutex_); + std::unique_lock lock(up_->mutex_); - if (info.status == MATCHED_MATCHING) + if (0 < info.current_count_change) { - cout << C_MAGENTA << "Command Sub Matched " << C_DEF << endl; + std::cout << C_MAGENTA << "Command Sub Matched " << C_DEF << std::endl; - n_matched++; - if (n_matched > mp_up->n_subscribers) + n_matched = info.total_count; + if (n_matched > up_->n_subscribers) { std::cout << "More matched subscribers than expected" << std::endl; - mp_up->m_status = -1; + up_->m_status = -1; } - - ++mp_up->disc_count_; } else { - cout << C_MAGENTA << "Command Sub unmatched " << C_DEF << endl; - --mp_up->disc_count_; + std::cout << C_MAGENTA << "Command Sub unmatched " << C_DEF << std::endl; } + up_->disc_count_ += info.current_count_change; lock.unlock(); - mp_up->disc_cond_.notify_one(); + up_->disc_cond_.notify_one(); } -void MemoryTestPublisher::CommandSubListener::onNewDataMessage( - Subscriber* subscriber) +void MemoryTestPublisher::CommandSubListener::on_data_available( + DataReader* reader) { TestCommandType command; - SampleInfo_t info; - // cout << "COMMAND RECEIVED"<takeNextData((void*)&command, &info)) + SampleInfo info; + + if (RETCODE_OK == reader->take_next_sample((void*)&command, &info)) { - if (info.sampleKind == ALIVE) + if (ALIVE_INSTANCE_STATE == info.instance_state) { - //cout << "ALIVE "<mutex_.lock(); - ++mp_up->comm_count_; - mp_up->mutex_.unlock(); - mp_up->comm_cond_.notify_one(); + up_->mutex_.lock(); + ++up_->comm_count_; + up_->mutex_.unlock(); + up_->comm_cond_.notify_one(); } } } else { - cout << "Problem reading" << endl; + std::cout << "Problem reading" << std::endl; } } @@ -366,62 +368,37 @@ void MemoryTestPublisher::run( std::unique_lock disc_lock(mutex_); disc_cond_.wait(disc_lock, [&]() { + std::cout << "m = " << disc_count_ << " - su = " << n_subscribers << std::endl; return disc_count_ >= (n_subscribers * 3); }); disc_lock.unlock(); test(test_time, m_data_size); std::this_thread::sleep_for(std::chrono::milliseconds(100)); - - cout << "REMOVING PUBLISHER" << endl; - Domain::removePublisher(this->mp_commandpub); - cout << "REMOVING SUBSCRIBER" << endl; - Domain::removeSubscriber(mp_commandsub); } bool MemoryTestPublisher::test( uint32_t test_time, uint32_t datasize) { - //cout << "Beginning test of size: "<create_struct_builder()); - - // Add members to the struct. - struct_type_builder->add_member(0, "seqnum", DynamicTypeBuilderFactory::get_instance()->create_uint32_type()); - struct_type_builder->add_member(1, "data", - DynamicTypeBuilderFactory::get_instance()->create_sequence_builder( - DynamicTypeBuilderFactory::get_instance()->create_byte_type(), datasize - )); - struct_type_builder->set_name("MemoryType"); - - m_pDynType = struct_type_builder->build(); - m_DynType.CleanDynamicType(); - m_DynType.SetDynamicType(m_pDynType); - - Domain::registerType(mp_participant, &m_DynType); - - mp_datapub = Domain::createPublisher(mp_participant, pubAttr, &m_datapublistener); - m_DynData = DynamicDataFactory::get_instance()->create_data(m_pDynType); - MemberId id; - DynamicData* my_data = m_DynData->loan_value(m_DynData->get_member_id_at_index(1)); + DynamicData::_ref_type my_data = m_DynData->loan_value(m_DynData->get_member_id_at_index(1)); for (uint32_t i = 0; i < datasize; ++i) { - my_data->insert_sequence_data(id); - my_data->set_byte_value(0, id); + my_data->set_byte_value(i, 0); } m_DynData->return_loaned_value(my_data); } else { - mp_memory = new MemoryType(datasize); + memory_ = new MemoryType(datasize); } std::chrono::duration test_time_us = std::chrono::seconds(test_time); auto t_end_ = std::chrono::steady_clock::now(); @@ -433,13 +410,12 @@ bool MemoryTestPublisher::test( return disc_count_ >= (n_subscribers * 3); }); disc_lock.unlock(); - cout << C_B_MAGENTA << "DISCOVERY COMPLETE " << C_DEF << endl; + std::cout << C_B_MAGENTA << "DISCOVERY COMPLETE " << C_DEF << std::endl; TestCommandType command; command.m_command = READY; - mp_commandpub->write(&command); + command_writer_->write(&command); - //cout << "WAITING FOR COMMAND RESPONSES "< lock(mutex_); comm_cond_.wait(lock, [&]() { @@ -447,7 +423,6 @@ bool MemoryTestPublisher::test( }); --comm_count_; lock.unlock(); - //cout << endl; //BEGIN THE TEST: auto t_start_ = std::chrono::steady_clock::now(); @@ -456,44 +431,39 @@ bool MemoryTestPublisher::test( { for (unsigned int count = 1; count <= n_samples; ++count) { - if (dynamic_data) + if (dynamic_data_) { - m_DynData->set_uint32_value(count, 0); - mp_datapub->write((void*)m_DynData); + m_DynData->set_uint32_value(0, count); + data_writer_->write(&m_DynData); } else { - mp_memory->seqnum = count; - mp_datapub->write((void*)mp_memory); + memory_->seqnum = count; + data_writer_->write((void*)memory_); } } t_end_ = std::chrono::steady_clock::now(); } command.m_command = STOP; - mp_commandpub->write(&command); + command_writer_->write(&command); if (m_status != 0) { - cout << "Error in test " << endl; + std::cout << "Error in test " << std::endl; return false; } //TEST FINISHED: - size_t removed = 0; - mp_datapub->removeAllChange(&removed); - //cout << " REMOVED: "<< removed<clear_history(&removed); - if (dynamic_data) + if (dynamic_data_) { - DynamicTypeBuilderFactory::delete_instance(); DynamicDataFactory::get_instance()->delete_data(m_DynData); - pubAttr = mp_datapub->getAttributes(); - Domain::removePublisher(mp_datapub); - Domain::unregisterType(mp_participant, "MemoryType"); } else { - delete(mp_memory); + delete(memory_); } return true; diff --git a/test/profiling/MemoryTestPublisher.h b/test/profiling/MemoryTestPublisher.h index 869937fd9f8..1529f9063d0 100644 --- a/test/profiling/MemoryTestPublisher.h +++ b/test/profiling/MemoryTestPublisher.h @@ -20,99 +20,158 @@ #ifndef MEMORYPUBLISHER_H_ #define MEMORYPUBLISHER_H_ +#include +#include + #include -#include "MemoryTestTypes.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -#include -#include +#include "MemoryTestTypes.h" -class MemoryTestPublisher { +class MemoryTestPublisher +{ public: + MemoryTestPublisher(); virtual ~MemoryTestPublisher(); - eprosima::fastrtps::Participant* mp_participant; - eprosima::fastrtps::Publisher* mp_datapub; - eprosima::fastrtps::Publisher* mp_commandpub; - eprosima::fastrtps::Subscriber* mp_commandsub; - int n_subscribers; - unsigned int n_samples; - eprosima::fastrtps::SampleInfo_t m_sampleinfo; + eprosima::fastdds::dds::DomainParticipant* participant_ {nullptr}; + eprosima::fastdds::dds::Publisher* publisher_ {nullptr}; + eprosima::fastdds::dds::Subscriber* subscriber_ {nullptr}; + eprosima::fastdds::dds::TypeSupport command_type_ {new TestCommandDataType()}; + eprosima::fastdds::dds::TypeSupport data_type_; + eprosima::fastdds::dds::Topic* command_pub_topic_ {nullptr}; + eprosima::fastdds::dds::Topic* command_sub_topic_ {nullptr}; + eprosima::fastdds::dds::Topic* data_topic_ {nullptr}; + eprosima::fastdds::dds::DataWriter* command_writer_ {nullptr}; + eprosima::fastdds::dds::DataWriter* data_writer_ {nullptr}; + eprosima::fastdds::dds::DataReader* command_reader_ {nullptr}; + int n_subscribers {0}; + unsigned int n_samples {0}; std::mutex mutex_; - int disc_count_; + int disc_count_ {0}; std::condition_variable disc_cond_; - int comm_count_; + int comm_count_ {0}; std::condition_variable comm_cond_; - int data_count_; + int data_count_ {0}; std::condition_variable data_cond_; - int m_status; - unsigned int n_received; - bool n_export_csv; + int m_status {0}; + unsigned int n_received {0}; + bool n_export_csv {false}; std::string m_exportPrefix; - bool init(int n_sub, int n_sam, bool reliable, uint32_t pid, bool hostname, bool export_csv, - const std::string& export_prefix, - const eprosima::fastrtps::rtps::PropertyPolicy& part_property_policy, - const eprosima::fastrtps::rtps::PropertyPolicy& property_policy, - const std::string& sXMLConfigFile, uint32_t data_size, bool dynamic_types); - void run(uint32_t test_time); - bool test(uint32_t test_time, uint32_t datasize); - - class DataPubListener : public eprosima::fastrtps::PublisherListener + + bool init( + int n_sub, + int n_sam, + bool reliable, + uint32_t pid, + bool hostname, + bool export_csv, + const std::string& export_prefix, + const eprosima::fastrtps::rtps::PropertyPolicy& part_property_policy, + const eprosima::fastrtps::rtps::PropertyPolicy& property_policy, + const std::string& sXMLConfigFile, + uint32_t data_size, + bool dynamic_types); + void run( + uint32_t test_time); + bool test( + uint32_t test_time, + uint32_t datasize); + + class DataPubListener : public eprosima::fastdds::dds::DataWriterListener { public: - DataPubListener(MemoryTestPublisher* up) :mp_up(up), n_matched(0) {} - ~DataPubListener() {} - void onPublicationMatched(eprosima::fastrtps::Publisher* pub, - eprosima::fastrtps::rtps::MatchingInfo& info); - MemoryTestPublisher* mp_up; - int n_matched; - } m_datapublistener; - - class CommandPubListener : public eprosima::fastrtps::PublisherListener + + DataPubListener( + MemoryTestPublisher* up) + : up_(up) + { + } + + ~DataPubListener() = default; + + void on_publication_matched( + eprosima::fastdds::dds::DataWriter* writer, + const eprosima::fastdds::dds::PublicationMatchedStatus& info) override; + + MemoryTestPublisher* up_ {nullptr}; + + int n_matched {0}; + } + m_datapublistener {nullptr}; + + class CommandPubListener : public eprosima::fastdds::dds::DataWriterListener { public: - CommandPubListener(MemoryTestPublisher* up) :mp_up(up), n_matched(0) {} - ~CommandPubListener() {} - void onPublicationMatched(eprosima::fastrtps::Publisher* pub, - eprosima::fastrtps::rtps::MatchingInfo& info); - MemoryTestPublisher* mp_up; - int n_matched; - } m_commandpublistener; - - class CommandSubListener : public eprosima::fastrtps::SubscriberListener + + CommandPubListener( + MemoryTestPublisher* up) + : up_(up) + { + } + + ~CommandPubListener() + { + } + + void on_publication_matched( + eprosima::fastdds::dds::DataWriter* writer, + const eprosima::fastdds::dds::PublicationMatchedStatus& info) override; + + MemoryTestPublisher* up_ {nullptr}; + int n_matched {0}; + } + m_commandpublistener {nullptr}; + + class CommandSubListener : public eprosima::fastdds::dds::DataReaderListener { public: - CommandSubListener(MemoryTestPublisher* up) :mp_up(up), n_matched(0) {} - ~CommandSubListener() {} - void onSubscriptionMatched(eprosima::fastrtps::Subscriber* sub, - eprosima::fastrtps::rtps::MatchingInfo& into); - void onNewDataMessage(eprosima::fastrtps::Subscriber* sub); - MemoryTestPublisher* mp_up; - int n_matched; - } m_commandsublistener; + + CommandSubListener( + MemoryTestPublisher* up) + : up_(up) + { + } + + ~CommandSubListener() + { + } + + 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; + + MemoryTestPublisher* up_ {nullptr}; + int n_matched {0}; + } + m_commandsublistener {nullptr}; TestCommandDataType command_t; std::string m_sXMLConfigFile; bool reliable_; - uint32_t m_data_size; - bool dynamic_data = false; + uint32_t m_data_size {0}; + bool dynamic_data_ {false}; // Static Data - MemoryType* mp_memory; + MemoryType* memory_ {nullptr}; MemoryDataType memory_t; // Dynamic Data - eprosima::fastrtps::types::DynamicData* m_DynData; - eprosima::fastrtps::types::DynamicPubSubType m_DynType; - eprosima::fastrtps::types::DynamicType_ptr m_pDynType; + eprosima::fastdds::dds::DynamicData::_ref_type m_DynData; + eprosima::fastdds::dds::DynamicType::_ref_type m_pDynType; + eprosima::fastdds::dds::DynamicPubSubType* dynamic_type_support_ {nullptr}; eprosima::fastrtps::PublisherAttributes pubAttr; }; diff --git a/test/profiling/MemoryTestSubscriber.cpp b/test/profiling/MemoryTestSubscriber.cpp index 839e66ee2d9..100d21842fd 100644 --- a/test/profiling/MemoryTestSubscriber.cpp +++ b/test/profiling/MemoryTestSubscriber.cpp @@ -21,45 +21,28 @@ #include -#include +#include +#include #include #include +#include +#include +#include +#include +#include -using namespace eprosima::fastrtps; -using namespace eprosima::fastrtps::rtps; -using namespace eprosima::fastrtps::types; - -using std::cout; -using std::endl; +using namespace eprosima::fastdds::dds; MemoryTestSubscriber::MemoryTestSubscriber() - : mp_participant(nullptr) - , mp_commandpub(nullptr) - , mp_datasub(nullptr) - , mp_commandsub(nullptr) - , disc_count_(0) - , comm_count_(0) - , data_count_(0) - , m_status(0) - , n_received(0) - , n_samples(0) - , m_datasublistener(nullptr) - , m_commandpublistener(nullptr) - , m_commandsublistener(nullptr) - , m_echo(true) - , dynamic_data(false) - , mp_memory(nullptr) { - m_datasublistener.mp_up = this; - m_commandpublistener.mp_up = this; - m_commandsublistener.mp_up = this; - - + m_datasublistener.up_ = this; + m_commandpublistener.up_ = this; + m_commandsublistener.up_ = this; } MemoryTestSubscriber::~MemoryTestSubscriber() { - Domain::removeParticipant(mp_participant); + participant_->delete_contained_entities(); } bool MemoryTestSubscriber::init( @@ -68,8 +51,8 @@ bool MemoryTestSubscriber::init( bool reliable, uint32_t pid, bool hostname, - const PropertyPolicy& part_property_policy, - const PropertyPolicy& property_policy, + const eprosima::fastrtps::rtps::PropertyPolicy& part_property_policy, + const eprosima::fastrtps::rtps::PropertyPolicy& property_policy, const std::string& sXMLConfigFile, uint32_t data_size, bool dynamic_types) @@ -78,61 +61,79 @@ bool MemoryTestSubscriber::init( m_echo = echo; n_samples = nsam; m_data_size = data_size; - dynamic_data = dynamic_types; + dynamic_data_ = dynamic_types; - if (dynamic_data) // Dummy type registration + if (dynamic_data_) // Dummy type registration { // Create basic builders - DynamicTypeBuilder_ptr struct_type_builder(DynamicTypeBuilderFactory::get_instance()->create_struct_builder()); + DynamicTypeBuilderFactory::_ref_type factory {DynamicTypeBuilderFactory::get_instance()}; - // Add members to the struct. - struct_type_builder->add_member(0, "seqnum", DynamicTypeBuilderFactory::get_instance()->create_uint32_type()); - struct_type_builder->add_member(1, "data", - DynamicTypeBuilderFactory::get_instance()->create_sequence_builder( - DynamicTypeBuilderFactory::get_instance()->create_byte_type(), ::dds::core::LENGTH_UNLIMITED - )); - struct_type_builder->set_name("MemoryType"); + // Create basic builders + TypeDescriptor::_ref_type type_descriptor {traits::make_shared()}; + type_descriptor->kind(TK_STRUCTURE); + type_descriptor->name("MemoryType"); + DynamicTypeBuilder::_ref_type struct_type_builder(factory->create_type(type_descriptor)); + // Add members to the struct. + MemberDescriptor::_ref_type member_descriptor {traits::make_shared()}; + member_descriptor->type(factory->get_primitive_type(eprosima::fastdds::dds::TK_UINT32)); + member_descriptor->name("seqnum"); + struct_type_builder->add_member(member_descriptor); + member_descriptor = traits::make_shared(); + member_descriptor->type(factory->create_sequence_type(factory->get_primitive_type(eprosima::fastdds::dds:: + TK_BYTE), static_cast(LENGTH_UNLIMITED))->build()); + member_descriptor->name("data"); + struct_type_builder->add_member(member_descriptor); m_pDynType = struct_type_builder->build(); - m_DynType.SetDynamicType(m_pDynType); } // Create RTPSParticipant std::string participant_profile_name = "participant_profile"; - ParticipantAttributes PParam; - PParam.domainId = pid % 230; - PParam.rtps.setName("Participant_sub"); - PParam.rtps.properties = part_property_policy; + DomainParticipantQos participant_qos; + participant_qos.name("MemoryTest_Participant_Subscriber"); + participant_qos.properties(part_property_policy); if (m_sXMLConfigFile.length() > 0) { - mp_participant = Domain::createParticipant(participant_profile_name); + participant_ = DomainParticipantFactory::get_instance()->create_participant_with_profile(pid % 230, + participant_profile_name); } else { - mp_participant = Domain::createParticipant(PParam); + participant_ = DomainParticipantFactory::get_instance()->create_participant(pid % 230, participant_qos); } - if (mp_participant == nullptr) + if (nullptr == participant_) { return false; } - if (dynamic_data) + if (dynamic_data_) { - Domain::registerType(mp_participant, &m_DynType); + dynamic_type_support_ = new DynamicPubSubType(m_pDynType); + data_type_ = TypeSupport{dynamic_type_support_}; } else { - Domain::registerType(mp_participant, (TopicDataType*)&memory_t); + data_type_ = TypeSupport{new MemoryDataType()}; + } + participant_->register_type(data_type_); + participant_->register_type(command_type_); + + publisher_ = participant_->create_publisher(PUBLISHER_QOS_DEFAULT); + + if (nullptr == publisher_) + { + return false; + } + + subscriber_ = participant_->create_subscriber(SUBSCRIBER_QOS_DEFAULT); + + if (nullptr == subscriber_) + { + return false; } - Domain::registerType(mp_participant, (TopicDataType*)&command_t); - // Create Data Subscriber - std::string profile_name = "subscriber_profile"; - SubscriberAttributes SubDataparam; - SubDataparam.topic.topicDataType = "MemoryType"; - SubDataparam.topic.topicKind = NO_KEY; std::ostringstream st; st << "MemoryTest_"; if (hostname) @@ -140,35 +141,37 @@ bool MemoryTestSubscriber::init( st << asio::ip::host_name() << "_"; } st << pid << "_PUB2SUB"; - SubDataparam.topic.topicName = st.str(); - if (reliable) + data_topic_ = participant_->create_topic(st.str(), "MemoryType", TOPIC_QOS_DEFAULT); + + if (nullptr == data_topic_) { - SubDataparam.qos.m_reliability.kind = RELIABLE_RELIABILITY_QOS; + return false; } - SubDataparam.properties = property_policy; - if (m_data_size > 60000) + + // Create Data Subscriber + std::string profile_name = "subscriber_profile"; + DataReaderQos reader_qos; + if (reliable) { - SubDataparam.historyMemoryPolicy = eprosima::fastrtps::rtps::PREALLOCATED_WITH_REALLOC_MEMORY_MODE; + reader_qos.reliability().kind = RELIABLE_RELIABILITY_QOS; } + reader_qos.properties(property_policy); if (m_sXMLConfigFile.length() > 0) { - mp_datasub = Domain::createSubscriber(mp_participant, profile_name, &this->m_datasublistener); + data_reader_ = subscriber_->create_datareader_with_profile(data_topic_, profile_name, &this->m_datasublistener); } else { - mp_datasub = Domain::createSubscriber(mp_participant, SubDataparam, &this->m_datasublistener); + data_reader_ = subscriber_->create_datareader(data_topic_, reader_qos, &this->m_datasublistener); } - if (mp_datasub == nullptr) + if (nullptr == data_reader_) { return false; } //COMMAND PUBLISHER - PublisherAttributes PubCommandParam; - PubCommandParam.topic.topicDataType = "TestCommandType"; - PubCommandParam.topic.topicKind = NO_KEY; std::ostringstream pct; pct << "MemoryTest_Command_"; if (hostname) @@ -176,22 +179,25 @@ bool MemoryTestSubscriber::init( pct << asio::ip::host_name() << "_"; } pct << pid << "_SUB2PUB"; - PubCommandParam.topic.topicName = pct.str(); - PubCommandParam.topic.historyQos.kind = KEEP_ALL_HISTORY_QOS; - PubCommandParam.qos.m_durability.kind = TRANSIENT_LOCAL_DURABILITY_QOS; - PubCommandParam.qos.m_reliability.kind = RELIABLE_RELIABILITY_QOS; - PubCommandParam.qos.m_publishMode.kind = eprosima::fastdds::dds::PublishModeQosPolicyKind::SYNCHRONOUS_PUBLISH_MODE; + command_pub_topic_ = participant_->create_topic(pct.str(), "TestCommandType", TOPIC_QOS_DEFAULT); - mp_commandpub = Domain::createPublisher(mp_participant, PubCommandParam, &this->m_commandpublistener); + if (nullptr == command_pub_topic_) + { + return false; + } + + DataWriterQos writer_qos; + writer_qos.history().kind = KEEP_ALL_HISTORY_QOS; + writer_qos.durability().kind = TRANSIENT_LOCAL_DURABILITY_QOS; + writer_qos.reliability().kind = RELIABLE_RELIABILITY_QOS; + + command_writer_ = publisher_->create_datawriter(command_pub_topic_, writer_qos, &this->m_commandpublistener); - if (mp_commandpub == nullptr) + if (nullptr == command_writer_) { return false; } - SubscriberAttributes SubCommandParam; - SubCommandParam.topic.topicDataType = "TestCommandType"; - SubCommandParam.topic.topicKind = NO_KEY; std::ostringstream sct; sct << "MemoryTest_Command_"; if (hostname) @@ -199,123 +205,120 @@ bool MemoryTestSubscriber::init( sct << asio::ip::host_name() << "_"; } sct << pid << "_PUB2SUB"; - SubCommandParam.topic.topicName = sct.str(); - SubCommandParam.topic.historyQos.kind = KEEP_ALL_HISTORY_QOS; - SubCommandParam.qos.m_reliability.kind = RELIABLE_RELIABILITY_QOS; - SubCommandParam.qos.m_durability.kind = TRANSIENT_LOCAL_DURABILITY_QOS; + command_sub_topic_ = participant_->create_topic(sct.str(), "TestCommandType", TOPIC_QOS_DEFAULT); - mp_commandsub = Domain::createSubscriber(mp_participant, SubCommandParam, &this->m_commandsublistener); - - if (mp_commandsub == nullptr) + if (nullptr == command_sub_topic_) { return false; } - if (dynamic_data) + DataReaderQos command_reader_qos; + command_reader_qos.history().kind = KEEP_ALL_HISTORY_QOS; + command_reader_qos.durability().kind = TRANSIENT_LOCAL_DURABILITY_QOS; + command_reader_qos.reliability().kind = RELIABLE_RELIABILITY_QOS; + + command_reader_ = subscriber_->create_datareader(command_sub_topic_, command_reader_qos, + &this->m_commandsublistener); + + if (nullptr == command_reader_) { - DynamicTypeBuilderFactory::delete_instance(); - subAttr = mp_datasub->getAttributes(); - Domain::removeSubscriber(mp_datasub); - Domain::unregisterType(mp_participant, "MemoryType"); // Unregister as we will register it later with correct size + return false; } return true; } -void MemoryTestSubscriber::DataSubListener::onSubscriptionMatched( - Subscriber* /*sub*/, - MatchingInfo& info) +void MemoryTestSubscriber::DataSubListener::on_subscription_matched( + DataReader*, + const SubscriptionMatchedStatus& info) { - std::unique_lock lock(mp_up->mutex_); + std::unique_lock lock(up_->mutex_); - if (info.status == MATCHED_MATCHING) + if (0 < info.current_count_change) { - cout << C_MAGENTA << "Data Sub Matched " << C_DEF << endl; - ++mp_up->disc_count_; + std::cout << C_MAGENTA << "Data Sub Matched " << C_DEF << std::endl; } else { - cout << C_MAGENTA << "Data Sub unmatched " << C_DEF << endl; - --mp_up->disc_count_; + std::cout << C_MAGENTA << "Data Sub unmatched " << C_DEF << std::endl; } + up_->disc_count_ += info.current_count_change; lock.unlock(); - mp_up->disc_cond_.notify_one(); + up_->disc_cond_.notify_one(); } -void MemoryTestSubscriber::CommandPubListener::onPublicationMatched( - Publisher* /*pub*/, - MatchingInfo& info) +void MemoryTestSubscriber::CommandPubListener::on_publication_matched( + DataWriter*, + const PublicationMatchedStatus& info) { - std::unique_lock lock(mp_up->mutex_); + std::unique_lock lock(up_->mutex_); - if (info.status == MATCHED_MATCHING) + if (0 < info.current_count_change) { - cout << C_MAGENTA << "Command Pub Matched " << C_DEF << endl; - ++mp_up->disc_count_; + std::cout << C_MAGENTA << "Command Pub Matched " << C_DEF << std::endl; } else { - cout << C_MAGENTA << "Command Pub unmatched " << C_DEF << endl; - --mp_up->disc_count_; + std::cout << C_MAGENTA << "Command Pub unmatched " << C_DEF << std::endl; } + up_->disc_count_ += info.current_count_change; lock.unlock(); - mp_up->disc_cond_.notify_one(); + up_->disc_cond_.notify_one(); } -void MemoryTestSubscriber::CommandSubListener::onSubscriptionMatched( - Subscriber* /*sub*/, - MatchingInfo& info) +void MemoryTestSubscriber::CommandSubListener::on_subscription_matched( + DataReader*, + const SubscriptionMatchedStatus& info) { - std::unique_lock lock(mp_up->mutex_); + std::unique_lock lock(up_->mutex_); - if (info.status == MATCHED_MATCHING) + if (0 < info.current_count_change) { - cout << C_MAGENTA << "Command Sub Matched " << C_DEF << endl; - ++mp_up->disc_count_; + std::cout << C_MAGENTA << "Command Sub Matched " << C_DEF << std::endl; } else { - cout << C_MAGENTA << "Command Sub unmatched " << C_DEF << endl; - --mp_up->disc_count_; + std::cout << C_MAGENTA << "Command Sub unmatched " << C_DEF << std::endl; } + up_->disc_count_ += info.current_count_change; lock.unlock(); - mp_up->disc_cond_.notify_one(); + up_->disc_cond_.notify_one(); } -void MemoryTestSubscriber::CommandSubListener::onNewDataMessage( - Subscriber* subscriber) +void MemoryTestSubscriber::CommandSubListener::on_data_available( + DataReader* reader) { TestCommandType command; - if (subscriber->takeNextData(&command, &mp_up->m_sampleinfo)) + if (RETCODE_OK == reader->take_next_sample(&command, &up_->m_sampleinfo)) { - cout << "RCOMMAND: " << command.m_command << endl; + std::cout << "RCOMMAND: " << command.m_command << std::endl; if (command.m_command == READY) { - cout << "Publisher has new test ready..." << endl; - mp_up->mutex_.lock(); - ++mp_up->comm_count_; - mp_up->mutex_.unlock(); - mp_up->comm_cond_.notify_one(); + std::cout << "Publisher has new test ready..." << std::endl; + up_->mutex_.lock(); + ++up_->comm_count_; + up_->mutex_.unlock(); + up_->comm_cond_.notify_one(); } else if (command.m_command == STOP) { - cout << "Publisher has stopped the test" << endl; - mp_up->mutex_.lock(); - ++mp_up->data_count_; - mp_up->mutex_.unlock(); - mp_up->data_cond_.notify_one(); + std::cout << "Publisher has stopped the test" << std::endl; + up_->mutex_.lock(); + ++up_->data_count_; + up_->mutex_.unlock(); + up_->data_cond_.notify_one(); } else if (command.m_command == STOP_ERROR) { - cout << "Publisher has canceled the test" << endl; - mp_up->m_status = -1; - mp_up->mutex_.lock(); - ++mp_up->data_count_; - mp_up->mutex_.unlock(); - mp_up->data_cond_.notify_one(); + std::cout << "Publisher has canceled the test" << std::endl; + up_->m_status = -1; + up_->mutex_.lock(); + ++up_->data_count_; + up_->mutex_.unlock(); + up_->data_cond_.notify_one(); } else if (command.m_command == DEFAULT) { @@ -324,26 +327,27 @@ void MemoryTestSubscriber::CommandSubListener::onNewDataMessage( } } -void MemoryTestSubscriber::DataSubListener::onNewDataMessage( - Subscriber* subscriber) +void MemoryTestSubscriber::DataSubListener::on_data_available( + DataReader* reader) { - if (mp_up->dynamic_data) + if (up_->dynamic_data_) { - subscriber->takeNextData((void*)mp_up->m_DynData, &mp_up->m_sampleinfo); - ++mp_up->n_received; - if (mp_up->m_echo) + reader->take_next_sample(&up_->m_DynData, &up_->m_sampleinfo); + ++up_->n_received; + if (up_->m_echo) { - std::cout << "Received data: " << mp_up->m_DynData->get_uint32_value(0) - << "(" << mp_up->n_received << ")" << std::endl; + uint32_t seq_num {0}; + up_->m_DynData->get_uint32_value(seq_num, 0); + std::cout << "Received data: " << seq_num << "(" << up_->n_received << ")" << std::endl; } } else { - subscriber->takeNextData((void*)mp_up->mp_memory, &mp_up->m_sampleinfo); - ++mp_up->n_received; - if (mp_up->m_echo) + reader->take_next_sample((void*)up_->memory_, &up_->m_sampleinfo); + ++up_->n_received; + if (up_->m_echo) { - std::cout << "Received data: " << mp_up->mp_memory->seqnum << "(" << mp_up->n_received << ")" << std::endl; + std::cout << "Received data: " << up_->memory_->seqnum << "(" << up_->n_received << ")" << std::endl; } } } @@ -365,37 +369,15 @@ void MemoryTestSubscriber::run() bool MemoryTestSubscriber::test( uint32_t datasize) { - cout << "Preparing test with data size: " << datasize + 4 << endl; + std::cout << "Preparing test with data size: " << datasize + 4 << std::endl; - //cout << "Ready to start data size: " << m_datasize << " and demand; "<create_struct_builder()); - - // Add members to the struct. - struct_type_builder->add_member(0, "seqnum", - DynamicTypeBuilderFactory::get_instance()->create_uint32_type()); - struct_type_builder->add_member(1, "data", - DynamicTypeBuilderFactory::get_instance()->create_sequence_builder( - DynamicTypeBuilderFactory::get_instance()->create_byte_type(), datasize - )); - struct_type_builder->set_name("MemoryType"); - - m_pDynType = struct_type_builder->build(); - m_DynType.CleanDynamicType(); - m_DynType.SetDynamicType(m_pDynType); - - Domain::registerType(mp_participant, &m_DynType); - - mp_datasub = Domain::createSubscriber(mp_participant, subAttr, &m_datasublistener); - m_DynData = DynamicDataFactory::get_instance()->create_data(m_pDynType); } else { - mp_memory = new MemoryType(datasize); + memory_ = new MemoryType(datasize); } // Finally data matching @@ -406,7 +388,7 @@ bool MemoryTestSubscriber::test( }); disc_lock.unlock(); - cout << C_B_MAGENTA << "DISCOVERY COMPLETE " << C_DEF << endl; + std::cout << C_B_MAGENTA << "DISCOVERY COMPLETE " << C_DEF << std::endl; std::unique_lock lock(mutex_); if (comm_count_ == 0) @@ -420,8 +402,8 @@ bool MemoryTestSubscriber::test( n_received = 0; TestCommandType command; command.m_command = BEGIN; - cout << "Testing with data size: " << datasize + 4 << endl; - mp_commandpub->write(&command); + std::cout << "Testing with data size: " << datasize + 4 << std::endl; + command_writer_->write(&command); lock.lock(); data_cond_.wait(lock, [&]() @@ -431,17 +413,15 @@ bool MemoryTestSubscriber::test( --data_count_; lock.unlock(); - cout << "TEST OF SIZE: " << datasize + 4 << " ENDS" << endl; + std::cout << "TEST OF SIZE: " << datasize + 4 << " ENDS" << std::endl; std::this_thread::sleep_for(std::chrono::milliseconds(50)); - if (dynamic_data) + if (dynamic_data_) { - DynamicTypeBuilderFactory::delete_instance(); DynamicDataFactory::get_instance()->delete_data(m_DynData); - subAttr = mp_datasub->getAttributes(); } else { - delete(mp_memory); + delete(memory_); } if (m_status == -1) { diff --git a/test/profiling/MemoryTestSubscriber.h b/test/profiling/MemoryTestSubscriber.h index 5c44b202f95..be45d406a29 100644 --- a/test/profiling/MemoryTestSubscriber.h +++ b/test/profiling/MemoryTestSubscriber.h @@ -20,92 +20,150 @@ #ifndef MEMORYTESTSUBSCRIBER_H_ #define MEMORYTESTSUBSCRIBER_H_ -#include #include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + #include "MemoryTestTypes.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include class MemoryTestSubscriber { public: + MemoryTestSubscriber(); virtual ~MemoryTestSubscriber(); - eprosima::fastrtps::Participant* mp_participant; - eprosima::fastrtps::Publisher* mp_commandpub; - eprosima::fastrtps::Subscriber* mp_datasub; - eprosima::fastrtps::Subscriber* mp_commandsub; - eprosima::fastrtps::SampleInfo_t m_sampleinfo; + eprosima::fastdds::dds::DomainParticipant* participant_ {nullptr}; + eprosima::fastdds::dds::Publisher* publisher_ {nullptr}; + eprosima::fastdds::dds::Subscriber* subscriber_ {nullptr}; + eprosima::fastdds::dds::TypeSupport command_type_ {new TestCommandDataType()}; + eprosima::fastdds::dds::TypeSupport data_type_; + eprosima::fastdds::dds::Topic* command_pub_topic_ {nullptr}; + eprosima::fastdds::dds::Topic* command_sub_topic_ {nullptr}; + eprosima::fastdds::dds::Topic* data_topic_ {nullptr}; + eprosima::fastdds::dds::DataWriter* command_writer_ {nullptr}; + eprosima::fastdds::dds::DataReader* data_reader_ {nullptr}; + eprosima::fastdds::dds::DataReader* command_reader_ {nullptr}; + eprosima::fastdds::dds::SampleInfo m_sampleinfo; std::mutex mutex_; - int disc_count_; + int disc_count_ {0}; std::condition_variable disc_cond_; - int comm_count_; + int comm_count_ {0}; std::condition_variable comm_cond_; - int data_count_; + int data_count_ {0}; std::condition_variable data_cond_; - int m_status; - int n_received; - int n_samples; - bool init(bool echo, int nsam, bool reliable, uint32_t pid, bool hostname, - const eprosima::fastrtps::rtps::PropertyPolicy& part_property_policy, - const eprosima::fastrtps::rtps::PropertyPolicy& property_policy, - const std::string& sXMLConfigFile, uint32_t data_size, bool dynamic_types); + int m_status {0}; + int n_received {0}; + int n_samples {0}; + bool init( + bool echo, + int nsam, + bool reliable, + uint32_t pid, + bool hostname, + const eprosima::fastrtps::rtps::PropertyPolicy& part_property_policy, + const eprosima::fastrtps::rtps::PropertyPolicy& property_policy, + const std::string& sXMLConfigFile, + uint32_t data_size, + bool dynamic_types); void run(); - bool test(uint32_t datasize); + bool test( + uint32_t datasize); - class DataSubListener : public eprosima::fastrtps::SubscriberListener + class DataSubListener : public eprosima::fastdds::dds::DataReaderListener { public: - DataSubListener(MemoryTestSubscriber* up) :mp_up(up) {} - ~DataSubListener() {} - void onSubscriptionMatched(eprosima::fastrtps::Subscriber* sub, - eprosima::fastrtps::rtps::MatchingInfo& into); - void onNewDataMessage(eprosima::fastrtps::Subscriber* sub); - MemoryTestSubscriber* mp_up; - } m_datasublistener; - - class CommandPubListener : public eprosima::fastrtps::PublisherListener + + DataSubListener( + MemoryTestSubscriber* up) + : up_(up) + { + } + + ~DataSubListener() + { + } + + 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; + + MemoryTestSubscriber* up_ {nullptr}; + } + m_datasublistener {nullptr}; + + class CommandPubListener : public eprosima::fastdds::dds::DataWriterListener { public: - CommandPubListener(MemoryTestSubscriber* up) :mp_up(up) {} - ~CommandPubListener() {} - void onPublicationMatched(eprosima::fastrtps::Publisher* pub, - eprosima::fastrtps::rtps::MatchingInfo& info); - MemoryTestSubscriber* mp_up; - } m_commandpublistener; - - class CommandSubListener : public eprosima::fastrtps::SubscriberListener + + CommandPubListener( + MemoryTestSubscriber* up) + : up_(up) + { + } + + ~CommandPubListener() + { + } + + void on_publication_matched( + eprosima::fastdds::dds::DataWriter* writer, + const eprosima::fastdds::dds::PublicationMatchedStatus& info) override; + + MemoryTestSubscriber* up_ {nullptr}; + } + m_commandpublistener {nullptr}; + + class CommandSubListener : public eprosima::fastdds::dds::DataReaderListener { public: - CommandSubListener(MemoryTestSubscriber* up) :mp_up(up) {} - ~CommandSubListener() {} - void onSubscriptionMatched(eprosima::fastrtps::Subscriber* sub, - eprosima::fastrtps::rtps::MatchingInfo& into); - void onNewDataMessage(eprosima::fastrtps::Subscriber* sub); - MemoryTestSubscriber* mp_up; - } m_commandsublistener; - - bool m_echo; - TestCommandDataType command_t; + + CommandSubListener( + MemoryTestSubscriber* up) + : up_(up) + { + } + + ~CommandSubListener() + { + } + + 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; + + MemoryTestSubscriber* up_ {nullptr}; + } + m_commandsublistener {nullptr}; + + bool m_echo {true}; std::string m_sXMLConfigFile; - uint32_t m_data_size; - bool dynamic_data = false; + uint32_t m_data_size {0}; + bool dynamic_data_ {false}; // Static Data - MemoryType* mp_memory; - MemoryDataType memory_t; + MemoryType* memory_ {nullptr}; // Dynamic Data - eprosima::fastrtps::types::DynamicData* m_DynData; - eprosima::fastrtps::types::DynamicPubSubType m_DynType; - eprosima::fastrtps::types::DynamicType_ptr m_pDynType; + eprosima::fastdds::dds::DynamicData::_ref_type m_DynData; + eprosima::fastdds::dds::DynamicType::_ref_type m_pDynType; + eprosima::fastdds::dds::DynamicPubSubType* dynamic_type_support_ {nullptr}; eprosima::fastrtps::SubscriberAttributes subAttr; }; diff --git a/test/profiling/main_MemoryTest.cpp b/test/profiling/main_MemoryTest.cpp index 91431e3a752..352c7c4c6fc 100644 --- a/test/profiling/main_MemoryTest.cpp +++ b/test/profiling/main_MemoryTest.cpp @@ -20,9 +20,10 @@ #include #include -#include #include +#include + #include "MemoryTestPublisher.h" #include "MemoryTestSubscriber.h" @@ -34,9 +35,6 @@ using namespace eprosima::fastrtps; using namespace eprosima::fastrtps::rtps; -using std::cout; -using std::endl; - #if FASTDDS_IS_BIG_ENDIAN_TARGET const Endianness_t DEFAULT_ENDIAN = BIGEND; #else @@ -435,13 +433,13 @@ int main( // Load an XML file with predefined profiles for publisher and subscriber if (sXMLConfigFile.length() > 0) { - // TODO(jlbueno): Migrate DomainParticipantFactory::load_XML_profiles_file - xmlparser::XMLProfileManager::loadXMLFile(sXMLConfigFile); + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->load_XML_profiles_file(sXMLConfigFile); } if (pub_sub) { - cout << "Performing test with " << sub_number << " subscribers and " << n_samples << " samples" << endl; + std::cout << "Performing test with " << sub_number << " subscribers and " << n_samples << " samples" << + std::endl; MemoryTestPublisher memoryPub; memoryPub.init(sub_number, n_samples, reliable, seed, hostname, export_csv, export_prefix, pub_part_property_policy, pub_property_policy, sXMLConfigFile, data_size, dynamic_types); @@ -457,7 +455,7 @@ int main( std::this_thread::sleep_for(std::chrono::milliseconds(1000)); - cout << "EVERYTHING STOPPED FINE" << endl; + std::cout << "EVERYTHING STOPPED FINE" << std::endl; return 0; } diff --git a/test/unittest/CMakeLists.txt b/test/unittest/CMakeLists.txt index 9d793eecbdc..f0a45665abe 100644 --- a/test/unittest/CMakeLists.txt +++ b/test/unittest/CMakeLists.txt @@ -24,7 +24,6 @@ add_subdirectory(dds/subscriber) add_subdirectory(dds/topic) add_subdirectory(dds/topic/DDSSQLFilter) add_subdirectory(dds/xtypes/type_representation) -add_subdirectory(dynamic_types) add_subdirectory(logging) add_subdirectory(rtps/attributes) add_subdirectory(rtps/builtin) @@ -45,7 +44,6 @@ add_subdirectory(statistics/dds) add_subdirectory(transport) add_subdirectory(utils) add_subdirectory(xmlparser) -add_subdirectory(xtypes) if(SECURITY) add_subdirectory(security/authentication) diff --git a/test/unittest/dds/collections/CMakeLists.txt b/test/unittest/dds/collections/CMakeLists.txt index b05de002b8c..3c083e4cb53 100644 --- a/test/unittest/dds/collections/CMakeLists.txt +++ b/test/unittest/dds/collections/CMakeLists.txt @@ -17,10 +17,6 @@ if(WIN32) endif() set(LOANABLE_SEQUENCE_TESTS_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/utils/SystemInfo.cpp LoanableSequenceTests.cpp) @@ -32,5 +28,8 @@ target_compile_definitions(LoanableSequenceTests PRIVATE target_include_directories(LoanableSequenceTests PRIVATE ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include ${PROJECT_SOURCE_DIR}/src/cpp) -target_link_libraries(LoanableSequenceTests GTest::gtest) +target_link_libraries(LoanableSequenceTests + fastdds::log + GTest::gtest + ) gtest_discover_tests(LoanableSequenceTests) diff --git a/test/unittest/dds/core/condition/CMakeLists.txt b/test/unittest/dds/core/condition/CMakeLists.txt index 236616b69f4..a141d031736 100644 --- a/test/unittest/dds/core/condition/CMakeLists.txt +++ b/test/unittest/dds/core/condition/CMakeLists.txt @@ -13,10 +13,6 @@ # limitations under the License. set(LOG_SOURCES - ${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/utils/SystemInfo.cpp ) @@ -46,7 +42,10 @@ target_include_directories(ConditionTests PRIVATE ${PROJECT_BINARY_DIR}/include ${PROJECT_SOURCE_DIR}/src/cpp ) -target_link_libraries(ConditionTests GTest::gtest) +target_link_libraries(ConditionTests + fastdds::log + GTest::gtest + ) gtest_discover_tests(ConditionTests) ### ConditionNotifier ### @@ -68,7 +67,11 @@ target_include_directories(ConditionNotifierTests PRIVATE ${PROJECT_BINARY_DIR}/include ${PROJECT_SOURCE_DIR}/src/cpp ) -target_link_libraries(ConditionNotifierTests GTest::gtest GTest::gmock) +target_link_libraries(ConditionNotifierTests + fastdds::log + GTest::gtest + GTest::gmock + ) gtest_discover_tests(ConditionNotifierTests) ### StatusConditionImpl ### @@ -92,7 +95,11 @@ target_include_directories(StatusConditionImplTests PRIVATE ${PROJECT_BINARY_DIR}/include ${PROJECT_SOURCE_DIR}/src/cpp ) -target_link_libraries(StatusConditionImplTests GTest::gtest GTest::gmock) +target_link_libraries(StatusConditionImplTests + fastdds::log + GTest::gtest + GTest::gmock + ) gtest_discover_tests(StatusConditionImplTests) ### WaitSetImpl ### @@ -115,5 +122,9 @@ target_include_directories(WaitSetImplTests PRIVATE ${PROJECT_BINARY_DIR}/include ${PROJECT_SOURCE_DIR}/src/cpp ) -target_link_libraries(WaitSetImplTests GTest::gtest GTest::gmock) +target_link_libraries(WaitSetImplTests + fastdds::log + GTest::gtest + GTest::gmock + ) gtest_discover_tests(WaitSetImplTests) diff --git a/test/unittest/dds/core/entity/CMakeLists.txt b/test/unittest/dds/core/entity/CMakeLists.txt index 27fe9e093a7..3edab64d0e2 100644 --- a/test/unittest/dds/core/entity/CMakeLists.txt +++ b/test/unittest/dds/core/entity/CMakeLists.txt @@ -23,10 +23,6 @@ set(ENTITY_TESTS_SOURCE ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/core/condition/StatusCondition.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/core/condition/StatusConditionImpl.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/core/condition/WaitSetImpl.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/Time_t.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/SystemInfo.cpp EntityTests.cpp) @@ -49,5 +45,8 @@ target_include_directories(EntityTests PRIVATE ${PROJECT_BINARY_DIR}/include ${PROJECT_SOURCE_DIR}/src/cpp ) -target_link_libraries(EntityTests GTest::gtest fastcdr) +target_link_libraries(EntityTests + fastcdr + fastdds::log + GTest::gtest) gtest_discover_tests(EntityTests) diff --git a/test/unittest/dds/core/entity/EntityTests.cpp b/test/unittest/dds/core/entity/EntityTests.cpp index 1c7d20bdcae..ffe24fba0d6 100644 --- a/test/unittest/dds/core/entity/EntityTests.cpp +++ b/test/unittest/dds/core/entity/EntityTests.cpp @@ -22,7 +22,6 @@ #include #include #include -#include #include "../../../logging/mock/MockConsumer.h" #include "mock/MockEntity.hpp" diff --git a/test/unittest/dds/participant/ParticipantTests.cpp b/test/unittest/dds/participant/ParticipantTests.cpp index 830daf1a338..2aa9dd1af8b 100644 --- a/test/unittest/dds/participant/ParticipantTests.cpp +++ b/test/unittest/dds/participant/ParticipantTests.cpp @@ -38,6 +38,14 @@ #include #include #include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include @@ -50,14 +58,6 @@ #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include #include #include @@ -82,12 +82,6 @@ namespace dds { using fastrtps::ParticipantAttributes; using fastrtps::PublisherAttributes; using fastrtps::SubscriberAttributes; -using fastrtps::types::DynamicData_ptr; -using fastrtps::types::DynamicDataFactory; -using fastrtps::types::DynamicType_ptr; -using fastrtps::types::DynamicTypeBuilder_ptr; -using fastrtps::types::DynamicTypeBuilderFactory; -using fastrtps::types::TypeDescriptor; // Mocked TopicDataType for Topic creation tests class TopicDataTypeMock : public TopicDataType @@ -423,7 +417,7 @@ TEST(ParticipantTests, DomainParticipantFactoryLibrarySettings) TEST(ParticipantTests, DomainParticipantFactoryGetDynamicTypeBuilder) { - fastrtps::types::DynamicTypeBuilder* type = nullptr; + traits::ref_type type; std::string type_name("MyAloneEnumType"); // Trying to get a Dynamic Type with empty name returns RETCODE_BAD_PARAMETER EXPECT_EQ(RETCODE_BAD_PARAMETER, @@ -3063,123 +3057,26 @@ TEST(ParticipantTests, RegisterDynamicTypeToFactories) (uint32_t)GET_PID() % 230, PARTICIPANT_QOS_DEFAULT); // Create the dynamic type builder - DynamicType_ptr base_type = DynamicTypeBuilderFactory::get_instance()->create_uint32_type(); - DynamicTypeBuilder_ptr builder = DynamicTypeBuilderFactory::get_instance()->create_struct_builder(); - builder->add_member(0, "uint", base_type); + traits::ref_type type_descriptor = traits::make_shared(); + type_descriptor->kind(TK_STRUCTURE); + type_descriptor->name("mystruct"); + traits::ref_type builder {DynamicTypeBuilderFactory::get_instance()->create_type(type_descriptor)}; + traits::ref_type member_descriptor = traits::make_shared(); + member_descriptor->type(DynamicTypeBuilderFactory::get_instance()->get_primitive_type(TK_UINT32)); + member_descriptor->name("myuint"); + builder->add_member(member_descriptor); // Build the complete dynamic type - DynamicType_ptr dyn_type = builder->build(); + traits::ref_type dyn_type {builder->build()}; // Create the data instance - DynamicData_ptr data(DynamicDataFactory::get_instance()->create_data(dyn_type)); + traits::ref_type data {DynamicDataFactory::get_instance()->create_data(dyn_type)}; // Register the type - TypeSupport type(new eprosima::fastrtps::types::DynamicPubSubType(dyn_type)); - // Activating the auto_fill_type_information settings, the participant will try to - // add the type dynamic type factories - type->auto_fill_type_information(true); + TypeSupport type(new DynamicPubSubType(dyn_type)); ASSERT_EQ(type.register_type(participant), RETCODE_OK); // Remove the participant ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), RETCODE_OK); } -/* - * This test adds a complete dynamic type to the participant dynamic type factories without enabling the - * auto_fill_type_information setting - */ -TEST(ParticipantTests, RegisterDynamicTypeToFactoriesNotFillTypeInfo) -{ - // Do not enable entities on creation - DomainParticipantFactoryQos factory_qos; - factory_qos.entity_factory().autoenable_created_entities = false; - DomainParticipantFactory::get_instance()->set_qos(factory_qos); - - // Create a disabled participant - DomainParticipant* participant = - DomainParticipantFactory::get_instance()->create_participant( - (uint32_t)GET_PID() % 230, PARTICIPANT_QOS_DEFAULT); - - // Create the dynamic type builder - DynamicType_ptr base_type = DynamicTypeBuilderFactory::get_instance()->create_uint32_type(); - DynamicTypeBuilder_ptr builder = DynamicTypeBuilderFactory::get_instance()->create_struct_builder(); - builder->add_member(0, "uint", base_type); - - // Build the complete dynamic type - DynamicType_ptr dyn_type = builder->build(); - // Create the data instance - DynamicData_ptr data(DynamicDataFactory::get_instance()->create_data(dyn_type)); - - // Register the type - TypeSupport type(new eprosima::fastrtps::types::DynamicPubSubType(dyn_type)); - type->auto_fill_type_information(false); - ASSERT_EQ(type.register_type(participant), RETCODE_OK); - - // Remove the participant - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), RETCODE_OK); -} - -// Mocked DynamicType for DynamicType creation tests -class DynamicTypeMock : public eprosima::fastrtps::types::DynamicType -{ -public: - - DynamicTypeMock( - const eprosima::fastrtps::types::TypeDescriptor* descriptor) - : eprosima::fastrtps::types::DynamicType(descriptor) - { - } - - DynamicType_ptr get_base_type_wrapper() const - { - return get_base_type(); - } - -}; - -/* - * This test attempts to add a non supported custom dynamic type to the participant dynamic type factories. The type - * should be registered in the participant but not added to the dynamic types factories. - */ -TEST(ParticipantTests, RegisterDynamicTypeToFactoriesNotTypeIdentifier) -{ - // Do not enable entities on creation - DomainParticipantFactoryQos factory_qos; - factory_qos.entity_factory().autoenable_created_entities = false; - DomainParticipantFactory::get_instance()->set_qos(factory_qos); - - // Create a disabled participant - DomainParticipant* participant = - DomainParticipantFactory::get_instance()->create_participant( - (uint32_t)GET_PID() % 230, PARTICIPANT_QOS_DEFAULT); - - // Create a not supported TypeDescriptor - const TypeDescriptor* myDescriptor = new TypeDescriptor("my_descriptor", 0x11); - // Create the base type for the dynamic type - DynamicType_ptr base_type(new DynamicTypeMock(myDescriptor)); - // Create a custom dynamic type builder using the wrong TypeDescriptor - DynamicTypeBuilder_ptr builder = - DynamicTypeBuilderFactory::get_instance()->create_custom_builder(myDescriptor, "my_dynamic_type"); - builder->add_member(0, "uint", base_type); - // Create the dynamic type - DynamicType_ptr dyn_type = builder->build(); - // Create the data instance - DynamicData_ptr data(DynamicDataFactory::get_instance()->create_data(dyn_type)); - - // Register the type - TypeSupport type(new eprosima::fastrtps::types::DynamicPubSubType(dyn_type)); - type->auto_fill_type_information(true); - type.register_type(participant); - - TypeSupport ret_type = participant->find_type("my_dynamic_type"); - - // The type is registered in the participant but not in the dynamic types factories - ASSERT_FALSE(ret_type.empty()); - - // Remove TypeDescriptor before closing - delete myDescriptor; - - // Remove the participant - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), RETCODE_OK); -} - // Delete contained entities test TEST(ParticipantTests, DeleteContainedEntities) { diff --git a/test/unittest/dds/publisher/CMakeLists.txt b/test/unittest/dds/publisher/CMakeLists.txt index 757b3fdd393..f528fe57200 100644 --- a/test/unittest/dds/publisher/CMakeLists.txt +++ b/test/unittest/dds/publisher/CMakeLists.txt @@ -32,18 +32,6 @@ set(sqlite3_source_files set(DATAWRITERTESTS_SOURCE DataWriterTests.cpp ${DDSSQLFILTER_SOURCES} - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/AnnotationDescriptor.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/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 @@ -62,11 +50,6 @@ set(DATAWRITERTESTS_SOURCE DataWriterTests.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/domain/DomainParticipantImpl.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/DataWriterImpl.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/publisher/Publisher.cpp @@ -92,10 +75,6 @@ set(DATAWRITERTESTS_SOURCE DataWriterTests.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/topic/TypeSupport.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/topic/TopicDataType.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/utils/QosConverters.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/fastdds/xtypes/type_representation/TypeObjectRegistry.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/xtypes/type_representation/TypeObjectUtils.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/builtin/BuiltinProtocols.cpp @@ -358,7 +337,12 @@ target_include_directories(DataWriterTests PRIVATE ${THIRDPARTY_BOOST_INCLUDE_DIR} ${PROJECT_SOURCE_DIR}/thirdparty/taocpp-pegtl ) -target_link_libraries(DataWriterTests fastcdr foonathan_memory +target_link_libraries(DataWriterTests + fastcdr + fastdds::log + fastdds::xtypes::dynamic-types::impl + fastdds::xtypes::type-representation + foonathan_memory GTest::gmock ${CMAKE_DL_LIBS} ${TINYXML2_LIBRARY} diff --git a/test/unittest/dds/status/CMakeLists.txt b/test/unittest/dds/status/CMakeLists.txt index 01bfc1bee91..c5062754644 100644 --- a/test/unittest/dds/status/CMakeLists.txt +++ b/test/unittest/dds/status/CMakeLists.txt @@ -16,19 +16,6 @@ file(GLOB DDSSQLFILTER_SOURCES ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/topic/DDSSQ set(LISTENERTESTS_SOURCE ListenerTests.cpp ${DDSSQLFILTER_SOURCES} - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/AnnotationDescriptor.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/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 @@ -42,11 +29,6 @@ set(LISTENERTESTS_SOURCE ListenerTests.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/domain/DomainParticipantImpl.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/DataWriterImpl.cpp @@ -73,10 +55,6 @@ set(LISTENERTESTS_SOURCE ListenerTests.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/topic/TypeSupport.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/topic/TopicDataType.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/utils/QosConverters.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/fastdds/xtypes/type_representation/TypeObjectRegistry.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/xtypes/type_representation/TypeObjectUtils.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/Time_t.cpp @@ -190,7 +168,12 @@ target_include_directories(ListenerTests PRIVATE ${PROJECT_SOURCE_DIR}/thirdparty/taocpp-pegtl ) -target_link_libraries(ListenerTests fastcdr foonathan_memory +target_link_libraries(ListenerTests + fastcdr + fastdds::log + fastdds::xtypes::dynamic-types::impl + fastdds::xtypes::type-representation + foonathan_memory ${TINYXML2_LIBRARY} GTest::gmock ${CMAKE_DL_LIBS} diff --git a/test/unittest/dds/subscriber/CMakeLists.txt b/test/unittest/dds/subscriber/CMakeLists.txt index 16583de0c36..33a1b00e68e 100644 --- a/test/unittest/dds/subscriber/CMakeLists.txt +++ b/test/unittest/dds/subscriber/CMakeLists.txt @@ -26,9 +26,6 @@ set(DATAREADERINSTANCETESTS_SOURCE DataReaderInstanceTests.cpp set(DATAREADERHISTORYTESTS_SOURCE DataReaderHistoryTests.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/SystemInfo.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/rtps/history/History.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/history/ReaderHistory.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/subscriber/history/DataReaderHistory.cpp @@ -119,7 +116,10 @@ target_include_directories(DataReaderHistoryTests PRIVATE ${PROJECT_SOURCE_DIR}/src/cpp ${THIRDPARTY_BOOST_INCLUDE_DIR} ) -target_link_libraries(DataReaderHistoryTests fastcdr foonathan_memory +target_link_libraries(DataReaderHistoryTests + fastcdr + fastdds::log + foonathan_memory GTest::gmock ${CMAKE_DL_LIBS}) gtest_discover_tests(DataReaderHistoryTests) diff --git a/test/unittest/dds/topic/DDSSQLFilter/CMakeLists.txt b/test/unittest/dds/topic/DDSSQLFilter/CMakeLists.txt index d538a5f6502..a61fe8ee2f7 100644 --- a/test/unittest/dds/topic/DDSSQLFilter/CMakeLists.txt +++ b/test/unittest/dds/topic/DDSSQLFilter/CMakeLists.txt @@ -20,12 +20,8 @@ file(GLOB DDSSQLFILTER_SOURCES ) file(GLOB DDSSQLFILTER_LIB_SOURCES - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/*.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/*.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/*.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/xtypes/type_representation/*.cxx ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/md5.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/string_convert.cpp @@ -53,7 +49,11 @@ target_include_directories(DDSSQLFilterTests PRIVATE ${PROJECT_SOURCE_DIR}/src/cpp ${PROJECT_SOURCE_DIR}/thirdparty/taocpp-pegtl ) -target_link_libraries(DDSSQLFilterTests fastcdr foonathan_memory +target_link_libraries(DDSSQLFilterTests + fastcdr + fastdds::xtypes::dynamic-types::impl + fastdds::xtypes::type-representation + foonathan_memory GTest::gmock ${CMAKE_DL_LIBS} ) diff --git a/test/unittest/dynamic_types/CMakeLists.txt b/test/unittest/dynamic_types/CMakeLists.txt deleted file mode 100644 index f3070a2a844..00000000000 --- a/test/unittest/dynamic_types/CMakeLists.txt +++ /dev/null @@ -1,205 +0,0 @@ -# Copyright 2020 Proyectos y Sistemas de Mantenimiento SL (eProsima). -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -if(WIN32) - add_definitions( - -D_WIN32_WINNT=0x0601 - -D_CRT_SECURE_NO_WARNINGS - ) -endif() - -file(GLOB DYNAMIC_TYPES_SOURCE - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/*.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/*.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/topic/TopicDataType.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/xtypes/exception/*.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/xtypes/type_representation/*.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/xtypes/type_representation/*.cxx - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/*.cpp - ) - -# External sources -if(TINYXML2_SOURCE_DIR) - list(APPEND DYNAMIC_TYPES_SOURCE - ${TINYXML2_SOURCE_DIR}/tinyxml2.cpp - ) -endif() - -if(ANDROID) - if (ANDROID_NATIVE_API_LEVEL LESS 24) - list(APPEND DYNAMIC_TYPES_SOURCE - ${ANDROID_IFADDRS_SOURCE_DIR}/ifaddrs.c - ) - endif() -endif() - -if (IS_THIRDPARTY_BOOST_OK) - set(DYNAMIC_TYPES_ADDITIONAL_SOURCE - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/shared_mem/SharedMemTransport.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/shared_mem/SharedMemTransportDescriptor.cpp - ) -endif() - -if (TLS_FOUND) - list(APPEND DYNAMIC_TYPES_ADDITIONAL_SOURCE - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/TCPChannelResourceSecure.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/TCPAcceptorSecure.cpp - ) -endif() - -set(DYNAMIC_TYPES_TEST_SOURCE - DynamicTypesTests.cpp - idl/BasicPubSubTypes.cxx - idl/BasicTypeObjectSupport.cxx - ${DYNAMIC_TYPES_SOURCE} - ${DYNAMIC_TYPES_ADDITIONAL_SOURCE} - ${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 - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/attributes/ThreadSettings.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/flowcontrol/FlowControllerConsts.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/flowcontrol/ThroughputControllerDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/messages/RTPSMessageCreator.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/ChannelResource.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/PortBasedTransportDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/tcp/TCPControlMessage.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/tcp/RTCPMessageManager.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/TCPAcceptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/TCPAcceptorBasic.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/TCPChannelResource.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/TCPChannelResourceBasic.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/TCPTransportInterface.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/TCPv4Transport.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/TCPv6Transport.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/TransportInterface.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/UDPChannelResource.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/UDPTransportInterface.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/UDPv4Transport.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/UDPv6Transport.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/UnitsParser.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/xmlparser/XMLDynamicParser.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/xmlparser/XMLElementParser.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/xmlparser/XMLParser.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/xmlparser/XMLParserCommon.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/xmlparser/XMLProfileManager.cpp - ) - -set(DYNAMIC_COMPLEX_TYPES_TEST_SOURCE - DynamicComplexTypesTests.cpp - idl/TestPubSubTypes.cxx - idl/TestTypeObjectSupport.cxx - ${DYNAMIC_TYPES_SOURCE} - ) - -set(DYNAMIC_TYPES_4_2_TEST_SOURCE - DynamicTypes_4_2_Tests.cpp - idl/new_features_4_2PubSubTypes.cxx - idl/new_features_4_2TypeObjectSupport.cxx - ${DYNAMIC_TYPES_SOURCE} - ) - -include_directories(mock/) - -add_executable(DynamicTypesTests ${DYNAMIC_TYPES_TEST_SOURCE}) -target_compile_definitions(DynamicTypesTests PRIVATE - BOOST_ASIO_STANDALONE - ASIO_STANDALONE - $<$>,$>:__DEBUG> - $<$:__INTERNALDEBUG> # Internal debug activated. - ) -target_include_directories(DynamicTypesTests PRIVATE - ${PROJECT_SOURCE_DIR}/test/mock/rtps/RTPSParticipantAttributes - ${PROJECT_SOURCE_DIR}/test/mock/dds/DomainParticipantFactory/ - ${PROJECT_SOURCE_DIR}/test/mock/rtps/RTPSDomainImpl/ - ${Asio_INCLUDE_DIR} - $<$:${TINYXML2_INCLUDE_DIR}> - ${PROJECT_SOURCE_DIR}/include - ${PROJECT_BINARY_DIR}/include - ${PROJECT_SOURCE_DIR}/src/cpp - $<$:${ANDROID_IFADDRS_INCLUDE_DIR}> - $<$:${OPENSSL_INCLUDE_DIR}> - ${THIRDPARTY_BOOST_INCLUDE_DIR} - ) -target_link_libraries(DynamicTypesTests GTest::gtest - $<$:iphlpapi$Shlwapi> - $<$:ws2_32> - ${TINYXML2_LIBRARY} - fastcdr - foonathan_memory - $<$:OpenSSL::SSL$OpenSSL::Crypto> - ${THIRDPARTY_BOOST_LINK_LIBS} - ) -if(QNX) - target_link_libraries(DynamicTypesTests socket) -endif() -gtest_discover_tests(DynamicTypesTests) - - -add_executable(DynamicComplexTypesTests ${DYNAMIC_COMPLEX_TYPES_TEST_SOURCE}) -target_compile_definitions(DynamicComplexTypesTests PRIVATE - BOOST_ASIO_STANDALONE - ASIO_STANDALONE - $<$>,$>:__DEBUG> - $<$:__INTERNALDEBUG> # Internal debug activated. - ) -target_include_directories(DynamicComplexTypesTests PRIVATE - ${PROJECT_SOURCE_DIR}/test/mock/dds/DomainParticipantFactory/ - ${PROJECT_SOURCE_DIR}/test/mock/rtps/RTPSDomainImpl/ - ${Asio_INCLUDE_DIR} - ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include - ${PROJECT_SOURCE_DIR}/src/cpp - $<$:${ANDROID_IFADDRS_INCLUDE_DIR}> - ) - -target_link_libraries(DynamicComplexTypesTests GTest::gtest - $<$:iphlpapi$Shlwapi> - $<$:ws2_32> - ${TINYXML2_LIBRARY} - fastcdr - ) -if(QNX) - target_link_libraries(DynamicComplexTypesTests socket) -endif() -gtest_discover_tests(DynamicComplexTypesTests) - - -add_executable(DynamicTypes_4_2_Tests ${DYNAMIC_TYPES_4_2_TEST_SOURCE}) -target_compile_definitions(DynamicTypes_4_2_Tests PRIVATE - BOOST_ASIO_STANDALONE - ASIO_STANDALONE - $<$>,$>:__DEBUG> - $<$:__INTERNALDEBUG> # Internal debug activated. - ) -target_include_directories(DynamicTypes_4_2_Tests PRIVATE - ${PROJECT_SOURCE_DIR}/test/mock/dds/DomainParticipantFactory/ - ${PROJECT_SOURCE_DIR}/test/mock/rtps/RTPSDomainImpl/ - ${Asio_INCLUDE_DIR} - ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include - ${PROJECT_SOURCE_DIR}/src/cpp - ) - -target_link_libraries(DynamicTypes_4_2_Tests GTest::gtest - $<$:iphlpapi$Shlwapi> - $<$:ws2_32> - ${TINYXML2_LIBRARY} - fastcdr - $<$:${ANDROID_IFADDRS_INCLUDE_DIR}> - ) -if(QNX) - target_link_libraries(DynamicTypes_4_2_Tests socket) -endif() -gtest_discover_tests(DynamicTypes_4_2_Tests) - -configure_file("types_profile.xml" "types_profile.xml" COPYONLY) diff --git a/test/unittest/dynamic_types/DynamicComplexTypesTests.cpp b/test/unittest/dynamic_types/DynamicComplexTypesTests.cpp deleted file mode 100644 index 2d7af3410ee..00000000000 --- a/test/unittest/dynamic_types/DynamicComplexTypesTests.cpp +++ /dev/null @@ -1,2248 +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 -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "idl/Test.hpp" -#include "idl/TestPubSubTypes.h" -#include "idl/TestTypeObjectSupport.hpp" - -using namespace eprosima::fastrtps; -using namespace eprosima::fastrtps::rtps; -using namespace eprosima::fastrtps::types; - -class DynamicComplexTypesTests : public ::testing::Test -{ -public: - - DynamicComplexTypesTests() - { - register_Test_type_objects(); - m_factory = DynamicTypeBuilderFactory::get_instance(); - init(); - } - - ~DynamicComplexTypesTests() - { - m_DynAutoType = nullptr; - //DynamicDataFactory::get_instance()->delete_data(m_DynAuto); - - m_DynManualType = nullptr; - //DynamicDataFactory::get_instance()->delete_data(m_DynManual); - - if (!DynamicTypeBuilderFactory::get_instance()->is_empty()) - { - EPROSIMA_LOG_ERROR(DYN_TEST, "DynamicTypeBuilderFactory is not empty."); - } - - if (!DynamicDataFactory::get_instance()->is_empty()) - { - EPROSIMA_LOG_ERROR(DYN_TEST, "DynamicDataFactory is not empty."); - } - - DynamicDataFactory::delete_instance(); - DynamicTypeBuilderFactory::delete_instance(); - - eprosima::fastdds::dds::Log::KillThread(); - } - - virtual void TearDown() - { - } - - void init(); - - types::DynamicType_ptr GetMyEnumType(); - types::DynamicType_ptr GetMyAliasEnumType(); - types::DynamicType_ptr GetMyAliasEnum2Type(); - types::DynamicType_ptr GetMyAliasEnum3Type(); - types::DynamicType_ptr GetMyOctetArray500Type(); - types::DynamicType_ptr GetBSAlias5Type(); - types::DynamicType_ptr GetMA3Type(); - types::DynamicType_ptr GetMyMiniArrayType(); - types::DynamicType_ptr GetMySequenceLongType(); - types::DynamicType_ptr GetBasicStructType(); - types::DynamicType_ptr GetComplexStructType(); - types::DynamicType_ptr GetUnionSwitchType(); - types::DynamicType_ptr GetUnion2SwitchType(); - types::DynamicType_ptr GetCompleteStructType(); - types::DynamicType_ptr GetKeyedStructType(); - - // Static types - //CompleteStruct m_Static; - CompleteStructPubSubType m_StaticType; - // Dynamic Types - //DynamicData* m_DynAuto; - types::DynamicType_ptr m_DynAutoType; - //DynamicData* m_DynManual; - types::DynamicType_ptr m_DynManualType; - DynamicTypeBuilderFactory* m_factory; - -private: - - types::DynamicType_ptr m_MyEnumType; - types::DynamicType_ptr m_MyAliasEnumType; - types::DynamicType_ptr m_MyAliasEnum2Type; - types::DynamicType_ptr m_MyAliasEnum3Type; - types::DynamicType_ptr m_MyOctetArray500; - types::DynamicType_ptr m_BSAlias5; - types::DynamicType_ptr m_MA3; - types::DynamicType_ptr m_MyMiniArray; - types::DynamicType_ptr m_MySequenceLong; - types::DynamicType_ptr m_BasicStructType; - types::DynamicType_ptr m_ComplexStructType; - types::DynamicType_ptr m_UnionSwitchType; - types::DynamicType_ptr m_Union2SwitchType; - types::DynamicType_ptr m_CompleteStructType; - types::DynamicType_ptr m_KeyedStructType; -}; - -/* - - struct KeyedStruct - { - @Key octet key; - BasicStruct basic; - }; - */ -types::DynamicType_ptr DynamicComplexTypesTests::GetKeyedStructType() -{ - if (m_KeyedStructType.get() == nullptr) - { - DynamicTypeBuilder_ptr keyedStruct_builder = m_factory->create_struct_builder(); - DynamicTypeBuilder_ptr octet_builder = m_factory->create_byte_builder(); - octet_builder->apply_annotation(ANNOTATION_KEY_ID, "value", "true"); - keyedStruct_builder->add_member(0, "key", octet_builder->build()); - keyedStruct_builder->add_member(1, "basic", GetBasicStructType()); - keyedStruct_builder->apply_annotation(ANNOTATION_KEY_ID, "value", "true"); - keyedStruct_builder->set_name("KeyedStruct"); - m_KeyedStructType = keyedStruct_builder->build(); - } - - return m_KeyedStructType; -} - -types::DynamicType_ptr DynamicComplexTypesTests::GetMyEnumType() -{ - if (m_MyEnumType.get() == nullptr) - { - DynamicTypeBuilder_ptr myEnum_builder = m_factory->create_enum_builder(); - myEnum_builder->set_name("MyEnum"); - myEnum_builder->add_empty_member(0, "A"); - myEnum_builder->add_empty_member(1, "B"); - myEnum_builder->add_empty_member(2, "C"); - m_MyEnumType = myEnum_builder->build(); - } - - return m_MyEnumType; -} - -types::DynamicType_ptr DynamicComplexTypesTests::GetMyAliasEnumType() -{ - if (m_MyAliasEnumType.get() == nullptr) - { - DynamicTypeBuilder_ptr myAliasEnum_builder = m_factory->create_alias_builder(GetMyEnumType(), "MyAliasEnum"); - m_MyAliasEnumType = myAliasEnum_builder->build(); - } - - return m_MyAliasEnumType; -} - -types::DynamicType_ptr DynamicComplexTypesTests::GetMyAliasEnum2Type() -{ - if (m_MyAliasEnum2Type.get() == nullptr) - { - DynamicTypeBuilder_ptr myAliasEnum2_builder = m_factory->create_alias_builder( - GetMyAliasEnumType(), "MyAliasEnum2"); - m_MyAliasEnum2Type = myAliasEnum2_builder->build(); - } - - return m_MyAliasEnum2Type; -} - -types::DynamicType_ptr DynamicComplexTypesTests::GetMyAliasEnum3Type() -{ - if (m_MyAliasEnum3Type.get() == nullptr) - { - DynamicTypeBuilder_ptr myAliasEnum3_builder = m_factory->create_alias_builder( - GetMyAliasEnum2Type(), "MyAliasEnum3"); - m_MyAliasEnum3Type = myAliasEnum3_builder->build(); - } - - return m_MyAliasEnum3Type; -} - -types::DynamicType_ptr DynamicComplexTypesTests::GetMyOctetArray500Type() -{ - if (m_MyOctetArray500.get() == nullptr) - { - DynamicTypeBuilder_ptr octet_builder = m_factory->create_byte_builder(); - DynamicTypeBuilder_ptr myOctetArray500_builder = m_factory->create_array_builder(octet_builder.get(), { 500 }); - myOctetArray500_builder->set_name("MyOctetArray500"); - m_MyOctetArray500 = myOctetArray500_builder->build(); - } - - return m_MyOctetArray500; -} - -types::DynamicType_ptr DynamicComplexTypesTests::GetBSAlias5Type() -{ - if (m_BSAlias5.get() == nullptr) - { - DynamicTypeBuilder_ptr bSAlias5_builder = m_factory->create_array_builder(GetBasicStructType(), { 5 }); - bSAlias5_builder->set_name("BSAlias5"); - m_BSAlias5 = bSAlias5_builder->build(); - } - - return m_BSAlias5; -} - -types::DynamicType_ptr DynamicComplexTypesTests::GetMA3Type() -{ - if (m_MA3.get() == nullptr) - { - DynamicTypeBuilder_ptr mA3_builder = m_factory->create_array_builder(GetMyAliasEnum3Type(), { 42 }); - mA3_builder->set_name("MA3"); - m_MA3 = mA3_builder->build(); - } - - return m_MA3; -} - -types::DynamicType_ptr DynamicComplexTypesTests::GetMyMiniArrayType() -{ - if (m_MyMiniArray.get() == nullptr) - { - DynamicTypeBuilder_ptr int32_builder = m_factory->create_int32_builder(); - DynamicTypeBuilder_ptr myMiniArray_builder = m_factory->create_array_builder(int32_builder.get(), { 2 }); - myMiniArray_builder->set_name("MyMiniArray"); - m_MyMiniArray = myMiniArray_builder->build(); - } - - return m_MyMiniArray; -} - -types::DynamicType_ptr DynamicComplexTypesTests::GetMySequenceLongType() -{ - if (m_MySequenceLong.get() == nullptr) - { - DynamicTypeBuilder_ptr int32_builder = m_factory->create_int32_builder(); - DynamicTypeBuilder_ptr seqLong_builder = m_factory->create_sequence_builder(int32_builder.get()); - DynamicTypeBuilder_ptr mySequenceLong_builder = m_factory->create_alias_builder( - seqLong_builder.get(), "MySequenceLong"); - m_MySequenceLong = mySequenceLong_builder->build(); - } - - return m_MySequenceLong; -} - -types::DynamicType_ptr DynamicComplexTypesTests::GetBasicStructType() -{ - if (m_BasicStructType.get() == nullptr) - { - // Members - DynamicTypeBuilder_ptr bool_builder = m_factory->create_bool_builder(); - DynamicTypeBuilder_ptr octet_builder = m_factory->create_byte_builder(); - DynamicTypeBuilder_ptr int16_builder = m_factory->create_int16_builder(); - DynamicTypeBuilder_ptr int32_builder = m_factory->create_int32_builder(); - DynamicTypeBuilder_ptr int64_builder = m_factory->create_int64_builder(); - DynamicTypeBuilder_ptr uint16_builder = m_factory->create_uint16_builder(); - DynamicTypeBuilder_ptr uint32_builder = m_factory->create_uint32_builder(); - DynamicTypeBuilder_ptr uint64_builder = m_factory->create_uint64_builder(); - DynamicTypeBuilder_ptr float_builder = m_factory->create_float32_builder(); - DynamicTypeBuilder_ptr double_builder = m_factory->create_float64_builder(); - DynamicTypeBuilder_ptr ldouble_builder = m_factory->create_float128_builder(); - DynamicTypeBuilder_ptr char_builder = m_factory->create_char8_builder(); - //DynamicTypeBuilder_ptr wchar_builder = m_factory->create_char16_builder(); - DynamicTypeBuilder_ptr string_builder = m_factory->create_string_builder(); - //DynamicTypeBuilder_ptr wstring_builder = m_factory->create_wstring_builder(); - DynamicTypeBuilder_ptr basicStruct_builder = m_factory->create_struct_builder(); - - // Add members to the struct. - int idx = 0; - basicStruct_builder->add_member(idx++, "my_bool", bool_builder.get()); - basicStruct_builder->add_member(idx++, "my_octet", octet_builder.get()); - basicStruct_builder->add_member(idx++, "my_int16", int16_builder.get()); - basicStruct_builder->add_member(idx++, "my_int32", int32_builder.get()); - basicStruct_builder->add_member(idx++, "my_int64", int64_builder.get()); - basicStruct_builder->add_member(idx++, "my_uint16", uint16_builder.get()); - basicStruct_builder->add_member(idx++, "my_uint32", uint32_builder.get()); - basicStruct_builder->add_member(idx++, "my_uint64", uint64_builder.get()); - basicStruct_builder->add_member(idx++, "my_float32", float_builder.get()); - basicStruct_builder->add_member(idx++, "my_float64", double_builder.get()); - basicStruct_builder->add_member(idx++, "my_float128", ldouble_builder.get()); - basicStruct_builder->add_member(idx++, "my_char", char_builder.get()); - //basicStruct_builder->add_member(idx++, "my_wchar", wchar_builder.get()); - basicStruct_builder->add_member(idx++, "my_string", string_builder.get()); - //basicStruct_builder->add_member(idx++, "my_wstring", wstring_builder.get()); - basicStruct_builder->set_name("BasicStruct"); - - m_BasicStructType = basicStruct_builder->build(); - } - - return m_BasicStructType; -} - -types::DynamicType_ptr DynamicComplexTypesTests::GetComplexStructType() -{ - if (m_ComplexStructType.get() == nullptr) - { - // Members (auxiliar types are tab) - DynamicTypeBuilder_ptr octet_builder = m_factory->create_byte_builder(); - DynamicTypeBuilder_ptr my_sequence_octet_builder = m_factory->create_sequence_builder(octet_builder.get(), 55); - DynamicTypeBuilder_ptr my_sequence_struct_builder = m_factory->create_sequence_builder(GetBasicStructType()); - DynamicTypeBuilder_ptr char_builder = m_factory->create_char8_builder(); - DynamicTypeBuilder_ptr byte_builder = m_factory->create_byte_builder(); - DynamicTypeBuilder_ptr my_array_octet_builder = m_factory->create_array_builder( - byte_builder.get(), { 500, 5, 4 }); - // MyOctetArray500 is already created - // We reuse the bounds... { 5 } - DynamicTypeBuilder_ptr my_array_struct_builder = m_factory->create_array_builder(GetBasicStructType(), { 5 }); - DynamicTypeBuilder_ptr int16_builder = m_factory->create_int16_builder(); - DynamicTypeBuilder_ptr my_map_octet_short_builder = m_factory->create_map_builder( - octet_builder.get(), int16_builder.get()); - DynamicTypeBuilder_ptr int32_builder = m_factory->create_int32_builder(); - DynamicTypeBuilder_ptr my_map_long_struct_builder = m_factory->create_map_builder( - int32_builder.get()->build(), GetBasicStructType()); - DynamicTypeBuilder_ptr seqOctet_builder = m_factory->create_sequence_builder(octet_builder.get()); - DynamicTypeBuilder_ptr seqSeqOctet_builder = m_factory->create_sequence_builder(seqOctet_builder.get()); - DynamicTypeBuilder_ptr my_map_long_seq_octet_builder = m_factory->create_map_builder( - int32_builder.get(), seqSeqOctet_builder.get()); - DynamicTypeBuilder_ptr my_map_long_octet_array_500_builder = m_factory->create_map_builder( - int32_builder.get()->build(), GetMyOctetArray500Type()); - DynamicTypeBuilder_ptr map_octet_bsalias5_builder = m_factory->create_map_builder( - octet_builder.get()->build(), GetBSAlias5Type()); - DynamicTypeBuilder_ptr my_map_long_lol_type_builder = m_factory->create_map_builder( - int32_builder.get(), map_octet_bsalias5_builder.get()); - DynamicTypeBuilder_ptr my_small_string_8_builder = m_factory->create_string_builder(128); - //DynamicTypeBuilder_ptr my_small_string_16_builder = m_factory->create_wstring_builder(64); - DynamicTypeBuilder_ptr my_large_string_8_builder = m_factory->create_string_builder(500); - //DynamicTypeBuilder_ptr my_large_string_16_builder = m_factory->create_wstring_builder(1024); - DynamicTypeBuilder_ptr string75_8_builder = m_factory->create_string_builder(75); - DynamicTypeBuilder_ptr my_array_string_builder = m_factory->create_array_builder( - string75_8_builder.get(), { 5, 5 }); - - // MA3 is already defined. - // { 5 } being reused - DynamicTypeBuilder_ptr my_array_arrays_builder = m_factory->create_array_builder(GetMyMiniArrayType(), { 5 }); - DynamicTypeBuilder_ptr my_sequences_array_builder = m_factory->create_array_builder( - GetMySequenceLongType(), { 23 }); - DynamicTypeBuilder_ptr complexStruct_builder = m_factory->create_struct_builder(); - - // Add members to the struct. - int idx = 0; - complexStruct_builder->add_member(idx++, "my_octet", octet_builder.get()); - complexStruct_builder->add_member(idx++, "my_basic_struct", GetBasicStructType()); - complexStruct_builder->add_member(idx++, "my_alias_enum", GetMyAliasEnumType()); - complexStruct_builder->add_member(idx++, "my_enum", GetMyEnumType()); - complexStruct_builder->add_member(idx++, "my_sequence_octet", my_sequence_octet_builder.get()); - complexStruct_builder->add_member(idx++, "my_sequence_struct", my_sequence_struct_builder.get()); - complexStruct_builder->add_member(idx++, "my_array_octet", my_array_octet_builder.get()); - complexStruct_builder->add_member(idx++, "my_octet_array_500", GetMyOctetArray500Type()); - complexStruct_builder->add_member(idx++, "my_array_struct", my_array_struct_builder.get()); - complexStruct_builder->add_member(idx++, "my_map_octet_short", my_map_octet_short_builder.get()); - complexStruct_builder->add_member(idx++, "my_map_long_struct", my_map_long_struct_builder.get()); - complexStruct_builder->add_member(idx++, "my_map_long_seq_octet", my_map_long_seq_octet_builder.get()); - complexStruct_builder->add_member(idx++, "my_map_long_octet_array_500", - my_map_long_octet_array_500_builder.get()); - complexStruct_builder->add_member(idx++, "my_map_long_lol_type", my_map_long_lol_type_builder.get()); - complexStruct_builder->add_member(idx++, "my_small_string_8", my_small_string_8_builder.get()); - //complexStruct_builder->add_member(idx++, "my_small_string_16", my_small_string_16_builder.get()); - complexStruct_builder->add_member(idx++, "my_large_string_8", my_large_string_8_builder.get()); - //complexStruct_builder->add_member(idx++, "my_large_string_16", my_large_string_16_builder.get()); - complexStruct_builder->add_member(idx++, "my_array_string", my_array_string_builder.get()); - complexStruct_builder->add_member(idx++, "multi_alias_array_42", GetMA3Type()); - complexStruct_builder->add_member(idx++, "my_array_arrays", my_array_arrays_builder.get()); - complexStruct_builder->add_member(idx++, "my_sequences_array", my_sequences_array_builder.get()); - complexStruct_builder->set_name("ComplexStruct"); - m_ComplexStructType = complexStruct_builder->build(); - } - - return m_ComplexStructType; -} - -types::DynamicType_ptr DynamicComplexTypesTests::GetUnionSwitchType() -{ - if (m_UnionSwitchType.get() == nullptr) - { - DynamicTypeBuilder_ptr myUnion_builder = m_factory->create_union_builder(GetMyEnumType()); - myUnion_builder->add_member(0, "basic", GetBasicStructType(), "A", { 0 }, false); - myUnion_builder->add_member(1, "complex", GetComplexStructType(), "B", { 1, 2 }, false); - myUnion_builder->set_name("MyUnion"); - m_UnionSwitchType = myUnion_builder->build(); - } - - return m_UnionSwitchType; -} - -types::DynamicType_ptr DynamicComplexTypesTests::GetUnion2SwitchType() -{ - if (m_Union2SwitchType.get() == nullptr) - { - DynamicTypeBuilder_ptr octet_builder = m_factory->create_byte_builder(); - DynamicTypeBuilder_ptr int32_builder = m_factory->create_int32_builder(); - DynamicTypeBuilder_ptr string_builder = m_factory->create_string_builder(); - DynamicTypeBuilder_ptr myUnion2_builder = m_factory->create_union_builder(octet_builder.get()); - myUnion2_builder->add_member(0, "uno", int32_builder.get(), "0", { 0 }, false); - myUnion2_builder->add_member(1, "imString", string_builder.get(), "1", { 1 }, false); - myUnion2_builder->add_member(2, "tres", int32_builder.get(), "2", { 2 }, false); - myUnion2_builder->set_name("MyUnion2"); - m_Union2SwitchType = myUnion2_builder->build(); - } - - return m_Union2SwitchType; -} - -types::DynamicType_ptr DynamicComplexTypesTests::GetCompleteStructType() -{ - if (m_CompleteStructType.get() == nullptr) - { - DynamicTypeBuilder_ptr completeStruct_builder = m_factory->create_struct_builder(); - // Add members to the struct. - int idx = 0; - completeStruct_builder->add_member(idx++, "my_union", GetUnionSwitchType()); - completeStruct_builder->add_member(idx++, "my_union_2", GetUnion2SwitchType()); - completeStruct_builder->set_name("CompleteStruct"); - m_CompleteStructType = completeStruct_builder->build(); - } - - return m_CompleteStructType; -} - -void DynamicComplexTypesTests::init() -{ - // TODO(XTypes): PENDING implementation DynamicTypeBuilderFactory::create_type_w_type_object - // m_DynAutoType = TypeObjectFactory::get_instance()->build_dynamic_type("CompleteStruct", id, obj); - - m_DynManualType = GetCompleteStructType(); -} - -TEST_F(DynamicComplexTypesTests, Static_Manual_Comparison) -{ - // Serialize <-> Deserialize Test - DynamicPubSubType pubsubType(m_DynManualType); - types::DynamicData_ptr dynData(DynamicDataFactory::get_instance()->create_data(m_DynManualType)); - types::DynamicData_ptr dynData2(DynamicDataFactory::get_instance()->create_data(m_DynManualType)); - ASSERT_TRUE(dynData2->equals(dynData.get())); - - uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(dynData.get())()); - SerializedPayload_t payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(dynData.get(), &payload)); - - CompleteStruct staticData; - uint32_t payloadSize2 = static_cast(m_StaticType.getSerializedSizeProvider(&staticData)()); - ASSERT_TRUE(payloadSize == payloadSize2); - SerializedPayload_t payload2(payloadSize2); - ASSERT_TRUE(m_StaticType.deserialize(&payload, &staticData)); - ASSERT_TRUE(m_StaticType.serialize(&staticData, &payload2)); - - ASSERT_TRUE(pubsubType.deserialize(&payload2, dynData2.get())); - ASSERT_TRUE(dynData2->equals(dynData.get())); -} - -TEST_F(DynamicComplexTypesTests, Manual_Auto_Comparision) -{ - types::DynamicData* dynAutoData = DynamicDataFactory::get_instance()->create_data(m_DynAutoType); - types::DynamicData* dynManualData = DynamicDataFactory::get_instance()->create_data(m_DynManualType); - - ASSERT_TRUE(dynManualData->equals(dynAutoData)); - - DynamicDataFactory::get_instance()->delete_data(dynAutoData); - DynamicDataFactory::get_instance()->delete_data(dynManualData); -} - -TEST_F(DynamicComplexTypesTests, Static_Auto_Comparision) -{ - // Serialize <-> Deserialize Test - DynamicPubSubType pubsubtype(m_DynAutoType); - types::DynamicData_ptr dynData(DynamicDataFactory::get_instance()->create_data(m_DynAutoType)); - uint32_t payloadSize = static_cast(pubsubtype.getSerializedSizeProvider(dynData.get())()); - SerializedPayload_t payload(payloadSize); - ASSERT_TRUE(pubsubtype.serialize(dynData.get(), &payload)); - ASSERT_TRUE(payloadSize == payload.length); - - CompleteStruct staticData; - ASSERT_TRUE(m_StaticType.deserialize(&payload, &staticData)); - - uint32_t payloadSize2 = static_cast(m_StaticType.getSerializedSizeProvider(&staticData)()); - SerializedPayload_t payload2 = SerializedPayload_t(payloadSize2); - ASSERT_TRUE(m_StaticType.serialize(&staticData, &payload2)); - ASSERT_TRUE(payloadSize2 == payload2.length); - - types::DynamicData_ptr dynData2(DynamicDataFactory::get_instance()->create_data(m_DynAutoType)); - ASSERT_TRUE(pubsubtype.deserialize(&payload2, dynData2.get())); - - ASSERT_TRUE(dynData2->equals(dynData.get())); -} - -TEST_F(DynamicComplexTypesTests, Data_Comparison_A_A) -{ - // Serialize <-> Deserialize Test - DynamicPubSubType pubsubType(m_DynManualType); - types::DynamicData_ptr dynData(DynamicDataFactory::get_instance()->create_data(m_DynManualType)); - types::DynamicData_ptr dynDataFromStatic(DynamicDataFactory::get_instance()->create_data(m_DynAutoType)); - - CompleteStruct staticData; - staticData.my_union()._d(MyEnum::A); - staticData.my_union().basic().my_bool(true); - staticData.my_union().basic().my_octet(166); - staticData.my_union().basic().my_int16(-10401); - staticData.my_union().basic().my_int32(5884001); - staticData.my_union().basic().my_int64(884481567); - staticData.my_union().basic().my_uint16(250); - staticData.my_union().basic().my_uint32(15884); - staticData.my_union().basic().my_uint64(765241); - staticData.my_union().basic().my_float32(158.55f); - staticData.my_union().basic().my_float64(765241.58); - staticData.my_union().basic().my_float128(765241878.154874); - staticData.my_union().basic().my_char('L'); - //staticData.my_union().basic().my_wchar(L'G'); - staticData.my_union().basic().my_string("Luis@eProsima"); - //staticData.my_union().basic().my_wstring(L"LuisGasco@eProsima"); - - //staticData.my_union_2()._d(A); - staticData.my_union_2().uno(156); - - DynamicData* my_union = dynData->loan_value(dynData->get_member_id_by_name("my_union")); - DynamicData* basic = my_union->loan_value(my_union->get_member_id_by_name("basic")); - - basic->set_bool_value(true, basic->get_member_id_by_name("my_bool")); - basic->set_byte_value(166, basic->get_member_id_by_name("my_octet")); - basic->set_int16_value(-10401, basic->get_member_id_by_name("my_int16")); - basic->set_int32_value(5884001, basic->get_member_id_by_name("my_int32")); - basic->set_int64_value(884481567, basic->get_member_id_by_name("my_int64")); - basic->set_uint16_value(250, basic->get_member_id_by_name("my_uint16")); - basic->set_uint32_value(15884, basic->get_member_id_by_name("my_uint32")); - basic->set_uint64_value(765241, basic->get_member_id_by_name("my_uint64")); - basic->set_float32_value(158.55f, basic->get_member_id_by_name("my_float32")); - basic->set_float64_value(765241.58, basic->get_member_id_by_name("my_float64")); - basic->set_float128_value(765241878.154874, basic->get_member_id_by_name("my_float128")); - basic->set_char8_value('L', basic->get_member_id_by_name("my_char")); - //basic->set_char16_value(L'G', basic->get_member_id_by_name("my_wchar")); - basic->set_string_value("Luis@eProsima", basic->get_member_id_by_name("my_string")); - //basic->set_wstring_value(L"LuisGasco@eProsima", basic->get_member_id_by_name("my_wstring")); - - my_union->return_loaned_value(basic); - dynData->return_loaned_value(my_union); - - DynamicData* my_union_2 = dynData->loan_value(dynData->get_member_id_by_name("my_union_2")); - my_union_2->set_int32_value(156, my_union_2->get_member_id_by_name("uno")); - - - dynData->return_loaned_value(my_union_2); - - uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(dynData.get())()); - SerializedPayload_t payload(payloadSize); - - uint32_t payloadSize2 = static_cast(m_StaticType.getSerializedSizeProvider(&staticData)()); - ASSERT_TRUE(payloadSize == payloadSize2); - - CompleteStructPubSubType pbComplete; - ASSERT_TRUE(pbComplete.serialize(&staticData, &payload)); - ASSERT_TRUE(pubsubType.deserialize(&payload, dynDataFromStatic.get())); - - ASSERT_TRUE(dynDataFromStatic->equals(dynData.get())); -} - -TEST_F(DynamicComplexTypesTests, Data_Comparison_A_B) -{ - // Serialize <-> Deserialize Test - DynamicPubSubType pubsubType(m_DynManualType); - types::DynamicData_ptr dynData(DynamicDataFactory::get_instance()->create_data(m_DynManualType)); - types::DynamicData_ptr dynDataFromStatic(DynamicDataFactory::get_instance()->create_data(m_DynAutoType)); - - CompleteStruct staticData; - staticData.my_union()._d(MyEnum::A); - staticData.my_union().basic().my_bool(true); - staticData.my_union().basic().my_octet(166); - staticData.my_union().basic().my_int16(-10401); - staticData.my_union().basic().my_int32(5884001); - staticData.my_union().basic().my_int64(884481567); - staticData.my_union().basic().my_uint16(250); - staticData.my_union().basic().my_uint32(15884); - staticData.my_union().basic().my_uint64(765241); - staticData.my_union().basic().my_float32(158.55f); - staticData.my_union().basic().my_float64(765241.58); - staticData.my_union().basic().my_float128(765241878.154874); - staticData.my_union().basic().my_char('L'); - //staticData.my_union().basic().my_wchar(L'G'); - staticData.my_union().basic().my_string("Luis@eProsima"); - //staticData.my_union().basic().my_wstring(L"LuisGasco@eProsima"); - - staticData.my_union_2().imString("JuanCarlosArcereredekljnjkds"); - - DynamicData* my_union = dynData->loan_value(dynData->get_member_id_by_name("my_union")); - DynamicData* basic = my_union->loan_value(my_union->get_member_id_by_name("basic")); - - basic->set_bool_value(true, basic->get_member_id_by_name("my_bool")); - basic->set_byte_value(166, basic->get_member_id_by_name("my_octet")); - basic->set_int16_value(-10401, basic->get_member_id_by_name("my_int16")); - basic->set_int32_value(5884001, basic->get_member_id_by_name("my_int32")); - basic->set_int64_value(884481567, basic->get_member_id_by_name("my_int64")); - basic->set_uint16_value(250, basic->get_member_id_by_name("my_uint16")); - basic->set_uint32_value(15884, basic->get_member_id_by_name("my_uint32")); - basic->set_uint64_value(765241, basic->get_member_id_by_name("my_uint64")); - basic->set_float32_value(158.55f, basic->get_member_id_by_name("my_float32")); - basic->set_float64_value(765241.58, basic->get_member_id_by_name("my_float64")); - basic->set_float128_value(765241878.154874, basic->get_member_id_by_name("my_float128")); - basic->set_char8_value('L', basic->get_member_id_by_name("my_char")); - //basic->set_char16_value(L'G', basic->get_member_id_by_name("my_wchar")); - basic->set_string_value("Luis@eProsima", basic->get_member_id_by_name("my_string")); - //basic->set_wstring_value(L"LuisGasco@eProsima", basic->get_member_id_by_name("my_wstring")); - - my_union->return_loaned_value(basic); - dynData->return_loaned_value(my_union); - - DynamicData* my_union_2 = dynData->loan_value(dynData->get_member_id_by_name("my_union_2")); - my_union_2->set_string_value("JuanCarlosArcereredekljnjkds", my_union_2->get_member_id_by_name("imString")); - - - dynData->return_loaned_value(my_union_2); - - uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(dynData.get())()); - SerializedPayload_t payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(dynData.get(), &payload)); - - uint32_t payloadSize2 = static_cast(m_StaticType.getSerializedSizeProvider(&staticData)()); - ASSERT_TRUE(payloadSize == payloadSize2); - - CompleteStructPubSubType pbComplete; - ASSERT_TRUE(pbComplete.serialize(&staticData, &payload)); - ASSERT_TRUE(pubsubType.deserialize(&payload, dynDataFromStatic.get())); - - ASSERT_TRUE(dynDataFromStatic->equals(dynData.get())); -} - -TEST_F(DynamicComplexTypesTests, Data_Comparison_A_C) -{ - // Serialize <-> Deserialize Test - DynamicPubSubType pubsubType(m_DynManualType); - types::DynamicData_ptr dynData(DynamicDataFactory::get_instance()->create_data(m_DynManualType)); - types::DynamicData_ptr dynDataFromStatic(DynamicDataFactory::get_instance()->create_data(m_DynAutoType)); - - CompleteStruct staticData; - staticData.my_union()._d(MyEnum::A); - staticData.my_union().basic().my_bool(true); - staticData.my_union().basic().my_octet(166); - staticData.my_union().basic().my_int16(-10401); - staticData.my_union().basic().my_int32(5884001); - staticData.my_union().basic().my_int64(884481567); - staticData.my_union().basic().my_uint16(250); - staticData.my_union().basic().my_uint32(15884); - staticData.my_union().basic().my_uint64(765241); - staticData.my_union().basic().my_float32(158.55f); - staticData.my_union().basic().my_float64(765241.58); - staticData.my_union().basic().my_float128(765241878.154874); - staticData.my_union().basic().my_char('L'); - //staticData.my_union().basic().my_wchar(L'G'); - staticData.my_union().basic().my_string("Luis@eProsima"); - //staticData.my_union().basic().my_wstring(L"LuisGasco@eProsima"); - - //staticData.my_union_2()._d(A); - staticData.my_union_2().tres(333); - - DynamicData* my_union = dynData->loan_value(dynData->get_member_id_by_name("my_union")); - DynamicData* basic = my_union->loan_value(my_union->get_member_id_by_name("basic")); - - basic->set_bool_value(true, basic->get_member_id_by_name("my_bool")); - basic->set_byte_value(166, basic->get_member_id_by_name("my_octet")); - basic->set_int16_value(-10401, basic->get_member_id_by_name("my_int16")); - basic->set_int32_value(5884001, basic->get_member_id_by_name("my_int32")); - basic->set_int64_value(884481567, basic->get_member_id_by_name("my_int64")); - basic->set_uint16_value(250, basic->get_member_id_by_name("my_uint16")); - basic->set_uint32_value(15884, basic->get_member_id_by_name("my_uint32")); - basic->set_uint64_value(765241, basic->get_member_id_by_name("my_uint64")); - basic->set_float32_value(158.55f, basic->get_member_id_by_name("my_float32")); - basic->set_float64_value(765241.58, basic->get_member_id_by_name("my_float64")); - basic->set_float128_value(765241878.154874, basic->get_member_id_by_name("my_float128")); - basic->set_char8_value('L', basic->get_member_id_by_name("my_char")); - //basic->set_char16_value(L'G', basic->get_member_id_by_name("my_wchar")); - basic->set_string_value("Luis@eProsima", basic->get_member_id_by_name("my_string")); - //basic->set_wstring_value(L"LuisGasco@eProsima", basic->get_member_id_by_name("my_wstring")); - - my_union->return_loaned_value(basic); - dynData->return_loaned_value(my_union); - - DynamicData* my_union_2 = dynData->loan_value(dynData->get_member_id_by_name("my_union_2")); - my_union_2->set_int32_value(333, my_union_2->get_member_id_by_name("tres")); - - dynData->return_loaned_value(my_union_2); - - uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(dynData.get())()); - SerializedPayload_t payload(payloadSize); - - uint32_t payloadSize2 = static_cast(m_StaticType.getSerializedSizeProvider(&staticData)()); - ASSERT_TRUE(payloadSize == payloadSize2); - - CompleteStructPubSubType pbComplete; - ASSERT_TRUE(pbComplete.serialize(&staticData, &payload)); - ASSERT_TRUE(pubsubType.deserialize(&payload, dynDataFromStatic.get())); - - ASSERT_TRUE(dynDataFromStatic->equals(dynData.get())); -} - -TEST_F(DynamicComplexTypesTests, Data_Comparison_B_A) -{ - types::DynamicData_ptr dynData(DynamicDataFactory::get_instance()->create_data(m_DynManualType)); - - CompleteStruct staticData; - staticData.my_union()._d() = MyEnum::B; - staticData.my_union().complex().my_octet(66); - staticData.my_union().complex().my_basic_struct().my_bool(true); - staticData.my_union().complex().my_basic_struct().my_octet(166); - staticData.my_union().complex().my_basic_struct().my_int16(-10401); - staticData.my_union().complex().my_basic_struct().my_int32(5884001); - staticData.my_union().complex().my_basic_struct().my_int64(884481567); - staticData.my_union().complex().my_basic_struct().my_uint16(250); - staticData.my_union().complex().my_basic_struct().my_uint32(15884); - staticData.my_union().complex().my_basic_struct().my_uint64(765241); - staticData.my_union().complex().my_basic_struct().my_float32(158.55f); - staticData.my_union().complex().my_basic_struct().my_float64(765241.58); - staticData.my_union().complex().my_basic_struct().my_float128(765241878.154874); - staticData.my_union().complex().my_basic_struct().my_char('L'); - //staticData.my_union().complex().my_basic_struct().my_wchar(L'G'); - staticData.my_union().complex().my_basic_struct().my_string("Luis@eProsima"); - //staticData.my_union().complex().my_basic_struct().my_wstring(L"LuisGasco@eProsima"); - - staticData.my_union().complex().my_alias_enum(MyEnum::C); - staticData.my_union().complex().my_enum(MyEnum::B); - staticData.my_union().complex().my_sequence_octet().push_back(88); - staticData.my_union().complex().my_sequence_octet().push_back(99); - staticData.my_union().complex().my_sequence_struct().push_back(staticData.my_union().complex().my_basic_struct()); - for (int i = 0; i < 500; ++i) - { - for (int j = 0; j < 5; ++j) - { - for (int k = 0; k < 4; ++k) - { - staticData.my_union().complex().my_array_octet()[i][j][k] = static_cast(j * k); - } - } - } - - for (int i = 0; i < 5; ++i) - { - staticData.my_union().complex().my_array_struct()[i].my_bool(i % 2 == 1); - staticData.my_union().complex().my_array_struct()[i].my_octet(static_cast(i)); - staticData.my_union().complex().my_array_struct()[i].my_int16(static_cast(-i)); - staticData.my_union().complex().my_array_struct()[i].my_int32(i); - staticData.my_union().complex().my_array_struct()[i].my_int64(i * 1000); - staticData.my_union().complex().my_array_struct()[i].my_uint16(static_cast(i)); - staticData.my_union().complex().my_array_struct()[i].my_uint32(i); - staticData.my_union().complex().my_array_struct()[i].my_uint64(i * 10005); - staticData.my_union().complex().my_array_struct()[i].my_float32(i * 5.5f); - staticData.my_union().complex().my_array_struct()[i].my_float64(i * 8.8); - staticData.my_union().complex().my_array_struct()[i].my_float128(i * 10.0); - staticData.my_union().complex().my_array_struct()[i].my_char('J'); - //staticData.my_union().complex().my_array_struct()[i].my_wchar(L'C'); - staticData.my_union().complex().my_array_struct()[i].my_string("JC@eProsima"); - //staticData.my_union().complex().my_array_struct()[i].my_wstring(L"JC-BOOM-Armadilo!@eProsima"); - } - - staticData.my_union().complex().my_map_octet_short()[0] = 1340; - staticData.my_union().complex().my_map_octet_short()[1] = 1341; - staticData.my_union().complex().my_map_long_struct()[1000] = staticData.my_union().complex().my_array_struct()[3]; - staticData.my_union().complex().my_map_long_struct()[55] = staticData.my_union().complex().my_basic_struct(); - - staticData.my_union().complex().my_map_long_seq_octet()[55].push_back({1, 2, 3, 4, 5}); - staticData.my_union().complex().my_map_long_seq_octet()[55].push_back({1, 2, 3, 4, 5}); - staticData.my_union().complex().my_map_long_seq_octet()[0].push_back({1, 2, 3, 4, 5}); - for (int i = 0; i < 500; ++i) - { - staticData.my_union().complex().my_map_long_octet_array_500()[0][i] = i % 256; - staticData.my_union().complex().my_map_long_octet_array_500()[10][i] = (i + 55) % 256; - } - - staticData.my_union().complex().my_small_string_8( - "Bv7EMffURwGNqePoujdSfkF9PXN9TH125X5nGpNLfzya53tZtNJdgMROlYdZnTE1SLWzBdIU7ZyjjGvsGHkmuJUROwVPcNa9q5dRUV3KZAKNx1exL7BjhqIgQFconhd"); - //staticData.my_union().complex().my_small_string_16( - // L"AgzñgXsI9pXbWjYLDvvn8JUFWhxZhk9t92rdsTqylvdpqtXA6hy9dHkoBTgmF2c"); - staticData.my_union().complex().my_large_string_8( - "hYE5vjcLJe6ML5DmoqQwh9ns866dAbnjkVKIKu2VF6lbkvh91ZOG2enEcdoRa8T43hR0Ym0k7tI621EQGufvzmLqxKCPgiXSp2zUTTmIWtn4fM8tC3aP1Yd0dKvn0tDobyp6p3156KvxqG3BKQ6VjFiHlMFoEyz8pjCclhXLl2cfAi97sQzXLUoPYUC5BWKyQTrA2JF6HXZM6vrbw5dc3B4AOJNGdPJ9ai6weF43h1RhnXE9MOFxPNoQnJ8gqSXYbMtpG6ZzqhUyoz0XhFDt7EOqXIgvc9SCejQTVMPeRcF5Zy57hrYZiKrCQqFWidS4BdfEAkuwESgBmEpEFOpZotwDt0TGDaLktSt3dKRsURO6TpuZ2nZNdiEJyc597ZjjQXtyKU7OCyRRqllzAnHEtoU3zd3OLTOvT5uk32N1Y64tpUte63De2EMwDNYb2eGAQfATdSt8VcGBOzJQjsmrMwMumtk48JzXXLxjo6s2vl2rNK9WQM1"); - //staticData.my_union().complex().my_large_string_16( - // L"nosYBfFr1s3t8rUsuUrVCWFi6moDk7GULFj6XnkebIDkjl3n2ykKxUIaLj3qNNUx0ny8DvFbdfxZBdMhBNW3fHbKrig4GkHnN1JoEo0ACiPxrARusDs3xKzvaQQrls6lVUFAUXzDOtw5f2CNVJKiruGjXUO2Lq5Mmy8ygW3eUiTlueAHA2dRXXryOFi47jS3DkmBH4aAOKcmR27KhhJnXaY0gWy3XdSnaGQNB3XvbmxQ7xXDsf1wz860WMEKP3VhdOLsmS6tKCb4sshuOlmUSyTggY7vNoxfpG1EUFP5iPro9E0tHLLdHlWf2NwU8OXCYx6KKEbs5pFMvgEstnQglsdTk0lOv6riaFkFOwx83gW1l6Pg4eXjacnJKoVh1pOeZxULLZpCECw8yRZ9z4JPHxh2C7ytkCHMKp9O4MwQwYvvvgWWLWfJgb7Ecy2tgvWLpNDzgkFrEFhaCTKitChlG422CnLSsXvTBNnF52sULH6rcwOVx3mbhqte3ld3fObtAuH3zPzjOF4vVbvUXxgZh1Zx1cey0iGfnhOZHUfUwJ3Qv0WZNcuVLvMMhhg85A3620b84MAIc2UoW9Hl4BIT7pHo41ApF0DxIPJL0QdIdAOjn0JTPZqAhoHVBQoYvivPHftk5Crd1a1J8L7hSs0s4uSQKAMTKDxy3gKLaGAg277h4iEsEZRCI4RPlPTo9nZ48s8OO2KzqrUbMkoPSTgaJEXq8GsozAzh0wtL4P3gPeHO5nQzoytoXAkiXoPph0GaTLiahYQksYeK1eVQADDqZPXC55teXKKdX4aomCufr1ZizgzkGwAmnsFmhmBSF0gvbm56NDaUVT0UqXxKxAfRjkILeWR1mW8jfn6RYJH3IWiHxEfyB23rr78NySfgzIchhrm7jEFtmwPpKPKAwzajLv0HpkrtTr38YwWeT5LzHokFAQEc6l3aWdJWapVyt9wX89dEkmPPG9torCV2ddjyF4jAKsxKvzU4pCxV6B3m16IIdnksemJ0xG8iKh4ZPsX"); - for (int i = 0; i < 5; ++i) - { - for (int j = 0; j < 5; ++j) - { - staticData.my_union().complex().my_array_string()[i][j] = - "Ee4rH8nSX1xnWrlDqDJjKWtWntMia9RrZqZPznr0yIDjeroWxUUzpPVV8UK4qUF4eilYR3Dz42"; - } - } - for (int i = 0; i < 42; ++i) - { - staticData.my_union().complex().multi_alias_array_42()[i] = (MyEnum)(i % 3); - } - - for (int i = 0; i < 5; ++i) - { - for (int j = 0; j < 2; ++j) - { - staticData.my_union().complex().my_array_arrays()[i][j] = i * j; - } - } - - for (int i = 0; i < 23; ++i) - { - staticData.my_union().complex().my_sequences_array()[i].push_back(i); - staticData.my_union().complex().my_sequences_array()[i].push_back(i * 10); - staticData.my_union().complex().my_sequences_array()[i].push_back(i * 100); - } - staticData.my_union_2()._d(0); - staticData.my_union_2().uno(156); - - DynamicData* my_union = dynData->loan_value(dynData->get_member_id_by_name("my_union")); - - DynamicData* complex = my_union->loan_value(my_union->get_member_id_by_name("complex")); - complex->set_byte_value(66, complex->get_member_id_by_name("my_octet")); - - DynamicData* basic = complex->loan_value(complex->get_member_id_by_name("my_basic_struct")); - basic->set_bool_value(true, basic->get_member_id_by_name("my_bool")); - basic->set_byte_value(166, basic->get_member_id_by_name("my_octet")); - basic->set_int16_value(-10401, basic->get_member_id_by_name("my_int16")); - basic->set_int32_value(5884001, basic->get_member_id_by_name("my_int32")); - basic->set_int64_value(884481567, basic->get_member_id_by_name("my_int64")); - basic->set_uint16_value(250, basic->get_member_id_by_name("my_uint16")); - basic->set_uint32_value(15884, basic->get_member_id_by_name("my_uint32")); - basic->set_uint64_value(765241, basic->get_member_id_by_name("my_uint64")); - basic->set_float32_value(158.55f, basic->get_member_id_by_name("my_float32")); - basic->set_float64_value(765241.58, basic->get_member_id_by_name("my_float64")); - basic->set_float128_value(765241878.154874, basic->get_member_id_by_name("my_float128")); - basic->set_char8_value('L', basic->get_member_id_by_name("my_char")); - //basic->set_char16_value(L'G', basic->get_member_id_by_name("my_wchar")); - basic->set_string_value("Luis@eProsima", basic->get_member_id_by_name("my_string")); - //basic->set_wstring_value(L"LuisGasco@eProsima", basic->get_member_id_by_name("my_wstring")); - complex->return_loaned_value(basic); - - complex->set_enum_value("C", complex->get_member_id_by_name("my_alias_enum")); - complex->set_enum_value("B", complex->get_member_id_by_name("my_enum")); - - DynamicData* my_seq_octet = complex->loan_value(complex->get_member_id_by_name("my_sequence_octet")); - MemberId id; - my_seq_octet->insert_sequence_data(id); - my_seq_octet->set_byte_value(88, id); - my_seq_octet->insert_sequence_data(id); - my_seq_octet->set_byte_value(99, id); - //staticData.my_union().complex().my_sequence_octet().push_back(88); - //staticData.my_union().complex().my_sequence_octet().push_back(99); - complex->return_loaned_value(my_seq_octet); - - DynamicData* my_seq_struct = complex->loan_value(complex->get_member_id_by_name("my_sequence_struct")); - my_seq_struct->insert_sequence_data(id); - my_seq_struct->set_complex_value(DynamicDataFactory::get_instance()->create_copy(basic), id); - //staticData.my_union().complex().my_sequence_struct().push_back(staticData.my_union().complex().my_basic_struct()); - complex->return_loaned_value(my_seq_struct); - - DynamicData* my_array_octet = complex->loan_value(complex->get_member_id_by_name("my_array_octet")); - for (unsigned int i = 0; i < 500; ++i) - { - for (unsigned int j = 0; j < 5; ++j) - { - for (unsigned int k = 0; k < 4; ++k) - { - MemberId array_idx = my_array_octet->get_array_index({ i, j, k }); - my_array_octet->set_byte_value(static_cast(j * k), array_idx); - } - } - //staticData.my_union().complex().my_array_octet()[i][j][k] = j*k; - } - complex->return_loaned_value(my_array_octet); - - DynamicData* my_array_struct = complex->loan_value(complex->get_member_id_by_name("my_array_struct")); - for (int i = 0; i < 5; ++i) - { - DynamicData* tempBasic = DynamicDataFactory::get_instance()->create_data(GetBasicStructType()); - tempBasic->set_bool_value(i % 2 == 1, tempBasic->get_member_id_by_name("my_bool")); - tempBasic->set_byte_value(static_cast(i), tempBasic->get_member_id_by_name("my_octet")); - tempBasic->set_int16_value(static_cast(-i), tempBasic->get_member_id_by_name("my_int16")); - tempBasic->set_int32_value(i, tempBasic->get_member_id_by_name("my_int32")); - tempBasic->set_int64_value(i * 1000, tempBasic->get_member_id_by_name("my_int64")); - tempBasic->set_uint16_value(static_cast(i), tempBasic->get_member_id_by_name("my_uint16")); - tempBasic->set_uint32_value(i, tempBasic->get_member_id_by_name("my_uint32")); - tempBasic->set_uint64_value(i * 10005, tempBasic->get_member_id_by_name("my_uint64")); - tempBasic->set_float32_value(i * 5.5f, tempBasic->get_member_id_by_name("my_float32")); - tempBasic->set_float64_value(i * 8.8, tempBasic->get_member_id_by_name("my_float64")); - tempBasic->set_float128_value(i * 10.0, tempBasic->get_member_id_by_name("my_float128")); - tempBasic->set_char8_value('J', tempBasic->get_member_id_by_name("my_char")); - //tempBasic->set_char16_value(L'C', tempBasic->get_member_id_by_name("my_wchar")); - tempBasic->set_string_value("JC@eProsima", tempBasic->get_member_id_by_name("my_string")); - //tempBasic->set_wstring_value(L"JC-BOOM-Armadilo!@eProsima", tempBasic->get_member_id_by_name("my_wstring")); - my_array_struct->set_complex_value(tempBasic, i); - } - complex->return_loaned_value(my_array_struct); - - DynamicTypeBuilder_ptr octet_builder = m_factory->create_byte_builder(); - DynamicData_ptr key_oct(DynamicDataFactory::get_instance()->create_data(octet_builder->build())); - MemberId kId; - MemberId vId; - MemberId ssId; - MemberId sId; - DynamicData* my_map_octet_short = complex->loan_value(complex->get_member_id_by_name("my_map_octet_short")); - key_oct->set_byte_value(0); - my_map_octet_short->insert_map_data(key_oct.get(), kId, vId); - my_map_octet_short->set_int16_value((short)1340, vId); - key_oct = DynamicDataFactory::get_instance()->create_data(octet_builder->build()); - key_oct->set_byte_value(1); - my_map_octet_short->insert_map_data(key_oct.get(), kId, vId); - my_map_octet_short->set_int16_value((short)1341, vId); - //staticData.my_union().complex().my_map_octet_short()[0] = 1340; - //staticData.my_union().complex().my_map_octet_short()[1] = 1341; - complex->return_loaned_value(my_map_octet_short); - - DynamicTypeBuilder_ptr long_builder = m_factory->create_int32_builder(); - DynamicData_ptr key(DynamicDataFactory::get_instance()->create_data(long_builder->build())); - DynamicData* my_map_long_struct = complex->loan_value(complex->get_member_id_by_name("my_map_long_struct")); - - //DynamicData *mas3 = my_array_struct->loan_value(3); - key = DynamicDataFactory::get_instance()->create_data(long_builder->build()); - key->set_int32_value(55); - my_map_long_struct->insert_map_data(key.get(), kId, vId); - basic = my_map_long_struct->loan_value(vId); - basic->set_bool_value(true, basic->get_member_id_by_name("my_bool")); - basic->set_byte_value(166, basic->get_member_id_by_name("my_octet")); - basic->set_int16_value(-10401, basic->get_member_id_by_name("my_int16")); - basic->set_int32_value(5884001, basic->get_member_id_by_name("my_int32")); - basic->set_int64_value(884481567, basic->get_member_id_by_name("my_int64")); - basic->set_uint16_value(250, basic->get_member_id_by_name("my_uint16")); - basic->set_uint32_value(15884, basic->get_member_id_by_name("my_uint32")); - basic->set_uint64_value(765241, basic->get_member_id_by_name("my_uint64")); - basic->set_float32_value(158.55f, basic->get_member_id_by_name("my_float32")); - basic->set_float64_value(765241.58, basic->get_member_id_by_name("my_float64")); - basic->set_float128_value(765241878.154874, basic->get_member_id_by_name("my_float128")); - basic->set_char8_value('L', basic->get_member_id_by_name("my_char")); - //basic->set_char16_value(L'G', basic->get_member_id_by_name("my_wchar")); - basic->set_string_value("Luis@eProsima", basic->get_member_id_by_name("my_string")); - //basic->set_wstring_value(L"LuisGasco@eProsima", basic->get_member_id_by_name("my_wstring")); - my_map_long_struct->return_loaned_value(basic); - key = DynamicDataFactory::get_instance()->create_data(long_builder->build()); - key->set_int32_value(1000); - my_map_long_struct->insert_map_data(key.get(), kId, vId); - DynamicData* mas3 = my_map_long_struct->loan_value(vId); - int i = 3; - mas3->set_bool_value(i % 2 == 1, mas3->get_member_id_by_name("my_bool")); - mas3->set_byte_value(static_cast(i), mas3->get_member_id_by_name("my_octet")); - mas3->set_int16_value(static_cast(-i), mas3->get_member_id_by_name("my_int16")); - mas3->set_int32_value(i, mas3->get_member_id_by_name("my_int32")); - mas3->set_int64_value(i * 1000, mas3->get_member_id_by_name("my_int64")); - mas3->set_uint16_value(static_cast(i), mas3->get_member_id_by_name("my_uint16")); - mas3->set_uint32_value(i, mas3->get_member_id_by_name("my_uint32")); - mas3->set_uint64_value(i * 10005, mas3->get_member_id_by_name("my_uint64")); - mas3->set_float32_value(i * 5.5f, mas3->get_member_id_by_name("my_float32")); - mas3->set_float64_value(i * 8.8, mas3->get_member_id_by_name("my_float64")); - mas3->set_float128_value(i * 10.0, mas3->get_member_id_by_name("my_float128")); - mas3->set_char8_value('J', mas3->get_member_id_by_name("my_char")); - //mas3->set_char16_value(L'C', mas3->get_member_id_by_name("my_wchar")); - mas3->set_string_value("JC@eProsima", mas3->get_member_id_by_name("my_string")); - //mas3->set_wstring_value(L"JC-BOOM-Armadilo!@eProsima", mas3->get_member_id_by_name("my_wstring")); - my_map_long_struct->return_loaned_value(mas3); - - // staticData.my_union().complex().my_map_long_struct()[1000] = staticData.my_union().complex().my_array_struct()[3]; - // staticData.my_union().complex().my_map_long_struct()[55] = staticData.my_union().complex().my_basic_struct(); - complex->return_loaned_value(my_map_long_struct); - - DynamicData* my_map_long_seq_octet = complex->loan_value(complex->get_member_id_by_name("my_map_long_seq_octet")); - //std::vector my_vector_octet = {1, 2, 3, 4, 5}; - //MemberId id; - /*DynamicTypeBuilder_ptr octet_builder = m_factory->create_byte_builder(); - types::DynamicTypeBuilder_ptr seqOctet_builder = m_factory->create_sequence_builder(octet_builder.get()); - types::DynamicType_ptr seqSeqOctet_builder = m_factory->create_sequence_builder(seqOctet_builder.get())->build(); - DynamicData *dataSeqOctet = seqOctet_builder->build(); - DynamicData *dataSeqSeqOctet = seqSeqOctet_builder->build(); - dataSeqOctet->insert_sequence_data(id); - dataSeqOctet->set_byte_value(1, id); - dataSeqOctet->insert_sequence_data(id); - dataSeqOctet->set_byte_value(2, id); - dataSeqOctet->insert_sequence_data(id); - dataSeqOctet->set_byte_value(3, id); - dataSeqOctet->insert_sequence_data(id); - dataSeqOctet->set_byte_value(4, id); - dataSeqOctet->insert_sequence_data(id); - dataSeqOctet->set_byte_value(5, id); - dataSeqSeqOctet->insert_sequence_data(id); - dataSeqSeqOctet->set_complex_value(dataSeqOctet, id);*/ - // insert_map_data(DynamicData_ptr key, MemberId& outKeyId, MemberId& outValueId); - // TODO De la muerte para Juan Carlos - Esto no es NADA práctico... - - key = DynamicDataFactory::get_instance()->create_data(long_builder->build()); - key->set_int32_value(0); - my_map_long_seq_octet->insert_map_data(key.get(), kId, vId); - - DynamicData* seq_seq_oct = my_map_long_seq_octet->loan_value(vId); - seq_seq_oct->insert_sequence_data(ssId); - DynamicData* seq_oct = seq_seq_oct->loan_value(ssId); - seq_oct->insert_sequence_data(sId); - seq_oct->set_byte_value(1, sId); - seq_oct->insert_sequence_data(sId); - seq_oct->set_byte_value(2, sId); - seq_oct->insert_sequence_data(sId); - seq_oct->set_byte_value(3, sId); - seq_oct->insert_sequence_data(sId); - seq_oct->set_byte_value(4, sId); - seq_oct->insert_sequence_data(sId); - seq_oct->set_byte_value(5, sId); - seq_seq_oct->return_loaned_value(seq_oct); - my_map_long_seq_octet->return_loaned_value(seq_seq_oct); - - key = DynamicDataFactory::get_instance()->create_data(long_builder->build()); - key->set_int32_value(55); - my_map_long_seq_octet->insert_map_data(key.get(), kId, vId); - - seq_seq_oct = my_map_long_seq_octet->loan_value(vId); - seq_seq_oct->insert_sequence_data(ssId); - seq_oct = seq_seq_oct->loan_value(ssId); - seq_oct->insert_sequence_data(sId); - seq_oct->set_byte_value(1, sId); - seq_oct->insert_sequence_data(sId); - seq_oct->set_byte_value(2, sId); - seq_oct->insert_sequence_data(sId); - seq_oct->set_byte_value(3, sId); - seq_oct->insert_sequence_data(sId); - seq_oct->set_byte_value(4, sId); - seq_oct->insert_sequence_data(sId); - seq_oct->set_byte_value(5, sId); - seq_seq_oct->return_loaned_value(seq_oct); - seq_seq_oct->insert_sequence_data(ssId); - seq_oct = seq_seq_oct->loan_value(ssId); - seq_oct->insert_sequence_data(sId); - seq_oct->set_byte_value(1, sId); - seq_oct->insert_sequence_data(sId); - seq_oct->set_byte_value(2, sId); - seq_oct->insert_sequence_data(sId); - seq_oct->set_byte_value(3, sId); - seq_oct->insert_sequence_data(sId); - seq_oct->set_byte_value(4, sId); - seq_oct->insert_sequence_data(sId); - seq_oct->set_byte_value(5, sId); - seq_seq_oct->return_loaned_value(seq_oct); - my_map_long_seq_octet->return_loaned_value(seq_seq_oct); - //staticData.my_union().complex().my_map_long_seq_octet()[55].push_back(my_vector_octet); - //staticData.my_union().complex().my_map_long_seq_octet()[55].push_back(my_vector_octet); - //staticData.my_union().complex().my_map_long_seq_octet()[0].push_back(my_vector_octet); - complex->return_loaned_value(my_map_long_seq_octet); - - DynamicData* my_map_long_octet_array_500 = - complex->loan_value(complex->get_member_id_by_name("my_map_long_octet_array_500")); - - key = DynamicDataFactory::get_instance()->create_data(long_builder->build()); - key->set_int32_value(0); - my_map_long_octet_array_500->insert_map_data(key.get(), kId, vId); - - DynamicData* oct_array_500 = my_map_long_octet_array_500->loan_value(vId); - for (int j = 0; j < 500; ++j) - { - oct_array_500->set_byte_value(j % 256, j); - //staticData.my_union().complex().my_map_long_octet_array_500()[0][i] = i%256; - } - my_map_long_octet_array_500->return_loaned_value(oct_array_500); - - key = DynamicDataFactory::get_instance()->create_data(long_builder->build()); - key->set_int32_value(10); - my_map_long_octet_array_500->insert_map_data(key.get(), kId, vId); - oct_array_500 = my_map_long_octet_array_500->loan_value(vId); - - for (int j = 0; j < 500; ++j) - { - oct_array_500->set_byte_value((j + 55) % 256, j); - //staticData.my_union().complex().my_map_long_octet_array_500()[10][i] = (i+55)%256; - } - my_map_long_octet_array_500->return_loaned_value(oct_array_500); - complex->return_loaned_value(my_map_long_octet_array_500); - - complex->set_string_value( - "Bv7EMffURwGNqePoujdSfkF9PXN9TH125X5nGpNLfzya53tZtNJdgMROlYdZnTE1SLWzBdIU7ZyjjGvsGHkmuJUROwVPcNa9q5dRUV3KZAKNx1exL7BjhqIgQFconhd", complex->get_member_id_by_name( - "my_small_string_8")); - //complex->set_wstring_value(L"AgzñgXsI9pXbWjYLDvvn8JUFWhxZhk9t92rdsTqylvdpqtXA6hy9dHkoBTgmF2c", complex->get_member_id_by_name( - // "my_small_string_16")); - complex->set_string_value( - "hYE5vjcLJe6ML5DmoqQwh9ns866dAbnjkVKIKu2VF6lbkvh91ZOG2enEcdoRa8T43hR0Ym0k7tI621EQGufvzmLqxKCPgiXSp2zUTTmIWtn4fM8tC3aP1Yd0dKvn0tDobyp6p3156KvxqG3BKQ6VjFiHlMFoEyz8pjCclhXLl2cfAi97sQzXLUoPYUC5BWKyQTrA2JF6HXZM6vrbw5dc3B4AOJNGdPJ9ai6weF43h1RhnXE9MOFxPNoQnJ8gqSXYbMtpG6ZzqhUyoz0XhFDt7EOqXIgvc9SCejQTVMPeRcF5Zy57hrYZiKrCQqFWidS4BdfEAkuwESgBmEpEFOpZotwDt0TGDaLktSt3dKRsURO6TpuZ2nZNdiEJyc597ZjjQXtyKU7OCyRRqllzAnHEtoU3zd3OLTOvT5uk32N1Y64tpUte63De2EMwDNYb2eGAQfATdSt8VcGBOzJQjsmrMwMumtk48JzXXLxjo6s2vl2rNK9WQM1", complex->get_member_id_by_name( - "my_large_string_8")); - //complex->set_wstring_value( - // L"nosYBfFr1s3t8rUsuUrVCWFi6moDk7GULFj6XnkebIDkjl3n2ykKxUIaLj3qNNUx0ny8DvFbdfxZBdMhBNW3fHbKrig4GkHnN1JoEo0ACiPxrARusDs3xKzvaQQrls6lVUFAUXzDOtw5f2CNVJKiruGjXUO2Lq5Mmy8ygW3eUiTlueAHA2dRXXryOFi47jS3DkmBH4aAOKcmR27KhhJnXaY0gWy3XdSnaGQNB3XvbmxQ7xXDsf1wz860WMEKP3VhdOLsmS6tKCb4sshuOlmUSyTggY7vNoxfpG1EUFP5iPro9E0tHLLdHlWf2NwU8OXCYx6KKEbs5pFMvgEstnQglsdTk0lOv6riaFkFOwx83gW1l6Pg4eXjacnJKoVh1pOeZxULLZpCECw8yRZ9z4JPHxh2C7ytkCHMKp9O4MwQwYvvvgWWLWfJgb7Ecy2tgvWLpNDzgkFrEFhaCTKitChlG422CnLSsXvTBNnF52sULH6rcwOVx3mbhqte3ld3fObtAuH3zPzjOF4vVbvUXxgZh1Zx1cey0iGfnhOZHUfUwJ3Qv0WZNcuVLvMMhhg85A3620b84MAIc2UoW9Hl4BIT7pHo41ApF0DxIPJL0QdIdAOjn0JTPZqAhoHVBQoYvivPHftk5Crd1a1J8L7hSs0s4uSQKAMTKDxy3gKLaGAg277h4iEsEZRCI4RPlPTo9nZ48s8OO2KzqrUbMkoPSTgaJEXq8GsozAzh0wtL4P3gPeHO5nQzoytoXAkiXoPph0GaTLiahYQksYeK1eVQADDqZPXC55teXKKdX4aomCufr1ZizgzkGwAmnsFmhmBSF0gvbm56NDaUVT0UqXxKxAfRjkILeWR1mW8jfn6RYJH3IWiHxEfyB23rr78NySfgzIchhrm7jEFtmwPpKPKAwzajLv0HpkrtTr38YwWeT5LzHokFAQEc6l3aWdJWapVyt9wX89dEkmPPG9torCV2ddjyF4jAKsxKvzU4pCxV6B3m16IIdnksemJ0xG8iKh4ZPsX", complex->get_member_id_by_name( - // "my_large_string_16")); - - DynamicData* my_array_string = complex->loan_value(complex->get_member_id_by_name("my_array_string")); - for (unsigned int j = 0; j < 5; ++j) - { - for (unsigned int k = 0; k < 5; ++k) - { - MemberId array_idx = my_array_string->get_array_index({ j, k }); - my_array_string->set_string_value( - "Ee4rH8nSX1xnWrlDqDJjKWtWntMia9RrZqZPznr0yIDjeroWxUUzpPVV8UK4qUF4eilYR3Dz42", array_idx); - //staticData.my_union().complex().my_array_string()[i][j]("Ee4rH8nSX1xnWrlDqDJjKWtWntMia9RrZqZPznr0yIDjeroWxUUzpPVV8UK4qUF4eilYR3Dz42"); - } - } - complex->return_loaned_value(my_array_string); - - DynamicData* multi_alias_array_42 = complex->loan_value(complex->get_member_id_by_name("multi_alias_array_42")); - for (int j = 0; j < 42; ++j) - { - multi_alias_array_42->set_enum_value(j % 3, j); - //staticData.my_union().complex().multi_alias_array_42()[i](i%3); - } - complex->return_loaned_value(multi_alias_array_42); - - DynamicData* my_array_arrays = complex->loan_value(complex->get_member_id_by_name("my_array_arrays")); - for (unsigned int j = 0; j < 5; ++j) - { - DynamicData* myMiniArray = my_array_arrays->loan_value(j); - for (unsigned int k = 0; k < 2; ++k) - { - myMiniArray->set_int32_value(j * k, k); - //staticData.my_union().complex().my_array_arrays()[i][j](i*j); - } - my_array_arrays->return_loaned_value(myMiniArray); - } - complex->return_loaned_value(my_array_arrays); - - DynamicData* my_sequences_array = complex->loan_value(complex->get_member_id_by_name("my_sequences_array")); - for (int j = 0; j < 23; ++j) - { - DynamicData* seq = DynamicDataFactory::get_instance()->create_data(GetMySequenceLongType()); - seq->insert_sequence_data(id); - seq->set_int32_value(j, id); - seq->insert_sequence_data(id); - seq->set_int32_value(j * 10, id); - seq->insert_sequence_data(id); - seq->set_int32_value(j * 100, id); - my_sequences_array->set_complex_value(seq, j); - // staticData.my_union().complex().my_sequences_array()[i].push_back(i); - // staticData.my_union().complex().my_sequences_array()[i].push_back(i*10); - // staticData.my_union().complex().my_sequences_array()[i].push_back(i*100); - } - complex->return_loaned_value(my_sequences_array); - - my_union->return_loaned_value(complex); - dynData->return_loaned_value(my_union); - - DynamicData* my_union_2 = dynData->loan_value(dynData->get_member_id_by_name("my_union_2")); - my_union_2->set_int32_value(156, my_union_2->get_member_id_by_name("uno")); - - dynData->return_loaned_value(my_union_2); - - // Serialize <-> Deserialize Test - DynamicPubSubType pubsubType(m_DynManualType); - uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(dynData.get())()); - SerializedPayload_t payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(dynData.get(), &payload)); - ASSERT_TRUE(payload.length == payloadSize); - /* - std::cout << "BEGIN" << std::endl; - for (uint32_t j = 0; j < payload.length; j += 100) - { - std::cout << std::endl; - for (uint32_t k = 0; k < 100; k++) - { - if (j + k < payload.length) - { - if ((int)payload.data[j + k] == 204) - { - std::cout << 0 << " "; - } - else - { - std::cout << (int)payload.data[j + k] << " "; - } - } - } - } - std::cout << "END" << std::endl; - */ - CompleteStructPubSubType pbComplete; - uint32_t payloadSize2 = static_cast(m_StaticType.getSerializedSizeProvider(&staticData)()); - SerializedPayload_t stPayload(payloadSize2); - ASSERT_TRUE(pbComplete.serialize(&staticData, &stPayload)); - ASSERT_TRUE(stPayload.length == payloadSize2); - /* - std::cout << "BEGIN" << std::endl; - for (uint32_t j = 0; j < stPayload.length; j += 100) - { - std::cout << std::endl; - for (uint32_t k = 0; k < 100; k++) - { - if (j + k < stPayload.length) - { - if ((int)stPayload.data[j + k] == 204) - { - std::cout << 0 << " "; - } - else - { - std::cout << (int)stPayload.data[j + k] << " "; - } - } - } - } - std::cout << "END" << std::endl; - */ - types::DynamicData_ptr dynDataFromDynamic(DynamicDataFactory::get_instance()->create_data(m_DynAutoType)); - ASSERT_TRUE(pubsubType.deserialize(&payload, dynDataFromDynamic.get())); - - types::DynamicData_ptr dynDataFromStatic(DynamicDataFactory::get_instance()->create_data(m_DynAutoType)); - ASSERT_TRUE(pubsubType.deserialize(&stPayload, dynDataFromStatic.get())); - - ASSERT_TRUE(dynDataFromStatic->equals(dynDataFromDynamic.get())); -} - -TEST_F(DynamicComplexTypesTests, Data_Comparison_B_B) -{ - types::DynamicData_ptr dynData(DynamicDataFactory::get_instance()->create_data(m_DynManualType)); - - CompleteStruct staticData; - staticData.my_union()._d() = MyEnum::B; - staticData.my_union().complex().my_octet(66); - staticData.my_union().complex().my_basic_struct().my_bool(true); - staticData.my_union().complex().my_basic_struct().my_octet(166); - staticData.my_union().complex().my_basic_struct().my_int16(-10401); - staticData.my_union().complex().my_basic_struct().my_int32(5884001); - staticData.my_union().complex().my_basic_struct().my_int64(884481567); - staticData.my_union().complex().my_basic_struct().my_uint16(250); - staticData.my_union().complex().my_basic_struct().my_uint32(15884); - staticData.my_union().complex().my_basic_struct().my_uint64(765241); - staticData.my_union().complex().my_basic_struct().my_float32(158.55f); - staticData.my_union().complex().my_basic_struct().my_float64(765241.58); - staticData.my_union().complex().my_basic_struct().my_float128(765241878.154874); - staticData.my_union().complex().my_basic_struct().my_char('L'); - //staticData.my_union().complex().my_basic_struct().my_wchar(L'G'); - staticData.my_union().complex().my_basic_struct().my_string("Luis@eProsima"); - //staticData.my_union().complex().my_basic_struct().my_wstring(L"LuisGasco@eProsima"); - - staticData.my_union().complex().my_alias_enum(MyEnum::C); - staticData.my_union().complex().my_enum(MyEnum::B); - staticData.my_union().complex().my_sequence_octet().push_back(88); - staticData.my_union().complex().my_sequence_octet().push_back(99); - staticData.my_union().complex().my_sequence_struct().push_back(staticData.my_union().complex().my_basic_struct()); - for (int i = 0; i < 500; ++i) - { - for (int j = 0; j < 5; ++j) - { - for (int k = 0; k < 4; ++k) - { - staticData.my_union().complex().my_array_octet()[i][j][k] = static_cast(j * k); - } - } - } - - for (int i = 0; i < 5; ++i) - { - staticData.my_union().complex().my_array_struct()[i].my_bool(i % 2 == 1); - staticData.my_union().complex().my_array_struct()[i].my_octet(static_cast(i)); - staticData.my_union().complex().my_array_struct()[i].my_int16(static_cast(-i)); - staticData.my_union().complex().my_array_struct()[i].my_int32(i); - staticData.my_union().complex().my_array_struct()[i].my_int64(i * 1000); - staticData.my_union().complex().my_array_struct()[i].my_uint16(static_cast(i)); - staticData.my_union().complex().my_array_struct()[i].my_uint32(i); - staticData.my_union().complex().my_array_struct()[i].my_uint64(i * 10005); - staticData.my_union().complex().my_array_struct()[i].my_float32(i * 5.5f); - staticData.my_union().complex().my_array_struct()[i].my_float64(i * 8.8); - staticData.my_union().complex().my_array_struct()[i].my_float128(i * 10.0); - staticData.my_union().complex().my_array_struct()[i].my_char('J'); - //staticData.my_union().complex().my_array_struct()[i].my_wchar(L'C'); - staticData.my_union().complex().my_array_struct()[i].my_string("JC@eProsima"); - //staticData.my_union().complex().my_array_struct()[i].my_wstring(L"JC-BOOM-Armadilo!@eProsima"); - } - - staticData.my_union().complex().my_map_octet_short()[0] = 1340; - staticData.my_union().complex().my_map_octet_short()[1] = 1341; - staticData.my_union().complex().my_map_long_struct()[1000] = staticData.my_union().complex().my_array_struct()[3]; - staticData.my_union().complex().my_map_long_struct()[55] = staticData.my_union().complex().my_basic_struct(); - - staticData.my_union().complex().my_map_long_seq_octet()[55].push_back({ 1, 2, 3, 4, 5 }); - staticData.my_union().complex().my_map_long_seq_octet()[55].push_back({ 1, 2, 3, 4, 5 }); - staticData.my_union().complex().my_map_long_seq_octet()[0].push_back({ 1, 2, 3, 4, 5 }); - for (int i = 0; i < 500; ++i) - { - staticData.my_union().complex().my_map_long_octet_array_500()[0][i] = i % 256; - staticData.my_union().complex().my_map_long_octet_array_500()[10][i] = (i + 55) % 256; - } - - staticData.my_union().complex().my_small_string_8( - "Bv7EMffURwGNqePoujdSfkF9PXN9TH125X5nGpNLfzya53tZtNJdgMROlYdZnTE1SLWzBdIU7ZyjjGvsGHkmuJUROwVPcNa9q5dRUV3KZAKNx1exL7BjhqIgQFconhd"); - //staticData.my_union().complex().my_small_string_16( - // L"AgzñgXsI9pXbWjYLDvvn8JUFWhxZhk9t92rdsTqylvdpqtXA6hy9dHkoBTgmF2c"); - staticData.my_union().complex().my_large_string_8( - "hYE5vjcLJe6ML5DmoqQwh9ns866dAbnjkVKIKu2VF6lbkvh91ZOG2enEcdoRa8T43hR0Ym0k7tI621EQGufvzmLqxKCPgiXSp2zUTTmIWtn4fM8tC3aP1Yd0dKvn0tDobyp6p3156KvxqG3BKQ6VjFiHlMFoEyz8pjCclhXLl2cfAi97sQzXLUoPYUC5BWKyQTrA2JF6HXZM6vrbw5dc3B4AOJNGdPJ9ai6weF43h1RhnXE9MOFxPNoQnJ8gqSXYbMtpG6ZzqhUyoz0XhFDt7EOqXIgvc9SCejQTVMPeRcF5Zy57hrYZiKrCQqFWidS4BdfEAkuwESgBmEpEFOpZotwDt0TGDaLktSt3dKRsURO6TpuZ2nZNdiEJyc597ZjjQXtyKU7OCyRRqllzAnHEtoU3zd3OLTOvT5uk32N1Y64tpUte63De2EMwDNYb2eGAQfATdSt8VcGBOzJQjsmrMwMumtk48JzXXLxjo6s2vl2rNK9WQM1"); - //staticData.my_union().complex().my_large_string_16( - // L"nosYBfFr1s3t8rUsuUrVCWFi6moDk7GULFj6XnkebIDkjl3n2ykKxUIaLj3qNNUx0ny8DvFbdfxZBdMhBNW3fHbKrig4GkHnN1JoEo0ACiPxrARusDs3xKzvaQQrls6lVUFAUXzDOtw5f2CNVJKiruGjXUO2Lq5Mmy8ygW3eUiTlueAHA2dRXXryOFi47jS3DkmBH4aAOKcmR27KhhJnXaY0gWy3XdSnaGQNB3XvbmxQ7xXDsf1wz860WMEKP3VhdOLsmS6tKCb4sshuOlmUSyTggY7vNoxfpG1EUFP5iPro9E0tHLLdHlWf2NwU8OXCYx6KKEbs5pFMvgEstnQglsdTk0lOv6riaFkFOwx83gW1l6Pg4eXjacnJKoVh1pOeZxULLZpCECw8yRZ9z4JPHxh2C7ytkCHMKp9O4MwQwYvvvgWWLWfJgb7Ecy2tgvWLpNDzgkFrEFhaCTKitChlG422CnLSsXvTBNnF52sULH6rcwOVx3mbhqte3ld3fObtAuH3zPzjOF4vVbvUXxgZh1Zx1cey0iGfnhOZHUfUwJ3Qv0WZNcuVLvMMhhg85A3620b84MAIc2UoW9Hl4BIT7pHo41ApF0DxIPJL0QdIdAOjn0JTPZqAhoHVBQoYvivPHftk5Crd1a1J8L7hSs0s4uSQKAMTKDxy3gKLaGAg277h4iEsEZRCI4RPlPTo9nZ48s8OO2KzqrUbMkoPSTgaJEXq8GsozAzh0wtL4P3gPeHO5nQzoytoXAkiXoPph0GaTLiahYQksYeK1eVQADDqZPXC55teXKKdX4aomCufr1ZizgzkGwAmnsFmhmBSF0gvbm56NDaUVT0UqXxKxAfRjkILeWR1mW8jfn6RYJH3IWiHxEfyB23rr78NySfgzIchhrm7jEFtmwPpKPKAwzajLv0HpkrtTr38YwWeT5LzHokFAQEc6l3aWdJWapVyt9wX89dEkmPPG9torCV2ddjyF4jAKsxKvzU4pCxV6B3m16IIdnksemJ0xG8iKh4ZPsX"); - for (int i = 0; i < 5; ++i) - { - for (int j = 0; j < 5; ++j) - { - staticData.my_union().complex().my_array_string()[i][j] = - "Ee4rH8nSX1xnWrlDqDJjKWtWntMia9RrZqZPznr0yIDjeroWxUUzpPVV8UK4qUF4eilYR3Dz42"; - } - } - for (int i = 0; i < 42; ++i) - { - staticData.my_union().complex().multi_alias_array_42()[i] = (MyEnum)(i % 3); - } - - for (int i = 0; i < 5; ++i) - { - for (int j = 0; j < 2; ++j) - { - staticData.my_union().complex().my_array_arrays()[i][j] = i * j; - } - } - - for (int i = 0; i < 23; ++i) - { - staticData.my_union().complex().my_sequences_array()[i].push_back(i); - staticData.my_union().complex().my_sequences_array()[i].push_back(i * 10); - staticData.my_union().complex().my_sequences_array()[i].push_back(i * 100); - } - //staticData.my_union_2()._d() = B; - staticData.my_union_2().imString("GASCO!"); - - DynamicData* my_union = dynData->loan_value(dynData->get_member_id_by_name("my_union")); - - DynamicData* complex = my_union->loan_value(my_union->get_member_id_by_name("complex")); - complex->set_byte_value(66, complex->get_member_id_by_name("my_octet")); - - DynamicData* basic = complex->loan_value(complex->get_member_id_by_name("my_basic_struct")); - basic->set_bool_value(true, basic->get_member_id_by_name("my_bool")); - basic->set_byte_value(166, basic->get_member_id_by_name("my_octet")); - basic->set_int16_value(-10401, basic->get_member_id_by_name("my_int16")); - basic->set_int32_value(5884001, basic->get_member_id_by_name("my_int32")); - basic->set_int64_value(884481567, basic->get_member_id_by_name("my_int64")); - basic->set_uint16_value(250, basic->get_member_id_by_name("my_uint16")); - basic->set_uint32_value(15884, basic->get_member_id_by_name("my_uint32")); - basic->set_uint64_value(765241, basic->get_member_id_by_name("my_uint64")); - basic->set_float32_value(158.55f, basic->get_member_id_by_name("my_float32")); - basic->set_float64_value(765241.58, basic->get_member_id_by_name("my_float64")); - basic->set_float128_value(765241878.154874, basic->get_member_id_by_name("my_float128")); - basic->set_char8_value('L', basic->get_member_id_by_name("my_char")); - //basic->set_char16_value(L'G', basic->get_member_id_by_name("my_wchar")); - basic->set_string_value("Luis@eProsima", basic->get_member_id_by_name("my_string")); - //basic->set_wstring_value(L"LuisGasco@eProsima", basic->get_member_id_by_name("my_wstring")); - complex->return_loaned_value(basic); - - complex->set_enum_value("C", complex->get_member_id_by_name("my_alias_enum")); - complex->set_enum_value("B", complex->get_member_id_by_name("my_enum")); - - DynamicData* my_seq_octet = complex->loan_value(complex->get_member_id_by_name("my_sequence_octet")); - MemberId id; - my_seq_octet->insert_sequence_data(id); - my_seq_octet->set_byte_value(88, id); - my_seq_octet->insert_sequence_data(id); - my_seq_octet->set_byte_value(99, id); - //staticData.my_union().complex().my_sequence_octet().push_back(88); - //staticData.my_union().complex().my_sequence_octet().push_back(99); - complex->return_loaned_value(my_seq_octet); - - DynamicData* my_seq_struct = complex->loan_value(complex->get_member_id_by_name("my_sequence_struct")); - my_seq_struct->insert_sequence_data(id); - my_seq_struct->set_complex_value(DynamicDataFactory::get_instance()->create_copy(basic), id); - //staticData.my_union().complex().my_sequence_struct().push_back(staticData.my_union().complex().my_basic_struct()); - complex->return_loaned_value(my_seq_struct); - - DynamicData* my_array_octet = complex->loan_value(complex->get_member_id_by_name("my_array_octet")); - for (unsigned int i = 0; i < 500; ++i) - { - for (unsigned int j = 0; j < 5; ++j) - { - for (unsigned int k = 0; k < 4; ++k) - { - MemberId array_idx = my_array_octet->get_array_index({ i, j, k }); - my_array_octet->set_byte_value(static_cast(j * k), array_idx); - } - } - //staticData.my_union().complex().my_array_octet()[i][j][k] = j*k; - } - complex->return_loaned_value(my_array_octet); - - DynamicData* my_array_struct = complex->loan_value(complex->get_member_id_by_name("my_array_struct")); - for (int i = 0; i < 5; ++i) - { - DynamicData* tempBasic = DynamicDataFactory::get_instance()->create_data(GetBasicStructType()); - tempBasic->set_bool_value(i % 2 == 1, tempBasic->get_member_id_by_name("my_bool")); - tempBasic->set_byte_value(static_cast(i), tempBasic->get_member_id_by_name("my_octet")); - tempBasic->set_int16_value(static_cast(-i), tempBasic->get_member_id_by_name("my_int16")); - tempBasic->set_int32_value(i, tempBasic->get_member_id_by_name("my_int32")); - tempBasic->set_int64_value(i * 1000, tempBasic->get_member_id_by_name("my_int64")); - tempBasic->set_uint16_value(static_cast(i), tempBasic->get_member_id_by_name("my_uint16")); - tempBasic->set_uint32_value(i, tempBasic->get_member_id_by_name("my_uint32")); - tempBasic->set_uint64_value(i * 10005, tempBasic->get_member_id_by_name("my_uint64")); - tempBasic->set_float32_value(i * 5.5f, tempBasic->get_member_id_by_name("my_float32")); - tempBasic->set_float64_value(i * 8.8, tempBasic->get_member_id_by_name("my_float64")); - tempBasic->set_float128_value(i * 10.0, tempBasic->get_member_id_by_name("my_float128")); - tempBasic->set_char8_value('J', tempBasic->get_member_id_by_name("my_char")); - //tempBasic->set_char16_value(L'C', tempBasic->get_member_id_by_name("my_wchar")); - tempBasic->set_string_value("JC@eProsima", tempBasic->get_member_id_by_name("my_string")); - //tempBasic->set_wstring_value(L"JC-BOOM-Armadilo!@eProsima", tempBasic->get_member_id_by_name("my_wstring")); - my_array_struct->set_complex_value(tempBasic, i); - } - complex->return_loaned_value(my_array_struct); - - DynamicTypeBuilder_ptr octet_builder = m_factory->create_byte_builder(); - DynamicData_ptr key_oct(DynamicDataFactory::get_instance()->create_data(octet_builder->build())); - MemberId kId; - MemberId vId; - MemberId ssId; - MemberId sId; - DynamicData* my_map_octet_short = complex->loan_value(complex->get_member_id_by_name("my_map_octet_short")); - key_oct->set_byte_value(0); - my_map_octet_short->insert_map_data(key_oct.get(), kId, vId); - my_map_octet_short->set_int16_value((short)1340, vId); - key_oct = DynamicDataFactory::get_instance()->create_data(octet_builder->build()); - key_oct->set_byte_value(1); - my_map_octet_short->insert_map_data(key_oct.get(), kId, vId); - my_map_octet_short->set_int16_value((short)1341, vId); - //staticData.my_union().complex().my_map_octet_short()[0] = 1340; - //staticData.my_union().complex().my_map_octet_short()[1] = 1341; - complex->return_loaned_value(my_map_octet_short); - - DynamicTypeBuilder_ptr long_builder = m_factory->create_int32_builder(); - DynamicData_ptr key(DynamicDataFactory::get_instance()->create_data(long_builder->build())); - DynamicData* my_map_long_struct = complex->loan_value(complex->get_member_id_by_name("my_map_long_struct")); - - //DynamicData *mas3 = my_array_struct->loan_value(3); - key = DynamicDataFactory::get_instance()->create_data(long_builder->build()); - key->set_int32_value(55); - my_map_long_struct->insert_map_data(key.get(), kId, vId); - basic = my_map_long_struct->loan_value(vId); - basic->set_bool_value(true, basic->get_member_id_by_name("my_bool")); - basic->set_byte_value(166, basic->get_member_id_by_name("my_octet")); - basic->set_int16_value(-10401, basic->get_member_id_by_name("my_int16")); - basic->set_int32_value(5884001, basic->get_member_id_by_name("my_int32")); - basic->set_int64_value(884481567, basic->get_member_id_by_name("my_int64")); - basic->set_uint16_value(250, basic->get_member_id_by_name("my_uint16")); - basic->set_uint32_value(15884, basic->get_member_id_by_name("my_uint32")); - basic->set_uint64_value(765241, basic->get_member_id_by_name("my_uint64")); - basic->set_float32_value(158.55f, basic->get_member_id_by_name("my_float32")); - basic->set_float64_value(765241.58, basic->get_member_id_by_name("my_float64")); - basic->set_float128_value(765241878.154874, basic->get_member_id_by_name("my_float128")); - basic->set_char8_value('L', basic->get_member_id_by_name("my_char")); - //basic->set_char16_value(L'G', basic->get_member_id_by_name("my_wchar")); - basic->set_string_value("Luis@eProsima", basic->get_member_id_by_name("my_string")); - //basic->set_wstring_value(L"LuisGasco@eProsima", basic->get_member_id_by_name("my_wstring")); - my_map_long_struct->return_loaned_value(basic); - key = DynamicDataFactory::get_instance()->create_data(long_builder->build()); - key->set_int32_value(1000); - my_map_long_struct->insert_map_data(key.get(), kId, vId); - DynamicData* mas3 = my_map_long_struct->loan_value(vId); - int i = 3; - mas3->set_bool_value(i % 2 == 1, mas3->get_member_id_by_name("my_bool")); - mas3->set_byte_value(static_cast(i), mas3->get_member_id_by_name("my_octet")); - mas3->set_int16_value(static_cast(-i), mas3->get_member_id_by_name("my_int16")); - mas3->set_int32_value(i, mas3->get_member_id_by_name("my_int32")); - mas3->set_int64_value(i * 1000, mas3->get_member_id_by_name("my_int64")); - mas3->set_uint16_value(static_cast(i), mas3->get_member_id_by_name("my_uint16")); - mas3->set_uint32_value(i, mas3->get_member_id_by_name("my_uint32")); - mas3->set_uint64_value(i * 10005, mas3->get_member_id_by_name("my_uint64")); - mas3->set_float32_value(i * 5.5f, mas3->get_member_id_by_name("my_float32")); - mas3->set_float64_value(i * 8.8, mas3->get_member_id_by_name("my_float64")); - mas3->set_float128_value(i * 10.0, mas3->get_member_id_by_name("my_float128")); - mas3->set_char8_value('J', mas3->get_member_id_by_name("my_char")); - //mas3->set_char16_value(L'C', mas3->get_member_id_by_name("my_wchar")); - mas3->set_string_value("JC@eProsima", mas3->get_member_id_by_name("my_string")); - //mas3->set_wstring_value(L"JC-BOOM-Armadilo!@eProsima", mas3->get_member_id_by_name("my_wstring")); - my_map_long_struct->return_loaned_value(mas3); - - // staticData.my_union().complex().my_map_long_struct()[1000] = staticData.my_union().complex().my_array_struct()[3]; - // staticData.my_union().complex().my_map_long_struct()[55] = staticData.my_union().complex().my_basic_struct(); - complex->return_loaned_value(my_map_long_struct); - - DynamicData* my_map_long_seq_octet = complex->loan_value(complex->get_member_id_by_name("my_map_long_seq_octet")); - //std::vector my_vector_octet = {1, 2, 3, 4, 5}; - //MemberId id; - /*DynamicTypeBuilder_ptr octet_builder = m_factory->create_byte_builder(); - types::DynamicTypeBuilder_ptr seqOctet_builder = m_factory->create_sequence_builder(octet_builder.get()); - types::DynamicType_ptr seqSeqOctet_builder = m_factory->create_sequence_builder(seqOctet_builder.get())->build(); - DynamicData *dataSeqOctet = seqOctet_builder->build(); - DynamicData *dataSeqSeqOctet = seqSeqOctet_builder->build(); - dataSeqOctet->insert_sequence_data(id); - dataSeqOctet->set_byte_value(1, id); - dataSeqOctet->insert_sequence_data(id); - dataSeqOctet->set_byte_value(2, id); - dataSeqOctet->insert_sequence_data(id); - dataSeqOctet->set_byte_value(3, id); - dataSeqOctet->insert_sequence_data(id); - dataSeqOctet->set_byte_value(4, id); - dataSeqOctet->insert_sequence_data(id); - dataSeqOctet->set_byte_value(5, id); - dataSeqSeqOctet->insert_sequence_data(id); - dataSeqSeqOctet->set_complex_value(dataSeqOctet, id);*/ - // insert_map_data(DynamicData_ptr key, MemberId& outKeyId, MemberId& outValueId); - // TODO De la muerte para Juan Carlos - Esto no es NADA práctico... - - key = DynamicDataFactory::get_instance()->create_data(long_builder->build()); - key->set_int32_value(0); - my_map_long_seq_octet->insert_map_data(key.get(), kId, vId); - - DynamicData* seq_seq_oct = my_map_long_seq_octet->loan_value(vId); - seq_seq_oct->insert_sequence_data(ssId); - DynamicData* seq_oct = seq_seq_oct->loan_value(ssId); - seq_oct->insert_sequence_data(sId); - seq_oct->set_byte_value(1, sId); - seq_oct->insert_sequence_data(sId); - seq_oct->set_byte_value(2, sId); - seq_oct->insert_sequence_data(sId); - seq_oct->set_byte_value(3, sId); - seq_oct->insert_sequence_data(sId); - seq_oct->set_byte_value(4, sId); - seq_oct->insert_sequence_data(sId); - seq_oct->set_byte_value(5, sId); - seq_seq_oct->return_loaned_value(seq_oct); - my_map_long_seq_octet->return_loaned_value(seq_seq_oct); - - key = DynamicDataFactory::get_instance()->create_data(long_builder->build()); - key->set_int32_value(55); - my_map_long_seq_octet->insert_map_data(key.get(), kId, vId); - - seq_seq_oct = my_map_long_seq_octet->loan_value(vId); - seq_seq_oct->insert_sequence_data(ssId); - seq_oct = seq_seq_oct->loan_value(ssId); - seq_oct->insert_sequence_data(sId); - seq_oct->set_byte_value(1, sId); - seq_oct->insert_sequence_data(sId); - seq_oct->set_byte_value(2, sId); - seq_oct->insert_sequence_data(sId); - seq_oct->set_byte_value(3, sId); - seq_oct->insert_sequence_data(sId); - seq_oct->set_byte_value(4, sId); - seq_oct->insert_sequence_data(sId); - seq_oct->set_byte_value(5, sId); - seq_seq_oct->return_loaned_value(seq_oct); - seq_seq_oct->insert_sequence_data(ssId); - seq_oct = seq_seq_oct->loan_value(ssId); - seq_oct->insert_sequence_data(sId); - seq_oct->set_byte_value(1, sId); - seq_oct->insert_sequence_data(sId); - seq_oct->set_byte_value(2, sId); - seq_oct->insert_sequence_data(sId); - seq_oct->set_byte_value(3, sId); - seq_oct->insert_sequence_data(sId); - seq_oct->set_byte_value(4, sId); - seq_oct->insert_sequence_data(sId); - seq_oct->set_byte_value(5, sId); - seq_seq_oct->return_loaned_value(seq_oct); - my_map_long_seq_octet->return_loaned_value(seq_seq_oct); - //staticData.my_union().complex().my_map_long_seq_octet()[55].push_back(my_vector_octet); - //staticData.my_union().complex().my_map_long_seq_octet()[55].push_back(my_vector_octet); - //staticData.my_union().complex().my_map_long_seq_octet()[0].push_back(my_vector_octet); - complex->return_loaned_value(my_map_long_seq_octet); - - DynamicData* my_map_long_octet_array_500 = - complex->loan_value(complex->get_member_id_by_name("my_map_long_octet_array_500")); - - key = DynamicDataFactory::get_instance()->create_data(long_builder->build()); - key->set_int32_value(0); - my_map_long_octet_array_500->insert_map_data(key.get(), kId, vId); - - DynamicData* oct_array_500 = my_map_long_octet_array_500->loan_value(vId); - for (int j = 0; j < 500; ++j) - { - oct_array_500->set_byte_value(j % 256, j); - //staticData.my_union().complex().my_map_long_octet_array_500()[0][i] = i%256; - } - my_map_long_octet_array_500->return_loaned_value(oct_array_500); - - key = DynamicDataFactory::get_instance()->create_data(long_builder->build()); - key->set_int32_value(10); - my_map_long_octet_array_500->insert_map_data(key.get(), kId, vId); - oct_array_500 = my_map_long_octet_array_500->loan_value(vId); - - for (int j = 0; j < 500; ++j) - { - oct_array_500->set_byte_value((j + 55) % 256, j); - //staticData.my_union().complex().my_map_long_octet_array_500()[10][i] = (i+55)%256; - } - my_map_long_octet_array_500->return_loaned_value(oct_array_500); - complex->return_loaned_value(my_map_long_octet_array_500); - - complex->set_string_value( - "Bv7EMffURwGNqePoujdSfkF9PXN9TH125X5nGpNLfzya53tZtNJdgMROlYdZnTE1SLWzBdIU7ZyjjGvsGHkmuJUROwVPcNa9q5dRUV3KZAKNx1exL7BjhqIgQFconhd", complex->get_member_id_by_name( - "my_small_string_8")); - //complex->set_wstring_value(L"AgzñgXsI9pXbWjYLDvvn8JUFWhxZhk9t92rdsTqylvdpqtXA6hy9dHkoBTgmF2c", complex->get_member_id_by_name( - // "my_small_string_16")); - complex->set_string_value( - "hYE5vjcLJe6ML5DmoqQwh9ns866dAbnjkVKIKu2VF6lbkvh91ZOG2enEcdoRa8T43hR0Ym0k7tI621EQGufvzmLqxKCPgiXSp2zUTTmIWtn4fM8tC3aP1Yd0dKvn0tDobyp6p3156KvxqG3BKQ6VjFiHlMFoEyz8pjCclhXLl2cfAi97sQzXLUoPYUC5BWKyQTrA2JF6HXZM6vrbw5dc3B4AOJNGdPJ9ai6weF43h1RhnXE9MOFxPNoQnJ8gqSXYbMtpG6ZzqhUyoz0XhFDt7EOqXIgvc9SCejQTVMPeRcF5Zy57hrYZiKrCQqFWidS4BdfEAkuwESgBmEpEFOpZotwDt0TGDaLktSt3dKRsURO6TpuZ2nZNdiEJyc597ZjjQXtyKU7OCyRRqllzAnHEtoU3zd3OLTOvT5uk32N1Y64tpUte63De2EMwDNYb2eGAQfATdSt8VcGBOzJQjsmrMwMumtk48JzXXLxjo6s2vl2rNK9WQM1", complex->get_member_id_by_name( - "my_large_string_8")); - //complex->set_wstring_value( - // L"nosYBfFr1s3t8rUsuUrVCWFi6moDk7GULFj6XnkebIDkjl3n2ykKxUIaLj3qNNUx0ny8DvFbdfxZBdMhBNW3fHbKrig4GkHnN1JoEo0ACiPxrARusDs3xKzvaQQrls6lVUFAUXzDOtw5f2CNVJKiruGjXUO2Lq5Mmy8ygW3eUiTlueAHA2dRXXryOFi47jS3DkmBH4aAOKcmR27KhhJnXaY0gWy3XdSnaGQNB3XvbmxQ7xXDsf1wz860WMEKP3VhdOLsmS6tKCb4sshuOlmUSyTggY7vNoxfpG1EUFP5iPro9E0tHLLdHlWf2NwU8OXCYx6KKEbs5pFMvgEstnQglsdTk0lOv6riaFkFOwx83gW1l6Pg4eXjacnJKoVh1pOeZxULLZpCECw8yRZ9z4JPHxh2C7ytkCHMKp9O4MwQwYvvvgWWLWfJgb7Ecy2tgvWLpNDzgkFrEFhaCTKitChlG422CnLSsXvTBNnF52sULH6rcwOVx3mbhqte3ld3fObtAuH3zPzjOF4vVbvUXxgZh1Zx1cey0iGfnhOZHUfUwJ3Qv0WZNcuVLvMMhhg85A3620b84MAIc2UoW9Hl4BIT7pHo41ApF0DxIPJL0QdIdAOjn0JTPZqAhoHVBQoYvivPHftk5Crd1a1J8L7hSs0s4uSQKAMTKDxy3gKLaGAg277h4iEsEZRCI4RPlPTo9nZ48s8OO2KzqrUbMkoPSTgaJEXq8GsozAzh0wtL4P3gPeHO5nQzoytoXAkiXoPph0GaTLiahYQksYeK1eVQADDqZPXC55teXKKdX4aomCufr1ZizgzkGwAmnsFmhmBSF0gvbm56NDaUVT0UqXxKxAfRjkILeWR1mW8jfn6RYJH3IWiHxEfyB23rr78NySfgzIchhrm7jEFtmwPpKPKAwzajLv0HpkrtTr38YwWeT5LzHokFAQEc6l3aWdJWapVyt9wX89dEkmPPG9torCV2ddjyF4jAKsxKvzU4pCxV6B3m16IIdnksemJ0xG8iKh4ZPsX", complex->get_member_id_by_name( - //"my_large_string_16")); - - DynamicData* my_array_string = complex->loan_value(complex->get_member_id_by_name("my_array_string")); - for (unsigned int j = 0; j < 5; ++j) - { - for (unsigned int k = 0; k < 5; ++k) - { - MemberId array_idx = my_array_string->get_array_index({ j, k }); - my_array_string->set_string_value( - "Ee4rH8nSX1xnWrlDqDJjKWtWntMia9RrZqZPznr0yIDjeroWxUUzpPVV8UK4qUF4eilYR3Dz42", array_idx); - //staticData.my_union().complex().my_array_string()[i][j]("Ee4rH8nSX1xnWrlDqDJjKWtWntMia9RrZqZPznr0yIDjeroWxUUzpPVV8UK4qUF4eilYR3Dz42"); - } - } - complex->return_loaned_value(my_array_string); - - DynamicData* multi_alias_array_42 = complex->loan_value(complex->get_member_id_by_name("multi_alias_array_42")); - for (int j = 0; j < 42; ++j) - { - multi_alias_array_42->set_enum_value(j % 3, j); - //staticData.my_union().complex().multi_alias_array_42()[i](i%3); - } - complex->return_loaned_value(multi_alias_array_42); - - DynamicData* my_array_arrays = complex->loan_value(complex->get_member_id_by_name("my_array_arrays")); - for (unsigned int j = 0; j < 5; ++j) - { - DynamicData* myMiniArray = my_array_arrays->loan_value(j); - for (unsigned int k = 0; k < 2; ++k) - { - myMiniArray->set_int32_value(j * k, k); - //staticData.my_union().complex().my_array_arrays()[i][j](i*j); - } - my_array_arrays->return_loaned_value(myMiniArray); - } - complex->return_loaned_value(my_array_arrays); - - DynamicData* my_sequences_array = complex->loan_value(complex->get_member_id_by_name("my_sequences_array")); - for (int j = 0; j < 23; ++j) - { - DynamicData* seq = DynamicDataFactory::get_instance()->create_data(GetMySequenceLongType()); - seq->insert_sequence_data(id); - seq->set_int32_value(j, id); - seq->insert_sequence_data(id); - seq->set_int32_value(j * 10, id); - seq->insert_sequence_data(id); - seq->set_int32_value(j * 100, id); - my_sequences_array->set_complex_value(seq, j); - // staticData.my_union().complex().my_sequences_array()[i].push_back(i); - // staticData.my_union().complex().my_sequences_array()[i].push_back(i*10); - // staticData.my_union().complex().my_sequences_array()[i].push_back(i*100); - } - complex->return_loaned_value(my_sequences_array); - - my_union->return_loaned_value(complex); - dynData->return_loaned_value(my_union); - - DynamicData* my_union_2 = dynData->loan_value(dynData->get_member_id_by_name("my_union_2")); - my_union_2->set_string_value("GASCO!", my_union_2->get_member_id_by_name("imString")); - - dynData->return_loaned_value(my_union_2); - - // Serialize <-> Deserialize Test - DynamicPubSubType pubsubType(m_DynManualType); - uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(dynData.get())()); - SerializedPayload_t payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(dynData.get(), &payload)); - ASSERT_TRUE(payload.length == payloadSize); - - CompleteStructPubSubType pbComplete; - uint32_t payloadSize2 = static_cast(m_StaticType.getSerializedSizeProvider(&staticData)()); - SerializedPayload_t stPayload(payloadSize2); - ASSERT_TRUE(pbComplete.serialize(&staticData, &stPayload)); - ASSERT_TRUE(stPayload.length == payloadSize2); - - types::DynamicData_ptr dynDataFromDynamic(DynamicDataFactory::get_instance()->create_data(m_DynAutoType)); - ASSERT_TRUE(pubsubType.deserialize(&payload, dynDataFromDynamic.get())); - - types::DynamicData_ptr dynDataFromStatic(DynamicDataFactory::get_instance()->create_data(m_DynAutoType)); - ASSERT_TRUE(pubsubType.deserialize(&stPayload, dynDataFromStatic.get())); - - ASSERT_TRUE(dynDataFromStatic->equals(dynDataFromDynamic.get())); -} - -TEST_F(DynamicComplexTypesTests, Data_Comparison_B_C) -{ - types::DynamicData_ptr dynData(DynamicDataFactory::get_instance()->create_data(m_DynManualType)); - - CompleteStruct staticData; - staticData.my_union()._d() = MyEnum::B; - staticData.my_union().complex().my_octet(66); - staticData.my_union().complex().my_basic_struct().my_bool(true); - staticData.my_union().complex().my_basic_struct().my_octet(166); - staticData.my_union().complex().my_basic_struct().my_int16(-10401); - staticData.my_union().complex().my_basic_struct().my_int32(5884001); - staticData.my_union().complex().my_basic_struct().my_int64(884481567); - staticData.my_union().complex().my_basic_struct().my_uint16(250); - staticData.my_union().complex().my_basic_struct().my_uint32(15884); - staticData.my_union().complex().my_basic_struct().my_uint64(765241); - staticData.my_union().complex().my_basic_struct().my_float32(158.55f); - staticData.my_union().complex().my_basic_struct().my_float64(765241.58); - staticData.my_union().complex().my_basic_struct().my_float128(765241878.154874); - staticData.my_union().complex().my_basic_struct().my_char('L'); - //staticData.my_union().complex().my_basic_struct().my_wchar(L'G'); - staticData.my_union().complex().my_basic_struct().my_string("Luis@eProsima"); - //staticData.my_union().complex().my_basic_struct().my_wstring(L"LuisGasco@eProsima"); - - staticData.my_union().complex().my_alias_enum(MyEnum::C); - staticData.my_union().complex().my_enum(MyEnum::B); - staticData.my_union().complex().my_sequence_octet().push_back(88); - staticData.my_union().complex().my_sequence_octet().push_back(99); - staticData.my_union().complex().my_sequence_struct().push_back(staticData.my_union().complex().my_basic_struct()); - for (int i = 0; i < 500; ++i) - { - for (int j = 0; j < 5; ++j) - { - for (int k = 0; k < 4; ++k) - { - staticData.my_union().complex().my_array_octet()[i][j][k] = static_cast(j * k); - } - } - } - - for (int i = 0; i < 5; ++i) - { - staticData.my_union().complex().my_array_struct()[i].my_bool(i % 2 == 1); - staticData.my_union().complex().my_array_struct()[i].my_octet(static_cast(i)); - staticData.my_union().complex().my_array_struct()[i].my_int16(static_cast(-i)); - staticData.my_union().complex().my_array_struct()[i].my_int32(i); - staticData.my_union().complex().my_array_struct()[i].my_int64(i * 1000); - staticData.my_union().complex().my_array_struct()[i].my_uint16(static_cast(i)); - staticData.my_union().complex().my_array_struct()[i].my_uint32(i); - staticData.my_union().complex().my_array_struct()[i].my_uint64(i * 10005); - staticData.my_union().complex().my_array_struct()[i].my_float32(i * 5.5f); - staticData.my_union().complex().my_array_struct()[i].my_float64(i * 8.8); - staticData.my_union().complex().my_array_struct()[i].my_float128(i * 10.0); - staticData.my_union().complex().my_array_struct()[i].my_char('J'); - //staticData.my_union().complex().my_array_struct()[i].my_wchar(L'C'); - staticData.my_union().complex().my_array_struct()[i].my_string("JC@eProsima"); - //staticData.my_union().complex().my_array_struct()[i].my_wstring(L"JC-BOOM-Armadilo!@eProsima"); - } - - staticData.my_union().complex().my_map_octet_short()[0] = 1340; - staticData.my_union().complex().my_map_octet_short()[1] = 1341; - staticData.my_union().complex().my_map_long_struct()[1000] = staticData.my_union().complex().my_array_struct()[3]; - staticData.my_union().complex().my_map_long_struct()[55] = staticData.my_union().complex().my_basic_struct(); - - staticData.my_union().complex().my_map_long_seq_octet()[55].push_back({ 1, 2, 3, 4, 5 }); - staticData.my_union().complex().my_map_long_seq_octet()[55].push_back({ 1, 2, 3, 4, 5 }); - staticData.my_union().complex().my_map_long_seq_octet()[0].push_back({ 1, 2, 3, 4, 5 }); - for (int i = 0; i < 500; ++i) - { - staticData.my_union().complex().my_map_long_octet_array_500()[0][i] = i % 256; - staticData.my_union().complex().my_map_long_octet_array_500()[10][i] = (i + 55) % 256; - } - - staticData.my_union().complex().my_small_string_8( - "Bv7EMffURwGNqePoujdSfkF9PXN9TH125X5nGpNLfzya53tZtNJdgMROlYdZnTE1SLWzBdIU7ZyjjGvsGHkmuJUROwVPcNa9q5dRUV3KZAKNx1exL7BjhqIgQFconhd"); - //staticData.my_union().complex().my_small_string_16( - // L"AgzñgXsI9pXbWjYLDvvn8JUFWhxZhk9t92rdsTqylvdpqtXA6hy9dHkoBTgmF2c"); - staticData.my_union().complex().my_large_string_8( - "hYE5vjcLJe6ML5DmoqQwh9ns866dAbnjkVKIKu2VF6lbkvh91ZOG2enEcdoRa8T43hR0Ym0k7tI621EQGufvzmLqxKCPgiXSp2zUTTmIWtn4fM8tC3aP1Yd0dKvn0tDobyp6p3156KvxqG3BKQ6VjFiHlMFoEyz8pjCclhXLl2cfAi97sQzXLUoPYUC5BWKyQTrA2JF6HXZM6vrbw5dc3B4AOJNGdPJ9ai6weF43h1RhnXE9MOFxPNoQnJ8gqSXYbMtpG6ZzqhUyoz0XhFDt7EOqXIgvc9SCejQTVMPeRcF5Zy57hrYZiKrCQqFWidS4BdfEAkuwESgBmEpEFOpZotwDt0TGDaLktSt3dKRsURO6TpuZ2nZNdiEJyc597ZjjQXtyKU7OCyRRqllzAnHEtoU3zd3OLTOvT5uk32N1Y64tpUte63De2EMwDNYb2eGAQfATdSt8VcGBOzJQjsmrMwMumtk48JzXXLxjo6s2vl2rNK9WQM1"); - //staticData.my_union().complex().my_large_string_16( - // L"nosYBfFr1s3t8rUsuUrVCWFi6moDk7GULFj6XnkebIDkjl3n2ykKxUIaLj3qNNUx0ny8DvFbdfxZBdMhBNW3fHbKrig4GkHnN1JoEo0ACiPxrARusDs3xKzvaQQrls6lVUFAUXzDOtw5f2CNVJKiruGjXUO2Lq5Mmy8ygW3eUiTlueAHA2dRXXryOFi47jS3DkmBH4aAOKcmR27KhhJnXaY0gWy3XdSnaGQNB3XvbmxQ7xXDsf1wz860WMEKP3VhdOLsmS6tKCb4sshuOlmUSyTggY7vNoxfpG1EUFP5iPro9E0tHLLdHlWf2NwU8OXCYx6KKEbs5pFMvgEstnQglsdTk0lOv6riaFkFOwx83gW1l6Pg4eXjacnJKoVh1pOeZxULLZpCECw8yRZ9z4JPHxh2C7ytkCHMKp9O4MwQwYvvvgWWLWfJgb7Ecy2tgvWLpNDzgkFrEFhaCTKitChlG422CnLSsXvTBNnF52sULH6rcwOVx3mbhqte3ld3fObtAuH3zPzjOF4vVbvUXxgZh1Zx1cey0iGfnhOZHUfUwJ3Qv0WZNcuVLvMMhhg85A3620b84MAIc2UoW9Hl4BIT7pHo41ApF0DxIPJL0QdIdAOjn0JTPZqAhoHVBQoYvivPHftk5Crd1a1J8L7hSs0s4uSQKAMTKDxy3gKLaGAg277h4iEsEZRCI4RPlPTo9nZ48s8OO2KzqrUbMkoPSTgaJEXq8GsozAzh0wtL4P3gPeHO5nQzoytoXAkiXoPph0GaTLiahYQksYeK1eVQADDqZPXC55teXKKdX4aomCufr1ZizgzkGwAmnsFmhmBSF0gvbm56NDaUVT0UqXxKxAfRjkILeWR1mW8jfn6RYJH3IWiHxEfyB23rr78NySfgzIchhrm7jEFtmwPpKPKAwzajLv0HpkrtTr38YwWeT5LzHokFAQEc6l3aWdJWapVyt9wX89dEkmPPG9torCV2ddjyF4jAKsxKvzU4pCxV6B3m16IIdnksemJ0xG8iKh4ZPsX"); - for (int i = 0; i < 5; ++i) - { - for (int j = 0; j < 5; ++j) - { - staticData.my_union().complex().my_array_string()[i][j] = - "Ee4rH8nSX1xnWrlDqDJjKWtWntMia9RrZqZPznr0yIDjeroWxUUzpPVV8UK4qUF4eilYR3Dz42"; - } - } - for (int i = 0; i < 42; ++i) - { - staticData.my_union().complex().multi_alias_array_42()[i] = (MyEnum)(i % 3); - } - - for (int i = 0; i < 5; ++i) - { - for (int j = 0; j < 2; ++j) - { - staticData.my_union().complex().my_array_arrays()[i][j] = i * j; - } - } - - for (int i = 0; i < 23; ++i) - { - staticData.my_union().complex().my_sequences_array()[i].push_back(i); - staticData.my_union().complex().my_sequences_array()[i].push_back(i * 10); - staticData.my_union().complex().my_sequences_array()[i].push_back(i * 100); - } - staticData.my_union_2().tres(156); - - DynamicData* my_union = dynData->loan_value(dynData->get_member_id_by_name("my_union")); - - DynamicData* complex = my_union->loan_value(my_union->get_member_id_by_name("complex")); - complex->set_byte_value(66, complex->get_member_id_by_name("my_octet")); - - DynamicData* basic = complex->loan_value(complex->get_member_id_by_name("my_basic_struct")); - basic->set_bool_value(true, basic->get_member_id_by_name("my_bool")); - basic->set_byte_value(166, basic->get_member_id_by_name("my_octet")); - basic->set_int16_value(-10401, basic->get_member_id_by_name("my_int16")); - basic->set_int32_value(5884001, basic->get_member_id_by_name("my_int32")); - basic->set_int64_value(884481567, basic->get_member_id_by_name("my_int64")); - basic->set_uint16_value(250, basic->get_member_id_by_name("my_uint16")); - basic->set_uint32_value(15884, basic->get_member_id_by_name("my_uint32")); - basic->set_uint64_value(765241, basic->get_member_id_by_name("my_uint64")); - basic->set_float32_value(158.55f, basic->get_member_id_by_name("my_float32")); - basic->set_float64_value(765241.58, basic->get_member_id_by_name("my_float64")); - basic->set_float128_value(765241878.154874, basic->get_member_id_by_name("my_float128")); - basic->set_char8_value('L', basic->get_member_id_by_name("my_char")); - //basic->set_char16_value(L'G', basic->get_member_id_by_name("my_wchar")); - basic->set_string_value("Luis@eProsima", basic->get_member_id_by_name("my_string")); - //basic->set_wstring_value(L"LuisGasco@eProsima", basic->get_member_id_by_name("my_wstring")); - complex->return_loaned_value(basic); - - complex->set_enum_value("C", complex->get_member_id_by_name("my_alias_enum")); - complex->set_enum_value("B", complex->get_member_id_by_name("my_enum")); - - DynamicData* my_seq_octet = complex->loan_value(complex->get_member_id_by_name("my_sequence_octet")); - MemberId id; - my_seq_octet->insert_sequence_data(id); - my_seq_octet->set_byte_value(88, id); - my_seq_octet->insert_sequence_data(id); - my_seq_octet->set_byte_value(99, id); - //staticData.my_union().complex().my_sequence_octet().push_back(88); - //staticData.my_union().complex().my_sequence_octet().push_back(99); - complex->return_loaned_value(my_seq_octet); - - DynamicData* my_seq_struct = complex->loan_value(complex->get_member_id_by_name("my_sequence_struct")); - my_seq_struct->insert_sequence_data(id); - my_seq_struct->set_complex_value(DynamicDataFactory::get_instance()->create_copy(basic), id); - //staticData.my_union().complex().my_sequence_struct().push_back(staticData.my_union().complex().my_basic_struct()); - complex->return_loaned_value(my_seq_struct); - - DynamicData* my_array_octet = complex->loan_value(complex->get_member_id_by_name("my_array_octet")); - for (unsigned int i = 0; i < 500; ++i) - { - for (unsigned int j = 0; j < 5; ++j) - { - for (unsigned int k = 0; k < 4; ++k) - { - MemberId array_idx = my_array_octet->get_array_index({ i, j, k }); - my_array_octet->set_byte_value(static_cast(j * k), array_idx); - } - } - //staticData.my_union().complex().my_array_octet()[i][j][k] = j*k; - } - complex->return_loaned_value(my_array_octet); - - DynamicData* my_array_struct = complex->loan_value(complex->get_member_id_by_name("my_array_struct")); - for (int i = 0; i < 5; ++i) - { - DynamicData* tempBasic = DynamicDataFactory::get_instance()->create_data(GetBasicStructType()); - tempBasic->set_bool_value(i % 2 == 1, tempBasic->get_member_id_by_name("my_bool")); - tempBasic->set_byte_value(static_cast(i), tempBasic->get_member_id_by_name("my_octet")); - tempBasic->set_int16_value(static_cast(-i), tempBasic->get_member_id_by_name("my_int16")); - tempBasic->set_int32_value(i, tempBasic->get_member_id_by_name("my_int32")); - tempBasic->set_int64_value(i * 1000, tempBasic->get_member_id_by_name("my_int64")); - tempBasic->set_uint16_value(static_cast(i), tempBasic->get_member_id_by_name("my_uint16")); - tempBasic->set_uint32_value(i, tempBasic->get_member_id_by_name("my_uint32")); - tempBasic->set_uint64_value(i * 10005, tempBasic->get_member_id_by_name("my_uint64")); - tempBasic->set_float32_value(i * 5.5f, tempBasic->get_member_id_by_name("my_float32")); - tempBasic->set_float64_value(i * 8.8, tempBasic->get_member_id_by_name("my_float64")); - tempBasic->set_float128_value(i * 10.0, tempBasic->get_member_id_by_name("my_float128")); - tempBasic->set_char8_value('J', tempBasic->get_member_id_by_name("my_char")); - //tempBasic->set_char16_value(L'C', tempBasic->get_member_id_by_name("my_wchar")); - tempBasic->set_string_value("JC@eProsima", tempBasic->get_member_id_by_name("my_string")); - //tempBasic->set_wstring_value(L"JC-BOOM-Armadilo!@eProsima", tempBasic->get_member_id_by_name("my_wstring")); - my_array_struct->set_complex_value(tempBasic, i); - } - complex->return_loaned_value(my_array_struct); - - DynamicTypeBuilder_ptr octet_builder = m_factory->create_byte_builder(); - DynamicData_ptr key_oct(DynamicDataFactory::get_instance()->create_data(octet_builder->build())); - MemberId kId; - MemberId vId; - MemberId ssId; - MemberId sId; - DynamicData* my_map_octet_short = complex->loan_value(complex->get_member_id_by_name("my_map_octet_short")); - key_oct->set_byte_value(0); - my_map_octet_short->insert_map_data(key_oct.get(), kId, vId); - my_map_octet_short->set_int16_value((short)1340, vId); - key_oct = DynamicDataFactory::get_instance()->create_data(octet_builder->build()); - key_oct->set_byte_value(1); - my_map_octet_short->insert_map_data(key_oct.get(), kId, vId); - my_map_octet_short->set_int16_value((short)1341, vId); - //staticData.my_union().complex().my_map_octet_short()[0] = 1340; - //staticData.my_union().complex().my_map_octet_short()[1] = 1341; - complex->return_loaned_value(my_map_octet_short); - - DynamicTypeBuilder_ptr long_builder = m_factory->create_int32_builder(); - DynamicData_ptr key(DynamicDataFactory::get_instance()->create_data(long_builder->build())); - DynamicData* my_map_long_struct = complex->loan_value(complex->get_member_id_by_name("my_map_long_struct")); - - //DynamicData *mas3 = my_array_struct->loan_value(3); - key = DynamicDataFactory::get_instance()->create_data(long_builder->build()); - key->set_int32_value(55); - my_map_long_struct->insert_map_data(key.get(), kId, vId); - basic = my_map_long_struct->loan_value(vId); - basic->set_bool_value(true, basic->get_member_id_by_name("my_bool")); - basic->set_byte_value(166, basic->get_member_id_by_name("my_octet")); - basic->set_int16_value(-10401, basic->get_member_id_by_name("my_int16")); - basic->set_int32_value(5884001, basic->get_member_id_by_name("my_int32")); - basic->set_int64_value(884481567, basic->get_member_id_by_name("my_int64")); - basic->set_uint16_value(250, basic->get_member_id_by_name("my_uint16")); - basic->set_uint32_value(15884, basic->get_member_id_by_name("my_uint32")); - basic->set_uint64_value(765241, basic->get_member_id_by_name("my_uint64")); - basic->set_float32_value(158.55f, basic->get_member_id_by_name("my_float32")); - basic->set_float64_value(765241.58, basic->get_member_id_by_name("my_float64")); - basic->set_float128_value(765241878.154874, basic->get_member_id_by_name("my_float128")); - basic->set_char8_value('L', basic->get_member_id_by_name("my_char")); - //basic->set_char16_value(L'G', basic->get_member_id_by_name("my_wchar")); - basic->set_string_value("Luis@eProsima", basic->get_member_id_by_name("my_string")); - //basic->set_wstring_value(L"LuisGasco@eProsima", basic->get_member_id_by_name("my_wstring")); - my_map_long_struct->return_loaned_value(basic); - key = DynamicDataFactory::get_instance()->create_data(long_builder->build()); - key->set_int32_value(1000); - my_map_long_struct->insert_map_data(key.get(), kId, vId); - DynamicData* mas3 = my_map_long_struct->loan_value(vId); - int i = 3; - mas3->set_bool_value(i % 2 == 1, mas3->get_member_id_by_name("my_bool")); - mas3->set_byte_value(static_cast(i), mas3->get_member_id_by_name("my_octet")); - mas3->set_int16_value(static_cast(-i), mas3->get_member_id_by_name("my_int16")); - mas3->set_int32_value(i, mas3->get_member_id_by_name("my_int32")); - mas3->set_int64_value(i * 1000, mas3->get_member_id_by_name("my_int64")); - mas3->set_uint16_value(static_cast(i), mas3->get_member_id_by_name("my_uint16")); - mas3->set_uint32_value(i, mas3->get_member_id_by_name("my_uint32")); - mas3->set_uint64_value(i * 10005, mas3->get_member_id_by_name("my_uint64")); - mas3->set_float32_value(i * 5.5f, mas3->get_member_id_by_name("my_float32")); - mas3->set_float64_value(i * 8.8, mas3->get_member_id_by_name("my_float64")); - mas3->set_float128_value(i * 10.0, mas3->get_member_id_by_name("my_float128")); - mas3->set_char8_value('J', mas3->get_member_id_by_name("my_char")); - //mas3->set_char16_value(L'C', mas3->get_member_id_by_name("my_wchar")); - mas3->set_string_value("JC@eProsima", mas3->get_member_id_by_name("my_string")); - //mas3->set_wstring_value(L"JC-BOOM-Armadilo!@eProsima", mas3->get_member_id_by_name("my_wstring")); - my_map_long_struct->return_loaned_value(mas3); - - // staticData.my_union().complex().my_map_long_struct()[1000] = staticData.my_union().complex().my_array_struct()[3]; - // staticData.my_union().complex().my_map_long_struct()[55] = staticData.my_union().complex().my_basic_struct(); - complex->return_loaned_value(my_map_long_struct); - - DynamicData* my_map_long_seq_octet = complex->loan_value(complex->get_member_id_by_name("my_map_long_seq_octet")); - //std::vector my_vector_octet = {1, 2, 3, 4, 5}; - //MemberId id; - /*DynamicTypeBuilder_ptr octet_builder = m_factory->create_byte_builder(); - types::DynamicTypeBuilder_ptr seqOctet_builder = m_factory->create_sequence_builder(octet_builder.get()); - types::DynamicType_ptr seqSeqOctet_builder = m_factory->create_sequence_builder(seqOctet_builder.get())->build(); - DynamicData *dataSeqOctet = seqOctet_builder->build(); - DynamicData *dataSeqSeqOctet = seqSeqOctet_builder->build(); - dataSeqOctet->insert_sequence_data(id); - dataSeqOctet->set_byte_value(1, id); - dataSeqOctet->insert_sequence_data(id); - dataSeqOctet->set_byte_value(2, id); - dataSeqOctet->insert_sequence_data(id); - dataSeqOctet->set_byte_value(3, id); - dataSeqOctet->insert_sequence_data(id); - dataSeqOctet->set_byte_value(4, id); - dataSeqOctet->insert_sequence_data(id); - dataSeqOctet->set_byte_value(5, id); - dataSeqSeqOctet->insert_sequence_data(id); - dataSeqSeqOctet->set_complex_value(dataSeqOctet, id);*/ - // insert_map_data(DynamicData_ptr key, MemberId& outKeyId, MemberId& outValueId); - - key = DynamicDataFactory::get_instance()->create_data(long_builder->build()); - key->set_int32_value(0); - my_map_long_seq_octet->insert_map_data(key.get(), kId, vId); - - DynamicData* seq_seq_oct = my_map_long_seq_octet->loan_value(vId); - seq_seq_oct->insert_sequence_data(ssId); - DynamicData* seq_oct = seq_seq_oct->loan_value(ssId); - seq_oct->insert_sequence_data(sId); - seq_oct->set_byte_value(1, sId); - seq_oct->insert_sequence_data(sId); - seq_oct->set_byte_value(2, sId); - seq_oct->insert_sequence_data(sId); - seq_oct->set_byte_value(3, sId); - seq_oct->insert_sequence_data(sId); - seq_oct->set_byte_value(4, sId); - seq_oct->insert_sequence_data(sId); - seq_oct->set_byte_value(5, sId); - seq_seq_oct->return_loaned_value(seq_oct); - my_map_long_seq_octet->return_loaned_value(seq_seq_oct); - - key = DynamicDataFactory::get_instance()->create_data(long_builder->build()); - key->set_int32_value(55); - my_map_long_seq_octet->insert_map_data(key.get(), kId, vId); - - seq_seq_oct = my_map_long_seq_octet->loan_value(vId); - seq_seq_oct->insert_sequence_data(ssId); - seq_oct = seq_seq_oct->loan_value(ssId); - seq_oct->insert_sequence_data(sId); - seq_oct->set_byte_value(1, sId); - seq_oct->insert_sequence_data(sId); - seq_oct->set_byte_value(2, sId); - seq_oct->insert_sequence_data(sId); - seq_oct->set_byte_value(3, sId); - seq_oct->insert_sequence_data(sId); - seq_oct->set_byte_value(4, sId); - seq_oct->insert_sequence_data(sId); - seq_oct->set_byte_value(5, sId); - seq_seq_oct->return_loaned_value(seq_oct); - seq_seq_oct->insert_sequence_data(ssId); - seq_oct = seq_seq_oct->loan_value(ssId); - seq_oct->insert_sequence_data(sId); - seq_oct->set_byte_value(1, sId); - seq_oct->insert_sequence_data(sId); - seq_oct->set_byte_value(2, sId); - seq_oct->insert_sequence_data(sId); - seq_oct->set_byte_value(3, sId); - seq_oct->insert_sequence_data(sId); - seq_oct->set_byte_value(4, sId); - seq_oct->insert_sequence_data(sId); - seq_oct->set_byte_value(5, sId); - seq_seq_oct->return_loaned_value(seq_oct); - my_map_long_seq_octet->return_loaned_value(seq_seq_oct); - //staticData.my_union().complex().my_map_long_seq_octet()[55].push_back(my_vector_octet); - //staticData.my_union().complex().my_map_long_seq_octet()[55].push_back(my_vector_octet); - //staticData.my_union().complex().my_map_long_seq_octet()[0].push_back(my_vector_octet); - complex->return_loaned_value(my_map_long_seq_octet); - - DynamicData* my_map_long_octet_array_500 = - complex->loan_value(complex->get_member_id_by_name("my_map_long_octet_array_500")); - - key = DynamicDataFactory::get_instance()->create_data(long_builder->build()); - key->set_int32_value(0); - my_map_long_octet_array_500->insert_map_data(key.get(), kId, vId); - - DynamicData* oct_array_500 = my_map_long_octet_array_500->loan_value(vId); - for (int j = 0; j < 500; ++j) - { - oct_array_500->set_byte_value(j % 256, j); - //staticData.my_union().complex().my_map_long_octet_array_500()[0][i] = i%256; - } - my_map_long_octet_array_500->return_loaned_value(oct_array_500); - - key = DynamicDataFactory::get_instance()->create_data(long_builder->build()); - key->set_int32_value(10); - my_map_long_octet_array_500->insert_map_data(key.get(), kId, vId); - oct_array_500 = my_map_long_octet_array_500->loan_value(vId); - - for (int j = 0; j < 500; ++j) - { - oct_array_500->set_byte_value((j + 55) % 256, j); - //staticData.my_union().complex().my_map_long_octet_array_500()[10][i] = (i+55)%256; - } - my_map_long_octet_array_500->return_loaned_value(oct_array_500); - complex->return_loaned_value(my_map_long_octet_array_500); - - complex->set_string_value( - "Bv7EMffURwGNqePoujdSfkF9PXN9TH125X5nGpNLfzya53tZtNJdgMROlYdZnTE1SLWzBdIU7ZyjjGvsGHkmuJUROwVPcNa9q5dRUV3KZAKNx1exL7BjhqIgQFconhd", complex->get_member_id_by_name( - "my_small_string_8")); - //complex->set_wstring_value(L"AgzñgXsI9pXbWjYLDvvn8JUFWhxZhk9t92rdsTqylvdpqtXA6hy9dHkoBTgmF2c", complex->get_member_id_by_name( - // "my_small_string_16")); - complex->set_string_value( - "hYE5vjcLJe6ML5DmoqQwh9ns866dAbnjkVKIKu2VF6lbkvh91ZOG2enEcdoRa8T43hR0Ym0k7tI621EQGufvzmLqxKCPgiXSp2zUTTmIWtn4fM8tC3aP1Yd0dKvn0tDobyp6p3156KvxqG3BKQ6VjFiHlMFoEyz8pjCclhXLl2cfAi97sQzXLUoPYUC5BWKyQTrA2JF6HXZM6vrbw5dc3B4AOJNGdPJ9ai6weF43h1RhnXE9MOFxPNoQnJ8gqSXYbMtpG6ZzqhUyoz0XhFDt7EOqXIgvc9SCejQTVMPeRcF5Zy57hrYZiKrCQqFWidS4BdfEAkuwESgBmEpEFOpZotwDt0TGDaLktSt3dKRsURO6TpuZ2nZNdiEJyc597ZjjQXtyKU7OCyRRqllzAnHEtoU3zd3OLTOvT5uk32N1Y64tpUte63De2EMwDNYb2eGAQfATdSt8VcGBOzJQjsmrMwMumtk48JzXXLxjo6s2vl2rNK9WQM1", complex->get_member_id_by_name( - "my_large_string_8")); - //complex->set_wstring_value( - // L"nosYBfFr1s3t8rUsuUrVCWFi6moDk7GULFj6XnkebIDkjl3n2ykKxUIaLj3qNNUx0ny8DvFbdfxZBdMhBNW3fHbKrig4GkHnN1JoEo0ACiPxrARusDs3xKzvaQQrls6lVUFAUXzDOtw5f2CNVJKiruGjXUO2Lq5Mmy8ygW3eUiTlueAHA2dRXXryOFi47jS3DkmBH4aAOKcmR27KhhJnXaY0gWy3XdSnaGQNB3XvbmxQ7xXDsf1wz860WMEKP3VhdOLsmS6tKCb4sshuOlmUSyTggY7vNoxfpG1EUFP5iPro9E0tHLLdHlWf2NwU8OXCYx6KKEbs5pFMvgEstnQglsdTk0lOv6riaFkFOwx83gW1l6Pg4eXjacnJKoVh1pOeZxULLZpCECw8yRZ9z4JPHxh2C7ytkCHMKp9O4MwQwYvvvgWWLWfJgb7Ecy2tgvWLpNDzgkFrEFhaCTKitChlG422CnLSsXvTBNnF52sULH6rcwOVx3mbhqte3ld3fObtAuH3zPzjOF4vVbvUXxgZh1Zx1cey0iGfnhOZHUfUwJ3Qv0WZNcuVLvMMhhg85A3620b84MAIc2UoW9Hl4BIT7pHo41ApF0DxIPJL0QdIdAOjn0JTPZqAhoHVBQoYvivPHftk5Crd1a1J8L7hSs0s4uSQKAMTKDxy3gKLaGAg277h4iEsEZRCI4RPlPTo9nZ48s8OO2KzqrUbMkoPSTgaJEXq8GsozAzh0wtL4P3gPeHO5nQzoytoXAkiXoPph0GaTLiahYQksYeK1eVQADDqZPXC55teXKKdX4aomCufr1ZizgzkGwAmnsFmhmBSF0gvbm56NDaUVT0UqXxKxAfRjkILeWR1mW8jfn6RYJH3IWiHxEfyB23rr78NySfgzIchhrm7jEFtmwPpKPKAwzajLv0HpkrtTr38YwWeT5LzHokFAQEc6l3aWdJWapVyt9wX89dEkmPPG9torCV2ddjyF4jAKsxKvzU4pCxV6B3m16IIdnksemJ0xG8iKh4ZPsX", complex->get_member_id_by_name( - // "my_large_string_16")); - - DynamicData* my_array_string = complex->loan_value(complex->get_member_id_by_name("my_array_string")); - for (unsigned int j = 0; j < 5; ++j) - { - for (unsigned int k = 0; k < 5; ++k) - { - MemberId array_idx = my_array_string->get_array_index({ j, k }); - my_array_string->set_string_value( - "Ee4rH8nSX1xnWrlDqDJjKWtWntMia9RrZqZPznr0yIDjeroWxUUzpPVV8UK4qUF4eilYR3Dz42", array_idx); - //staticData.my_union().complex().my_array_string()[i][j]("Ee4rH8nSX1xnWrlDqDJjKWtWntMia9RrZqZPznr0yIDjeroWxUUzpPVV8UK4qUF4eilYR3Dz42"); - } - } - complex->return_loaned_value(my_array_string); - - DynamicData* multi_alias_array_42 = complex->loan_value(complex->get_member_id_by_name("multi_alias_array_42")); - for (int j = 0; j < 42; ++j) - { - multi_alias_array_42->set_enum_value(j % 3, j); - //staticData.my_union().complex().multi_alias_array_42()[i](i%3); - } - complex->return_loaned_value(multi_alias_array_42); - - DynamicData* my_array_arrays = complex->loan_value(complex->get_member_id_by_name("my_array_arrays")); - for (unsigned int j = 0; j < 5; ++j) - { - DynamicData* myMiniArray = my_array_arrays->loan_value(j); - for (unsigned int k = 0; k < 2; ++k) - { - myMiniArray->set_int32_value(j * k, k); - //staticData.my_union().complex().my_array_arrays()[i][j](i*j); - } - my_array_arrays->return_loaned_value(myMiniArray); - } - complex->return_loaned_value(my_array_arrays); - - DynamicData* my_sequences_array = complex->loan_value(complex->get_member_id_by_name("my_sequences_array")); - for (int j = 0; j < 23; ++j) - { - DynamicData* seq = DynamicDataFactory::get_instance()->create_data(GetMySequenceLongType()); - seq->insert_sequence_data(id); - seq->set_int32_value(j, id); - seq->insert_sequence_data(id); - seq->set_int32_value(j * 10, id); - seq->insert_sequence_data(id); - seq->set_int32_value(j * 100, id); - my_sequences_array->set_complex_value(seq, j); - // staticData.my_union().complex().my_sequences_array()[i].push_back(i); - // staticData.my_union().complex().my_sequences_array()[i].push_back(i*10); - // staticData.my_union().complex().my_sequences_array()[i].push_back(i*100); - } - complex->return_loaned_value(my_sequences_array); - - my_union->return_loaned_value(complex); - dynData->return_loaned_value(my_union); - - DynamicData* my_union_2 = dynData->loan_value(dynData->get_member_id_by_name("my_union_2")); - my_union_2->set_int32_value(156, my_union_2->get_member_id_by_name("tres")); - - dynData->return_loaned_value(my_union_2); - - // Serialize <-> Deserialize Test - DynamicPubSubType pubsubType(m_DynManualType); - uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(dynData.get())()); - SerializedPayload_t payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(dynData.get(), &payload)); - ASSERT_TRUE(payload.length == payloadSize); - /* - std::cout << "BEGIN" << std::endl; - for (uint32_t j = 0; j < payload.length; j += 100) - { - std::cout << std::endl; - for (uint32_t k = 0; k < 100; k++) - { - if (j + k < payload.length) - { - if ((int)payload.data[j + k] == 204) - { - std::cout << 0 << " "; - } - else - { - std::cout << (int)payload.data[j + k] << " "; - } - } - } - } - std::cout << "END" << std::endl; - */ - CompleteStructPubSubType pbComplete; - uint32_t payloadSize2 = static_cast(m_StaticType.getSerializedSizeProvider(&staticData)()); - SerializedPayload_t stPayload(payloadSize2); - ASSERT_TRUE(pbComplete.serialize(&staticData, &stPayload)); - ASSERT_TRUE(stPayload.length == payloadSize2); - /* - std::cout << "BEGIN" << std::endl; - for (uint32_t j = 0; j < stPayload.length; j += 100) - { - std::cout << std::endl; - for (uint32_t k = 0; k < 100; k++) - { - if (j + k < stPayload.length) - { - if ((int)stPayload.data[j + k] == 204) - { - std::cout << 0 << " "; - } - else - { - std::cout << (int)stPayload.data[j + k] << " "; - } - } - } - } - std::cout << "END" << std::endl; - */ - types::DynamicData_ptr dynDataFromDynamic(DynamicDataFactory::get_instance()->create_data(m_DynAutoType)); - ASSERT_TRUE(pubsubType.deserialize(&payload, dynDataFromDynamic.get())); - - types::DynamicData_ptr dynDataFromStatic(DynamicDataFactory::get_instance()->create_data(m_DynAutoType)); - ASSERT_TRUE(pubsubType.deserialize(&stPayload, dynDataFromStatic.get())); - - ASSERT_TRUE(dynDataFromStatic->equals(dynDataFromDynamic.get())); -} - -TEST_F(DynamicComplexTypesTests, Data_Comparison_with_Keys) -{ - KeyedStruct staticData; - - staticData.basic().my_bool(true); - staticData.basic().my_octet(100); - staticData.basic().my_int16(-12000); - staticData.basic().my_int32(-12000000); - staticData.basic().my_int64(-1200000000); - staticData.basic().my_uint16(12000); - staticData.basic().my_uint32(12000000); - staticData.basic().my_uint64(1200000000); - staticData.basic().my_float32(5.5f); - staticData.basic().my_float64(8.888); - staticData.basic().my_float128(1005.1005); - staticData.basic().my_char('O'); - //staticData.basic().my_wchar(L'M'); - staticData.basic().my_string("G It's"); - //staticData.basic().my_wstring(L" Working"); - //staticData.key(88); - - DynamicData* dynData = DynamicDataFactory::get_instance()->create_data(GetKeyedStructType()); - DynamicData* basic = dynData->loan_value(dynData->get_member_id_by_name("basic")); - basic->set_bool_value(true, basic->get_member_id_by_name("my_bool")); - basic->set_byte_value(100, basic->get_member_id_by_name("my_octet")); - basic->set_int16_value(-12000, basic->get_member_id_by_name("my_int16")); - basic->set_int32_value(-12000000, basic->get_member_id_by_name("my_int32")); - basic->set_int64_value(-1200000000, basic->get_member_id_by_name("my_int64")); - basic->set_uint16_value(12000, basic->get_member_id_by_name("my_uint16")); - basic->set_uint32_value(12000000, basic->get_member_id_by_name("my_uint32")); - basic->set_uint64_value(1200000000, basic->get_member_id_by_name("my_uint64")); - basic->set_float32_value(5.5f, basic->get_member_id_by_name("my_float32")); - basic->set_float64_value(8.888, basic->get_member_id_by_name("my_float64")); - basic->set_float128_value(1005.1005, basic->get_member_id_by_name("my_float128")); - basic->set_char8_value('O', basic->get_member_id_by_name("my_char")); - //basic->set_char16_value(L'M', basic->get_member_id_by_name("my_wchar")); - basic->set_string_value("G It's", basic->get_member_id_by_name("my_string")); - //basic->set_wstring_value(L" Working", basic->get_member_id_by_name("my_wstring")); - dynData->return_loaned_value(basic); - //dynData->set_byte_value(88, dynData->get_member_id_by_name("key")); - - KeyedStructPubSubType pbKeyed; - DynamicPubSubType pubsubType(GetKeyedStructType()); - uint32_t payloadSize = static_cast(pbKeyed.getSerializedSizeProvider(&staticData)()); - SerializedPayload_t stPayload(payloadSize); - ASSERT_TRUE(pbKeyed.serialize(&staticData, &stPayload)); - ASSERT_TRUE(payloadSize == stPayload.length); - - DynamicPubSubType dynPubSub; - uint32_t payloadSize2 = static_cast(dynPubSub.getSerializedSizeProvider(dynData)()); - SerializedPayload_t dynPayload(payloadSize2); - ASSERT_TRUE(dynPubSub.serialize(dynData, &dynPayload)); - ASSERT_TRUE(payloadSize2 == dynPayload.length); - - types::DynamicData* dynDataFromStatic = DynamicDataFactory::get_instance()->create_data(GetKeyedStructType()); - ASSERT_TRUE(pubsubType.deserialize(&stPayload, dynDataFromStatic)); - - types::DynamicData* dynDataFromDynamic = DynamicDataFactory::get_instance()->create_data(GetKeyedStructType()); - ASSERT_TRUE(dynPubSub.deserialize(&dynPayload, dynDataFromDynamic)); - - ASSERT_TRUE(dynDataFromStatic->equals(dynDataFromDynamic)); - - DynamicDataFactory::get_instance()->delete_data(dynData); - DynamicDataFactory::get_instance()->delete_data(dynDataFromStatic); - DynamicDataFactory::get_instance()->delete_data(dynDataFromDynamic); -} - -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/dynamic_types/DynamicTypesTests.cpp b/test/unittest/dynamic_types/DynamicTypesTests.cpp deleted file mode 100644 index f26659dfb85..00000000000 --- a/test/unittest/dynamic_types/DynamicTypesTests.cpp +++ /dev/null @@ -1,4968 +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 -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include "idl/BasicPubSubTypes.h" - -using namespace eprosima::fastrtps; -using namespace eprosima::fastrtps::rtps; -using namespace eprosima::fastrtps::types; - -class DynamicTypesTests : public ::testing::Test -{ - const std::string config_file_ = "types_profile.xml"; - -public: - - DynamicTypesTests() - { - } - - ~DynamicTypesTests() - { - eprosima::fastdds::dds::Log::KillThread(); - } - - virtual void TearDown() - { - DynamicDataFactory::delete_instance(); - DynamicTypeBuilderFactory::delete_instance(); - } - - const std::string& config_file() - { - return config_file_; - } - -}; - -TEST_F(DynamicTypesTests, TypeDescriptors_unit_tests) -{ - // Given - TypeDescriptor pInt32Descriptor; - pInt32Descriptor.set_kind(eprosima::fastdds::dds::xtypes::TK_INT32); - pInt32Descriptor.set_name("TEST_INT32"); - TypeDescriptor pInt32Descriptor2; - - // Then - ASSERT_FALSE(pInt32Descriptor.equals(&pInt32Descriptor2)); - ASSERT_FALSE(pInt32Descriptor2.copy_from(nullptr) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(pInt32Descriptor2.copy_from(&pInt32Descriptor) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(pInt32Descriptor.equals(&pInt32Descriptor2)); - pInt32Descriptor2.set_name("TEST_2"); - ASSERT_FALSE(pInt32Descriptor.equals(&pInt32Descriptor2)); - pInt32Descriptor2.set_name(pInt32Descriptor.get_name()); - ASSERT_TRUE(pInt32Descriptor.equals(&pInt32Descriptor2)); - pInt32Descriptor2.set_kind(eprosima::fastdds::dds::xtypes::TK_NONE); - ASSERT_FALSE(pInt32Descriptor.equals(&pInt32Descriptor2)); -} - -TEST_F(DynamicTypesTests, DynamicType_basic_unit_tests) -{ - // Create basic types - DynamicTypeBuilder_ptr int32_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); - ASSERT_TRUE(int32_builder != nullptr); - ASSERT_FALSE(int32_builder == nullptr); - DynamicType_ptr int32_type = DynamicTypeBuilderFactory::get_instance()->create_type(int32_builder.get()); - ASSERT_TRUE(int32_type != nullptr); - ASSERT_FALSE(int32_type == nullptr); - DynamicType_ptr type2 = DynamicTypeBuilderFactory::get_instance()->create_type(int32_builder.get()); - ASSERT_TRUE(type2 != nullptr); - ASSERT_TRUE(type2->equals(int32_type.get())); - - DynamicTypeBuilder_ptr struct_type_builder = DynamicTypeBuilderFactory::get_instance()->create_struct_builder(); - ASSERT_TRUE(struct_type_builder != nullptr); - - // Add members to the struct. - ASSERT_TRUE(struct_type_builder->add_member(0, "int32", int32_type) == eprosima::fastdds::dds::RETCODE_OK); - auto struct_type = struct_type_builder->build(); - ASSERT_TRUE(struct_type != nullptr); - - ASSERT_TRUE(struct_type_builder->add_member(1, "int64", - DynamicTypeBuilderFactory::get_instance()->create_int64_type()) == eprosima::fastdds::dds::RETCODE_OK); - auto struct_type2 = struct_type_builder->build(); - ASSERT_TRUE(struct_type2 != nullptr); - ASSERT_FALSE(struct_type->equals(struct_type2.get())); -} - -TEST_F(DynamicTypesTests, DynamicTypeBuilderFactory_unit_tests) -{ - // Try to create with invalid values - ASSERT_FALSE(DynamicTypeBuilderFactory::get_instance()->create_custom_builder(nullptr)); - { - // Create basic types - DynamicTypeBuilder_ptr created_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); - ASSERT_TRUE(created_builder != nullptr); - DynamicType_ptr type = created_builder->build(); - ASSERT_TRUE(type != nullptr); - DynamicType_ptr type2 = created_builder->build(); - ASSERT_TRUE(type2 != nullptr); - ASSERT_TRUE(type->equals(type2.get())); - DynamicType_ptr type3 = DynamicTypeBuilderFactory::get_instance()->create_int32_type(); - ASSERT_TRUE(type3 != nullptr); - ASSERT_TRUE(type->equals(type3.get())); - auto data = DynamicDataFactory::get_instance()->create_data(created_builder.get()); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == eprosima::fastdds::dds::RETCODE_OK); - - auto data2 = DynamicDataFactory::get_instance()->create_data(type); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == eprosima::fastdds::dds::RETCODE_OK); - - created_builder = DynamicTypeBuilderFactory::get_instance()->create_uint32_builder(); - ASSERT_TRUE(created_builder != nullptr); - type = created_builder->build(); - ASSERT_TRUE(type != nullptr); - type2 = created_builder->build(); - ASSERT_TRUE(type2 != nullptr); - ASSERT_TRUE(type->equals(type2.get())); - type3 = DynamicTypeBuilderFactory::get_instance()->create_uint32_type(); - ASSERT_TRUE(type3 != nullptr); - ASSERT_TRUE(type->equals(type3.get())); - data = DynamicDataFactory::get_instance()->create_data(type); - data2 = DynamicDataFactory::get_instance()->create_copy(data); - ASSERT_TRUE(data2->equals(data)); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == eprosima::fastdds::dds::RETCODE_OK); - - created_builder = DynamicTypeBuilderFactory::get_instance()->create_int16_builder(); - ASSERT_TRUE(created_builder != nullptr); - type = created_builder->build(); - ASSERT_TRUE(type != nullptr); - type2 = created_builder->build(); - ASSERT_TRUE(type2 != nullptr); - ASSERT_TRUE(type->equals(type2.get())); - type3 = DynamicTypeBuilderFactory::get_instance()->create_int16_type(); - ASSERT_TRUE(type3 != nullptr); - ASSERT_TRUE(type->equals(type3.get())); - data = DynamicDataFactory::get_instance()->create_data(type); - data2 = DynamicDataFactory::get_instance()->create_copy(data); - ASSERT_TRUE(data2->equals(data)); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == eprosima::fastdds::dds::RETCODE_OK); - - created_builder = DynamicTypeBuilderFactory::get_instance()->create_uint16_builder(); - ASSERT_TRUE(created_builder != nullptr); - type = created_builder->build(); - ASSERT_TRUE(type != nullptr); - type2 = created_builder->build(); - ASSERT_TRUE(type2 != nullptr); - ASSERT_TRUE(type->equals(type2.get())); - type3 = DynamicTypeBuilderFactory::get_instance()->create_uint16_type(); - ASSERT_TRUE(type3 != nullptr); - ASSERT_TRUE(type->equals(type3.get())); - data = DynamicDataFactory::get_instance()->create_data(type); - data2 = DynamicDataFactory::get_instance()->create_copy(data); - ASSERT_TRUE(data2->equals(data)); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == eprosima::fastdds::dds::RETCODE_OK); - - created_builder = DynamicTypeBuilderFactory::get_instance()->create_int64_builder(); - ASSERT_TRUE(created_builder != nullptr); - type = created_builder->build(); - ASSERT_TRUE(type != nullptr); - type2 = created_builder->build(); - ASSERT_TRUE(type2 != nullptr); - ASSERT_TRUE(type->equals(type2.get())); - type3 = DynamicTypeBuilderFactory::get_instance()->create_int64_type(); - ASSERT_TRUE(type3 != nullptr); - ASSERT_TRUE(type->equals(type3.get())); - data = DynamicDataFactory::get_instance()->create_data(type); - data2 = DynamicDataFactory::get_instance()->create_copy(data); - ASSERT_TRUE(data2->equals(data)); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == eprosima::fastdds::dds::RETCODE_OK); - - created_builder = DynamicTypeBuilderFactory::get_instance()->create_uint64_builder(); - ASSERT_TRUE(created_builder != nullptr); - type = created_builder->build(); - ASSERT_TRUE(type != nullptr); - type2 = created_builder->build(); - ASSERT_TRUE(type2 != nullptr); - ASSERT_TRUE(type->equals(type2.get())); - type3 = DynamicTypeBuilderFactory::get_instance()->create_uint64_type(); - ASSERT_TRUE(type3 != nullptr); - ASSERT_TRUE(type->equals(type3.get())); - data = DynamicDataFactory::get_instance()->create_data(type); - data2 = DynamicDataFactory::get_instance()->create_copy(data); - ASSERT_TRUE(data2->equals(data)); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == eprosima::fastdds::dds::RETCODE_OK); - - created_builder = DynamicTypeBuilderFactory::get_instance()->create_float32_builder(); - ASSERT_TRUE(created_builder != nullptr); - type = created_builder->build(); - ASSERT_TRUE(type != nullptr); - type2 = created_builder->build(); - ASSERT_TRUE(type2 != nullptr); - ASSERT_TRUE(type->equals(type2.get())); - type3 = DynamicTypeBuilderFactory::get_instance()->create_float32_type(); - ASSERT_TRUE(type3 != nullptr); - ASSERT_TRUE(type->equals(type3.get())); - data = DynamicDataFactory::get_instance()->create_data(type); - data2 = DynamicDataFactory::get_instance()->create_copy(data); - ASSERT_TRUE(data2->equals(data)); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == eprosima::fastdds::dds::RETCODE_OK); - - created_builder = DynamicTypeBuilderFactory::get_instance()->create_float64_builder(); - ASSERT_TRUE(created_builder != nullptr); - type = created_builder->build(); - ASSERT_TRUE(type != nullptr); - type2 = created_builder->build(); - ASSERT_TRUE(type2 != nullptr); - ASSERT_TRUE(type->equals(type2.get())); - type3 = DynamicTypeBuilderFactory::get_instance()->create_float64_type(); - ASSERT_TRUE(type3 != nullptr); - ASSERT_TRUE(type->equals(type3.get())); - data = DynamicDataFactory::get_instance()->create_data(type); - data2 = DynamicDataFactory::get_instance()->create_copy(data); - ASSERT_TRUE(data2->equals(data)); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == eprosima::fastdds::dds::RETCODE_OK); - - created_builder = DynamicTypeBuilderFactory::get_instance()->create_float128_builder(); - ASSERT_TRUE(created_builder != nullptr); - type = created_builder->build(); - ASSERT_TRUE(type != nullptr); - type2 = created_builder->build(); - ASSERT_TRUE(type2 != nullptr); - ASSERT_TRUE(type->equals(type2.get())); - type3 = DynamicTypeBuilderFactory::get_instance()->create_float128_type(); - ASSERT_TRUE(type3 != nullptr); - ASSERT_TRUE(type->equals(type3.get())); - data = DynamicDataFactory::get_instance()->create_data(type); - data2 = DynamicDataFactory::get_instance()->create_copy(data); - ASSERT_TRUE(data2->equals(data)); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == eprosima::fastdds::dds::RETCODE_OK); - - created_builder = DynamicTypeBuilderFactory::get_instance()->create_char8_builder(); - ASSERT_TRUE(created_builder != nullptr); - type = created_builder->build(); - ASSERT_TRUE(type != nullptr); - type2 = created_builder->build(); - ASSERT_TRUE(type2 != nullptr); - ASSERT_TRUE(type->equals(type2.get())); - type3 = DynamicTypeBuilderFactory::get_instance()->create_char8_type(); - ASSERT_TRUE(type3 != nullptr); - ASSERT_TRUE(type->equals(type3.get())); - data = DynamicDataFactory::get_instance()->create_data(type); - data2 = DynamicDataFactory::get_instance()->create_copy(data); - ASSERT_TRUE(data2->equals(data)); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == eprosima::fastdds::dds::RETCODE_OK); - - created_builder = DynamicTypeBuilderFactory::get_instance()->create_char16_builder(); - ASSERT_TRUE(created_builder != nullptr); - type = created_builder->build(); - ASSERT_TRUE(type != nullptr); - type2 = created_builder->build(); - ASSERT_TRUE(type2 != nullptr); - ASSERT_TRUE(type->equals(type2.get())); - type3 = DynamicTypeBuilderFactory::get_instance()->create_char16_type(); - ASSERT_TRUE(type3 != nullptr); - ASSERT_TRUE(type->equals(type3.get())); - data = DynamicDataFactory::get_instance()->create_data(type); - data2 = DynamicDataFactory::get_instance()->create_copy(data); - ASSERT_TRUE(data2->equals(data)); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == eprosima::fastdds::dds::RETCODE_OK); - - created_builder = DynamicTypeBuilderFactory::get_instance()->create_byte_builder(); - ASSERT_TRUE(created_builder != nullptr); - type = created_builder->build(); - ASSERT_TRUE(type != nullptr); - type2 = created_builder->build(); - ASSERT_TRUE(type2 != nullptr); - ASSERT_TRUE(type->equals(type2.get())); - type3 = DynamicTypeBuilderFactory::get_instance()->create_byte_type(); - ASSERT_TRUE(type3 != nullptr); - ASSERT_TRUE(type->equals(type3.get())); - data = DynamicDataFactory::get_instance()->create_data(type); - data2 = DynamicDataFactory::get_instance()->create_copy(data); - ASSERT_TRUE(data2->equals(data)); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == eprosima::fastdds::dds::RETCODE_OK); - - created_builder = DynamicTypeBuilderFactory::get_instance()->create_bool_builder(); - ASSERT_TRUE(created_builder != nullptr); - type = created_builder->build(); - ASSERT_TRUE(type != nullptr); - type2 = created_builder->build(); - ASSERT_TRUE(type2 != nullptr); - ASSERT_TRUE(type->equals(type2.get())); - type3 = DynamicTypeBuilderFactory::get_instance()->create_bool_type(); - ASSERT_TRUE(type3 != nullptr); - ASSERT_TRUE(type->equals(type3.get())); - data = DynamicDataFactory::get_instance()->create_data(type); - data2 = DynamicDataFactory::get_instance()->create_copy(data); - ASSERT_TRUE(data2->equals(data)); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == eprosima::fastdds::dds::RETCODE_OK); - - created_builder = - DynamicTypeBuilderFactory::get_instance()->create_string_builder(BOUND_UNLIMITED); - ASSERT_TRUE(created_builder != nullptr); - type = created_builder->build(); - ASSERT_TRUE(type != nullptr); - type2 = created_builder->build(); - ASSERT_TRUE(type2 != nullptr); - ASSERT_TRUE(type->equals(type2.get())); - type3 = DynamicTypeBuilderFactory::get_instance()->create_string_type(); - ASSERT_TRUE(type3 != nullptr); - ASSERT_TRUE(type->equals(type3.get())); - data = DynamicDataFactory::get_instance()->create_data(type); - data2 = DynamicDataFactory::get_instance()->create_copy(data); - ASSERT_TRUE(data2->equals(data)); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == eprosima::fastdds::dds::RETCODE_OK); - - created_builder = DynamicTypeBuilderFactory::get_instance()->create_wstring_builder(BOUND_UNLIMITED); - ASSERT_TRUE(created_builder != nullptr); - type = created_builder->build(); - ASSERT_TRUE(type != nullptr); - type2 = created_builder->build(); - ASSERT_TRUE(type2 != nullptr); - ASSERT_TRUE(type->equals(type2.get())); - type3 = DynamicTypeBuilderFactory::get_instance()->create_wstring_type(); - ASSERT_TRUE(type3 != nullptr); - ASSERT_TRUE(type->equals(type3.get())); - data = DynamicDataFactory::get_instance()->create_data(type); - data2 = DynamicDataFactory::get_instance()->create_copy(data); - ASSERT_TRUE(data2->equals(data)); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == eprosima::fastdds::dds::RETCODE_OK); - - // Create with custom types - TypeDescriptor pInt32Descriptor; - pInt32Descriptor.set_kind(eprosima::fastdds::dds::xtypes::TK_INT32); - pInt32Descriptor.set_name("TEST_INT32"); - created_builder = DynamicTypeBuilderFactory::get_instance()->create_custom_builder(&pInt32Descriptor); - ASSERT_TRUE(created_builder != nullptr); - type = created_builder->build(); - ASSERT_TRUE(type != nullptr); - type2 = created_builder->build(); - ASSERT_TRUE(type2 != nullptr); - ASSERT_TRUE(type->equals(type2.get())); - data = DynamicDataFactory::get_instance()->create_data(type); - data2 = DynamicDataFactory::get_instance()->create_copy(data); - ASSERT_TRUE(data2->equals(data)); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == eprosima::fastdds::dds::RETCODE_OK); - } - ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); - ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -} - -TEST_F(DynamicTypesTests, DynamicType_int32_unit_tests) -{ - { - DynamicTypeBuilder_ptr created_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); - ASSERT_TRUE(created_builder != nullptr); - DynamicType_ptr created_type = DynamicTypeBuilderFactory::get_instance()->create_type(created_builder.get()); - ASSERT_TRUE(created_type != nullptr); - DynamicData* data = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(data != nullptr); - - int32_t test1 = 123; - int32_t test2 = 0; - ASSERT_TRUE(data->set_int32_value(test1, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->get_int32_value(test2, 0) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(data->get_int32_value(test2, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(test1 == test2); - - //ASSERT_FALSE(data->set_int32_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_uint32_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_int16_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_uint16_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_int64_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_uint64_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_float32_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_float64_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_float128_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_char8_value('a', MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_char16_value(L'a', MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_byte_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_bool_value(false, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_wstring_value(L"", MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_enum_value("", MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - - //int32_t iTest32; - //ASSERT_FALSE(data->get_int32_value(iTest32, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - uint32_t uTest32; - ASSERT_FALSE(data->get_uint32_value(uTest32, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - int16_t iTest16; - ASSERT_FALSE(data->get_int16_value(iTest16, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - uint16_t uTest16; - ASSERT_FALSE(data->get_uint16_value(uTest16, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - int64_t iTest64; - ASSERT_FALSE(data->get_int64_value(iTest64, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - uint64_t uTest64; - ASSERT_FALSE(data->get_uint64_value(uTest64, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - float fTest32; - ASSERT_FALSE(data->get_float32_value(fTest32, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - double fTest64; - ASSERT_FALSE(data->get_float64_value(fTest64, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - long double fTest128; - ASSERT_FALSE(data->get_float128_value(fTest128, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - char cTest8; - ASSERT_FALSE(data->get_char8_value(cTest8, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - wchar_t cTest16; - ASSERT_FALSE(data->get_char16_value(cTest16, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - octet oTest; - ASSERT_FALSE(data->get_byte_value(oTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - bool bTest; - ASSERT_FALSE(data->get_bool_value(bTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - std::string sTest; - ASSERT_FALSE(data->get_string_value(sTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - std::wstring wsTest; - ASSERT_FALSE(data->get_wstring_value(wsTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - std::string sEnumTest; - ASSERT_FALSE(data->get_enum_value(sEnumTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - - // Serialize <-> Deserialize Test - DynamicPubSubType pubsubType(created_type); - uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); - SerializedPayload_t payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(data, &payload)); - ASSERT_TRUE(payload.length == payloadSize); - types::DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); - ASSERT_TRUE(data2->equals(data)); - - // SERIALIZATION TEST - LongStruct wlong; - LongStructPubSubType wlongpb; - - SerializedPayload_t dynamic_payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); - ASSERT_TRUE(wlongpb.deserialize(&dynamic_payload, &wlong)); - - uint32_t static_payloadSize = static_cast(wlongpb.getSerializedSizeProvider(&wlong)()); - SerializedPayload_t static_payload(static_payloadSize); - ASSERT_TRUE(wlongpb.serialize(&wlong, &static_payload)); - ASSERT_TRUE(static_payload.length == static_payloadSize); - types::DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); - ASSERT_TRUE(data3->equals(data)); - - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == eprosima::fastdds::dds::RETCODE_OK); - } - ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); - ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -} - -TEST_F(DynamicTypesTests, DynamicType_uint32_unit_tests) -{ - { - DynamicTypeBuilder_ptr created_builder = DynamicTypeBuilderFactory::get_instance()->create_uint32_builder(); - ASSERT_TRUE(created_builder != nullptr); - DynamicType_ptr created_type = DynamicTypeBuilderFactory::get_instance()->create_type(created_builder.get()); - ASSERT_TRUE(created_type != nullptr); - DynamicData* data = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(data != nullptr); - - uint32_t test1 = 123; - uint32_t test2 = 0; - ASSERT_TRUE(data->set_uint32_value(test1, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->get_uint32_value(test2, 0) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(data->get_uint32_value(test2, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(test1 == test2); - - ASSERT_FALSE(data->set_int32_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - //ASSERT_FALSE(data->set_uint32_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_int16_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_uint16_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_int64_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_uint64_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_float32_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_float64_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_float128_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_char8_value('a', MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_char16_value(L'a', MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_byte_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_bool_value(false, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_wstring_value(L"", MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_enum_value("", MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - - int32_t iTest32; - ASSERT_FALSE(data->get_int32_value(iTest32, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - //uint32_t uTest32; - //ASSERT_FALSE(data->get_uint32_value(uTest32, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - int16_t iTest16; - ASSERT_FALSE(data->get_int16_value(iTest16, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - uint16_t uTest16; - ASSERT_FALSE(data->get_uint16_value(uTest16, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - int64_t iTest64; - ASSERT_FALSE(data->get_int64_value(iTest64, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - uint64_t uTest64; - ASSERT_FALSE(data->get_uint64_value(uTest64, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - float fTest32; - ASSERT_FALSE(data->get_float32_value(fTest32, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - double fTest64; - ASSERT_FALSE(data->get_float64_value(fTest64, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - long double fTest128; - ASSERT_FALSE(data->get_float128_value(fTest128, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - char cTest8; - ASSERT_FALSE(data->get_char8_value(cTest8, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - wchar_t cTest16; - ASSERT_FALSE(data->get_char16_value(cTest16, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - octet oTest; - ASSERT_FALSE(data->get_byte_value(oTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - bool bTest; - ASSERT_FALSE(data->get_bool_value(bTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - std::string sTest; - ASSERT_FALSE(data->get_string_value(sTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - std::wstring wsTest; - ASSERT_FALSE(data->get_wstring_value(wsTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - std::string sEnumTest; - ASSERT_FALSE(data->get_enum_value(sEnumTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - - // Serialize <-> Deserialize Test - DynamicPubSubType pubsubType(created_type); - uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); - SerializedPayload_t payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(data, &payload)); - ASSERT_TRUE(payload.length == payloadSize); - types::DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); - ASSERT_TRUE(data2->equals(data)); - - // SERIALIZATION TEST - ULongStruct wlong; - ULongStructPubSubType wlongpb; - - SerializedPayload_t dynamic_payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); - ASSERT_TRUE(wlongpb.deserialize(&dynamic_payload, &wlong)); - - uint32_t static_payloadSize = static_cast(wlongpb.getSerializedSizeProvider(&wlong)()); - SerializedPayload_t static_payload(static_payloadSize); - ASSERT_TRUE(wlongpb.serialize(&wlong, &static_payload)); - ASSERT_TRUE(static_payload.length == static_payloadSize); - types::DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); - ASSERT_TRUE(data3->equals(data)); - - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == eprosima::fastdds::dds::RETCODE_OK); - } - ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); - ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -} - -TEST_F(DynamicTypesTests, DynamicType_int16_unit_tests) -{ - { - DynamicTypeBuilder_ptr created_builder = DynamicTypeBuilderFactory::get_instance()->create_int16_builder(); - ASSERT_TRUE(created_builder != nullptr); - DynamicType_ptr created_type = DynamicTypeBuilderFactory::get_instance()->create_type(created_builder.get()); - ASSERT_TRUE(created_type != nullptr); - DynamicData* data = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(data != nullptr); - - int16_t test1 = 123; - int16_t test2 = 0; - ASSERT_TRUE(data->set_int16_value(test1, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->get_int16_value(test2, 0) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(data->get_int16_value(test2, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(test1 == test2); - - ASSERT_FALSE(data->set_int32_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_uint32_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - //ASSERT_FALSE(data->set_int16_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_uint16_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_int64_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_uint64_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_float32_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_float64_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_float128_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_char8_value('a', MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_char16_value(L'a', MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_byte_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_bool_value(false, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_wstring_value(L"", MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_enum_value("", MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - - int32_t iTest32; - ASSERT_FALSE(data->get_int32_value(iTest32, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - uint32_t uTest32; - ASSERT_FALSE(data->get_uint32_value(uTest32, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - //int16_t iTest16; - //ASSERT_FALSE(data->get_int16_value(iTest16, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - uint16_t uTest16; - ASSERT_FALSE(data->get_uint16_value(uTest16, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - int64_t iTest64; - ASSERT_FALSE(data->get_int64_value(iTest64, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - uint64_t uTest64; - ASSERT_FALSE(data->get_uint64_value(uTest64, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - float fTest32; - ASSERT_FALSE(data->get_float32_value(fTest32, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - double fTest64; - ASSERT_FALSE(data->get_float64_value(fTest64, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - long double fTest128; - ASSERT_FALSE(data->get_float128_value(fTest128, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - char cTest8; - ASSERT_FALSE(data->get_char8_value(cTest8, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - wchar_t cTest16; - ASSERT_FALSE(data->get_char16_value(cTest16, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - octet oTest; - ASSERT_FALSE(data->get_byte_value(oTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - bool bTest; - ASSERT_FALSE(data->get_bool_value(bTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - std::string sTest; - ASSERT_FALSE(data->get_string_value(sTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - std::wstring wsTest; - ASSERT_FALSE(data->get_wstring_value(wsTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - std::string sEnumTest; - ASSERT_FALSE(data->get_enum_value(sEnumTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - - // Serialize <-> Deserialize Test - DynamicPubSubType pubsubType(created_type); - uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); - SerializedPayload_t payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(data, &payload)); - ASSERT_TRUE(payload.length == payloadSize); - types::DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); - ASSERT_TRUE(data2->equals(data)); - - // SERIALIZATION TEST - ShortStruct wshort; - ShortStructPubSubType wshortpb; - - SerializedPayload_t dynamic_payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); - ASSERT_TRUE(wshortpb.deserialize(&dynamic_payload, &wshort)); - - uint32_t static_payloadSize = static_cast(wshortpb.getSerializedSizeProvider(&wshort)()); - SerializedPayload_t static_payload(static_payloadSize); - ASSERT_TRUE(wshortpb.serialize(&wshort, &static_payload)); - ASSERT_TRUE(static_payload.length == static_payloadSize); - types::DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); - ASSERT_TRUE(data3->equals(data)); - - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == eprosima::fastdds::dds::RETCODE_OK); - } - ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); - ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -} - -TEST_F(DynamicTypesTests, DynamicType_uint16_unit_tests) -{ - { - DynamicTypeBuilder_ptr created_builder = DynamicTypeBuilderFactory::get_instance()->create_uint16_builder(); - ASSERT_TRUE(created_builder != nullptr); - DynamicType_ptr created_type = DynamicTypeBuilderFactory::get_instance()->create_type(created_builder.get()); - ASSERT_TRUE(created_type != nullptr); - DynamicData* data = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(data != nullptr); - - uint16_t test1 = 123; - uint16_t test2 = 0; - ASSERT_TRUE(data->set_uint16_value(test1, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->get_uint16_value(test2, 0) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(data->get_uint16_value(test2, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(test1 == test2); - - ASSERT_FALSE(data->set_int32_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_uint32_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_int16_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - //ASSERT_FALSE(data->set_uint16_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_int64_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_uint64_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_float32_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_float64_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_float128_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_char8_value('a', MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_char16_value(L'a', MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_byte_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_bool_value(false, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_wstring_value(L"", MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_enum_value("", MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - - int32_t iTest32; - ASSERT_FALSE(data->get_int32_value(iTest32, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - uint32_t uTest32; - ASSERT_FALSE(data->get_uint32_value(uTest32, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - int16_t iTest16; - ASSERT_FALSE(data->get_int16_value(iTest16, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - //uint16_t uTest16; - //ASSERT_FALSE(data->get_uint16_value(uTest16, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - int64_t iTest64; - ASSERT_FALSE(data->get_int64_value(iTest64, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - uint64_t uTest64; - ASSERT_FALSE(data->get_uint64_value(uTest64, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - float fTest32; - ASSERT_FALSE(data->get_float32_value(fTest32, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - double fTest64; - ASSERT_FALSE(data->get_float64_value(fTest64, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - long double fTest128; - ASSERT_FALSE(data->get_float128_value(fTest128, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - char cTest8; - ASSERT_FALSE(data->get_char8_value(cTest8, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - wchar_t cTest16; - ASSERT_FALSE(data->get_char16_value(cTest16, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - octet oTest; - ASSERT_FALSE(data->get_byte_value(oTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - bool bTest; - ASSERT_FALSE(data->get_bool_value(bTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - std::string sTest; - ASSERT_FALSE(data->get_string_value(sTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - std::wstring wsTest; - ASSERT_FALSE(data->get_wstring_value(wsTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - std::string sEnumTest; - ASSERT_FALSE(data->get_enum_value(sEnumTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - - // Serialize <-> Deserialize Test - DynamicPubSubType pubsubType(created_type); - uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); - SerializedPayload_t payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(data, &payload)); - ASSERT_TRUE(payload.length == payloadSize); - types::DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); - ASSERT_TRUE(data2->equals(data)); - - // SERIALIZATION TEST - UShortStruct wshort; - UShortStructPubSubType wshortpb; - - SerializedPayload_t dynamic_payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); - ASSERT_TRUE(wshortpb.deserialize(&dynamic_payload, &wshort)); - - uint32_t static_payloadSize = static_cast(wshortpb.getSerializedSizeProvider(&wshort)()); - SerializedPayload_t static_payload(static_payloadSize); - ASSERT_TRUE(wshortpb.serialize(&wshort, &static_payload)); - ASSERT_TRUE(static_payload.length == static_payloadSize); - types::DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); - ASSERT_TRUE(data3->equals(data)); - - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == eprosima::fastdds::dds::RETCODE_OK); - } - ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); - ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -} - -TEST_F(DynamicTypesTests, DynamicType_int64_unit_tests) -{ - { - DynamicTypeBuilder_ptr created_builder = DynamicTypeBuilderFactory::get_instance()->create_int64_builder(); - ASSERT_TRUE(created_builder != nullptr); - DynamicType_ptr created_type = DynamicTypeBuilderFactory::get_instance()->create_type(created_builder.get()); - ASSERT_TRUE(created_type != nullptr); - DynamicData* data = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(data != nullptr); - - int64_t test1 = 123; - int64_t test2 = 0; - ASSERT_TRUE(data->set_int64_value(test1, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->get_int64_value(test2, 0) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(data->get_int64_value(test2, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(test1 == test2); - - ASSERT_FALSE(data->set_int32_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_uint32_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_int16_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_uint16_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - //ASSERT_FALSE(data->set_int64_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_uint64_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_float32_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_float64_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_float128_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_char8_value('a', MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_char16_value(L'a', MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_byte_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_bool_value(false, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_wstring_value(L"", MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_enum_value("", MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - - int32_t iTest32; - ASSERT_FALSE(data->get_int32_value(iTest32, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - uint32_t uTest32; - ASSERT_FALSE(data->get_uint32_value(uTest32, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - int16_t iTest16; - ASSERT_FALSE(data->get_int16_value(iTest16, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - uint16_t uTest16; - ASSERT_FALSE(data->get_uint16_value(uTest16, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - //int64_t iTest64; - //ASSERT_FALSE(data->get_int64_value(iTest64, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - uint64_t uTest64; - ASSERT_FALSE(data->get_uint64_value(uTest64, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - float fTest32; - ASSERT_FALSE(data->get_float32_value(fTest32, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - double fTest64; - ASSERT_FALSE(data->get_float64_value(fTest64, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - long double fTest128; - ASSERT_FALSE(data->get_float128_value(fTest128, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - char cTest8; - ASSERT_FALSE(data->get_char8_value(cTest8, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - wchar_t cTest16; - ASSERT_FALSE(data->get_char16_value(cTest16, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - octet oTest; - ASSERT_FALSE(data->get_byte_value(oTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - bool bTest; - ASSERT_FALSE(data->get_bool_value(bTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - std::string sTest; - ASSERT_FALSE(data->get_string_value(sTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - std::wstring wsTest; - ASSERT_FALSE(data->get_wstring_value(wsTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - std::string sEnumTest; - ASSERT_FALSE(data->get_enum_value(sEnumTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - - // Serialize <-> Deserialize Test - DynamicPubSubType pubsubType(created_type); - uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); - SerializedPayload_t payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(data, &payload)); - ASSERT_TRUE(payload.length == payloadSize); - types::DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); - ASSERT_TRUE(data2->equals(data)); - - // SERIALIZATION TEST - LongLongStruct wlonglong; - LongLongStructPubSubType wlonglongpb; - - SerializedPayload_t dynamic_payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); - ASSERT_TRUE(wlonglongpb.deserialize(&dynamic_payload, &wlonglong)); - - uint32_t static_payloadSize = static_cast(wlonglongpb.getSerializedSizeProvider(&wlonglong)()); - SerializedPayload_t static_payload(static_payloadSize); - ASSERT_TRUE(wlonglongpb.serialize(&wlonglong, &static_payload)); - ASSERT_TRUE(static_payload.length == static_payloadSize); - types::DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); - ASSERT_TRUE(data3->equals(data)); - - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == eprosima::fastdds::dds::RETCODE_OK); - } - ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); - ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -} - -TEST_F(DynamicTypesTests, DynamicType_uint64_unit_tests) -{ - { - DynamicTypeBuilder_ptr created_builder = DynamicTypeBuilderFactory::get_instance()->create_uint64_builder(); - ASSERT_TRUE(created_builder != nullptr); - DynamicType_ptr created_type = DynamicTypeBuilderFactory::get_instance()->create_type(created_builder.get()); - ASSERT_TRUE(created_type != nullptr); - DynamicData* data = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(data != nullptr); - - uint64_t test1 = 123; - uint64_t test2 = 0; - ASSERT_TRUE(data->set_uint64_value(test1, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->get_uint64_value(test2, 0) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(data->get_uint64_value(test2, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(test1 == test2); - - ASSERT_FALSE(data->set_int32_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_uint32_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_int16_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_uint16_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_int64_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - //ASSERT_FALSE(data->set_uint64_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_float32_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_float64_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_float128_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_char8_value('a', MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_char16_value(L'a', MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_byte_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_bool_value(false, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_wstring_value(L"", MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_enum_value("", MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - - int32_t iTest32; - ASSERT_FALSE(data->get_int32_value(iTest32, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - uint32_t uTest32; - ASSERT_FALSE(data->get_uint32_value(uTest32, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - int16_t iTest16; - ASSERT_FALSE(data->get_int16_value(iTest16, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - uint16_t uTest16; - ASSERT_FALSE(data->get_uint16_value(uTest16, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - int64_t iTest64; - ASSERT_FALSE(data->get_int64_value(iTest64, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - //uint64_t uTest64; - //ASSERT_FALSE(data->get_uint64_value(uTest64, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - float fTest32; - ASSERT_FALSE(data->get_float32_value(fTest32, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - double fTest64; - ASSERT_FALSE(data->get_float64_value(fTest64, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - long double fTest128; - ASSERT_FALSE(data->get_float128_value(fTest128, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - char cTest8; - ASSERT_FALSE(data->get_char8_value(cTest8, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - wchar_t cTest16; - ASSERT_FALSE(data->get_char16_value(cTest16, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - octet oTest; - ASSERT_FALSE(data->get_byte_value(oTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - bool bTest; - ASSERT_FALSE(data->get_bool_value(bTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - std::string sTest; - ASSERT_FALSE(data->get_string_value(sTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - std::wstring wsTest; - ASSERT_FALSE(data->get_wstring_value(wsTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - std::string sEnumTest; - ASSERT_FALSE(data->get_enum_value(sEnumTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - - // Serialize <-> Deserialize Test - DynamicPubSubType pubsubType(created_type); - uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); - SerializedPayload_t payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(data, &payload)); - ASSERT_TRUE(payload.length == payloadSize); - types::DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); - ASSERT_TRUE(data2->equals(data)); - - // SERIALIZATION TEST - ULongLongStruct wlonglong; - ULongLongStructPubSubType wlonglongpb; - - SerializedPayload_t dynamic_payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); - ASSERT_TRUE(wlonglongpb.deserialize(&dynamic_payload, &wlonglong)); - - uint32_t static_payloadSize = static_cast(wlonglongpb.getSerializedSizeProvider(&wlonglong)()); - SerializedPayload_t static_payload(static_payloadSize); - ASSERT_TRUE(wlonglongpb.serialize(&wlonglong, &static_payload)); - ASSERT_TRUE(static_payload.length == static_payloadSize); - types::DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); - ASSERT_TRUE(data3->equals(data)); - - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == eprosima::fastdds::dds::RETCODE_OK); - } - ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); - ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -} - -TEST_F(DynamicTypesTests, DynamicType_float32_unit_tests) -{ - { - DynamicTypeBuilder_ptr created_builder = DynamicTypeBuilderFactory::get_instance()->create_float32_builder(); - ASSERT_TRUE(created_builder != nullptr); - DynamicType_ptr created_type = DynamicTypeBuilderFactory::get_instance()->create_type(created_builder.get()); - ASSERT_TRUE(created_type != nullptr); - DynamicData* data = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(data != nullptr); - - float test1 = 123.0f; - float test2 = 0.0f; - ASSERT_TRUE(data->set_float32_value(test1, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->get_float32_value(test2, 0) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(data->get_float32_value(test2, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(test1 == test2); - - ASSERT_FALSE(data->set_int32_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_uint32_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_int16_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_uint16_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_int64_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_uint64_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - //ASSERT_FALSE(data->set_float32_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_float64_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_float128_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_char8_value('a', MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_char16_value(L'a', MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_byte_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_bool_value(false, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_wstring_value(L"", MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_enum_value("", MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - - int32_t iTest32; - ASSERT_FALSE(data->get_int32_value(iTest32, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - uint32_t uTest32; - ASSERT_FALSE(data->get_uint32_value(uTest32, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - int16_t iTest16; - ASSERT_FALSE(data->get_int16_value(iTest16, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - uint16_t uTest16; - ASSERT_FALSE(data->get_uint16_value(uTest16, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - int64_t iTest64; - ASSERT_FALSE(data->get_int64_value(iTest64, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - uint64_t uTest64; - ASSERT_FALSE(data->get_uint64_value(uTest64, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - //float fTest32; - //ASSERT_FALSE(data->get_float32_value(fTest32, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - double fTest64; - ASSERT_FALSE(data->get_float64_value(fTest64, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - long double fTest128; - ASSERT_FALSE(data->get_float128_value(fTest128, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - char cTest8; - ASSERT_FALSE(data->get_char8_value(cTest8, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - wchar_t cTest16; - ASSERT_FALSE(data->get_char16_value(cTest16, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - octet oTest; - ASSERT_FALSE(data->get_byte_value(oTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - bool bTest; - ASSERT_FALSE(data->get_bool_value(bTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - std::string sTest; - ASSERT_FALSE(data->get_string_value(sTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - std::wstring wsTest; - ASSERT_FALSE(data->get_wstring_value(wsTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - std::string sEnumTest; - ASSERT_FALSE(data->get_enum_value(sEnumTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - - // Serialize <-> Deserialize Test - DynamicPubSubType pubsubType(created_type); - uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); - SerializedPayload_t payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(data, &payload)); - ASSERT_TRUE(payload.length == payloadSize); - types::DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); - ASSERT_TRUE(data2->equals(data)); - - // SERIALIZATION TEST - FloatStruct wfloat; - FloatStructPubSubType wfloatpb; - - SerializedPayload_t dynamic_payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); - ASSERT_TRUE(wfloatpb.deserialize(&dynamic_payload, &wfloat)); - - uint32_t static_payloadSize = static_cast(wfloatpb.getSerializedSizeProvider(&wfloat)()); - SerializedPayload_t static_payload(static_payloadSize); - ASSERT_TRUE(wfloatpb.serialize(&wfloat, &static_payload)); - ASSERT_TRUE(static_payload.length == static_payloadSize); - types::DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); - ASSERT_TRUE(data3->equals(data)); - - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == eprosima::fastdds::dds::RETCODE_OK); - } - - ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); - ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -} - -TEST_F(DynamicTypesTests, DynamicType_float64_unit_tests) -{ - { - DynamicTypeBuilder_ptr created_builder = DynamicTypeBuilderFactory::get_instance()->create_float64_builder(); - ASSERT_TRUE(created_builder != nullptr); - DynamicType_ptr created_type = DynamicTypeBuilderFactory::get_instance()->create_type(created_builder.get()); - ASSERT_TRUE(created_type != nullptr); - DynamicData* data = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(data != nullptr); - - double test1 = 123.0; - double test2 = 0.0; - ASSERT_TRUE(data->set_float64_value(test1, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->get_float64_value(test2, 0) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(data->get_float64_value(test2, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(test1 == test2); - - ASSERT_FALSE(data->set_int32_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_uint32_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_int16_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_uint16_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_int64_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_uint64_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_float32_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - //ASSERT_FALSE(data->set_float64_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_float128_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_char8_value('a', MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_char16_value(L'a', MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_byte_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_bool_value(false, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_wstring_value(L"", MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_enum_value("", MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - - int32_t iTest32; - ASSERT_FALSE(data->get_int32_value(iTest32, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - uint32_t uTest32; - ASSERT_FALSE(data->get_uint32_value(uTest32, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - int16_t iTest16; - ASSERT_FALSE(data->get_int16_value(iTest16, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - uint16_t uTest16; - ASSERT_FALSE(data->get_uint16_value(uTest16, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - int64_t iTest64; - ASSERT_FALSE(data->get_int64_value(iTest64, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - uint64_t uTest64; - ASSERT_FALSE(data->get_uint64_value(uTest64, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - float fTest32; - ASSERT_FALSE(data->get_float32_value(fTest32, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - //double fTest64; - //ASSERT_FALSE(data->get_float64_value(fTest64, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - long double fTest128; - ASSERT_FALSE(data->get_float128_value(fTest128, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - char cTest8; - ASSERT_FALSE(data->get_char8_value(cTest8, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - wchar_t cTest16; - ASSERT_FALSE(data->get_char16_value(cTest16, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - octet oTest; - ASSERT_FALSE(data->get_byte_value(oTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - bool bTest; - ASSERT_FALSE(data->get_bool_value(bTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - std::string sTest; - ASSERT_FALSE(data->get_string_value(sTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - std::wstring wsTest; - ASSERT_FALSE(data->get_wstring_value(wsTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - std::string sEnumTest; - ASSERT_FALSE(data->get_enum_value(sEnumTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - - // Serialize <-> Deserialize Test - DynamicPubSubType pubsubType(created_type); - uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); - SerializedPayload_t payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(data, &payload)); - ASSERT_TRUE(payload.length == payloadSize); - types::DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); - ASSERT_TRUE(data2->equals(data)); - - // SERIALIZATION TEST - DoubleStruct wdouble; - DoubleStructPubSubType wdoublepb; - - SerializedPayload_t dynamic_payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); - ASSERT_TRUE(wdoublepb.deserialize(&dynamic_payload, &wdouble)); - - uint32_t static_payloadSize = static_cast(wdoublepb.getSerializedSizeProvider(&wdouble)()); - SerializedPayload_t static_payload(static_payloadSize); - ASSERT_TRUE(wdoublepb.serialize(&wdouble, &static_payload)); - ASSERT_TRUE(static_payload.length == static_payloadSize); - types::DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); - ASSERT_TRUE(data3->equals(data)); - - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == eprosima::fastdds::dds::RETCODE_OK); - } - - ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); - ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -} - -TEST_F(DynamicTypesTests, DynamicType_float128_unit_tests) -{ - { - DynamicTypeBuilder_ptr created_builder = DynamicTypeBuilderFactory::get_instance()->create_float128_builder(); - ASSERT_TRUE(created_builder != nullptr); - DynamicType_ptr created_type = DynamicTypeBuilderFactory::get_instance()->create_type(created_builder.get()); - ASSERT_TRUE(created_type != nullptr); - DynamicData* data = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(data != nullptr); - - long double test1 = 123.0; - long double test2 = 0.0; - ASSERT_TRUE(data->set_float128_value(test1, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->get_float128_value(test2, 0) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(data->get_float128_value(test2, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(test1 == test2); - - ASSERT_FALSE(data->set_int32_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_uint32_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_int16_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_uint16_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_int64_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_uint64_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_float32_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_float64_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - //ASSERT_FALSE(data->set_float128_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_char8_value('a', MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_char16_value(L'a', MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_byte_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_bool_value(false, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_wstring_value(L"", MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_enum_value("", MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - - int32_t iTest32; - ASSERT_FALSE(data->get_int32_value(iTest32, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - uint32_t uTest32; - ASSERT_FALSE(data->get_uint32_value(uTest32, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - int16_t iTest16; - ASSERT_FALSE(data->get_int16_value(iTest16, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - uint16_t uTest16; - ASSERT_FALSE(data->get_uint16_value(uTest16, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - int64_t iTest64; - ASSERT_FALSE(data->get_int64_value(iTest64, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - uint64_t uTest64; - ASSERT_FALSE(data->get_uint64_value(uTest64, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - float fTest32; - ASSERT_FALSE(data->get_float32_value(fTest32, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - double fTest64; - ASSERT_FALSE(data->get_float64_value(fTest64, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - //long double fTest128; - //ASSERT_FALSE(data->get_float128_value(fTest128, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - char cTest8; - ASSERT_FALSE(data->get_char8_value(cTest8, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - wchar_t cTest16; - ASSERT_FALSE(data->get_char16_value(cTest16, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - octet oTest; - ASSERT_FALSE(data->get_byte_value(oTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - bool bTest; - ASSERT_FALSE(data->get_bool_value(bTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - std::string sTest; - ASSERT_FALSE(data->get_string_value(sTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - std::wstring wsTest; - ASSERT_FALSE(data->get_wstring_value(wsTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - std::string sEnumTest; - ASSERT_FALSE(data->get_enum_value(sEnumTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - - // Serialize <-> Deserialize Test - DynamicPubSubType pubsubType(created_type); - uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); - SerializedPayload_t payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(data, &payload)); - ASSERT_TRUE(payload.length == payloadSize); - types::DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); - ASSERT_TRUE(data2->equals(data)); - - // SERIALIZATION TEST - LongDoubleStruct wldouble; - LongDoubleStructPubSubType wldoublepb; - - SerializedPayload_t dynamic_payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); - ASSERT_TRUE(wldoublepb.deserialize(&dynamic_payload, &wldouble)); - - uint32_t static_payloadSize = static_cast(wldoublepb.getSerializedSizeProvider(&wldouble)()); - SerializedPayload_t static_payload(static_payloadSize); - ASSERT_TRUE(wldoublepb.serialize(&wldouble, &static_payload)); - ASSERT_TRUE(static_payload.length == static_payloadSize); - types::DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); - ASSERT_TRUE(data3->equals(data)); - - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == eprosima::fastdds::dds::RETCODE_OK); - } - ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); - ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -} - -TEST_F(DynamicTypesTests, DynamicType_char8_unit_tests) -{ - { - DynamicTypeBuilder_ptr created_builder = DynamicTypeBuilderFactory::get_instance()->create_char8_builder(); - ASSERT_TRUE(created_builder != nullptr); - DynamicType_ptr created_type = DynamicTypeBuilderFactory::get_instance()->create_type(created_builder.get()); - ASSERT_TRUE(created_type != nullptr); - DynamicData* data = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(data != nullptr); - - char test1 = 'a'; - char test2 = 'b'; - ASSERT_TRUE(data->set_char8_value(test1, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->get_char8_value(test2, 0) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(data->get_char8_value(test2, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(test1 == test2); - - ASSERT_FALSE(data->set_int32_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_uint32_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_int16_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_uint16_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_int64_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_uint64_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_float32_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_float64_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_float128_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - //ASSERT_FALSE(data->set_char8_value('a', MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_char16_value(L'a', MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_byte_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_bool_value(false, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_wstring_value(L"", MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_enum_value("", MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - - int32_t iTest32; - ASSERT_FALSE(data->get_int32_value(iTest32, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - uint32_t uTest32; - ASSERT_FALSE(data->get_uint32_value(uTest32, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - int16_t iTest16; - ASSERT_FALSE(data->get_int16_value(iTest16, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - uint16_t uTest16; - ASSERT_FALSE(data->get_uint16_value(uTest16, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - int64_t iTest64; - ASSERT_FALSE(data->get_int64_value(iTest64, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - uint64_t uTest64; - ASSERT_FALSE(data->get_uint64_value(uTest64, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - float fTest32; - ASSERT_FALSE(data->get_float32_value(fTest32, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - double fTest64; - ASSERT_FALSE(data->get_float64_value(fTest64, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - long double fTest128; - ASSERT_FALSE(data->get_float128_value(fTest128, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - //char cTest8; - //ASSERT_FALSE(data->get_char8_value(cTest8, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - wchar_t cTest16; - ASSERT_FALSE(data->get_char16_value(cTest16, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - octet oTest; - ASSERT_FALSE(data->get_byte_value(oTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - bool bTest; - ASSERT_FALSE(data->get_bool_value(bTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - std::string sTest; - ASSERT_FALSE(data->get_string_value(sTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - std::wstring wsTest; - ASSERT_FALSE(data->get_wstring_value(wsTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - std::string sEnumTest; - ASSERT_FALSE(data->get_enum_value(sEnumTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - - // Serialize <-> Deserialize Test - DynamicPubSubType pubsubType(created_type); - uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); - SerializedPayload_t payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(data, &payload)); - ASSERT_TRUE(payload.length == payloadSize); - types::DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); - ASSERT_TRUE(data2->equals(data)); - - // SERIALIZATION TEST - CharStruct wchar; - CharStructPubSubType wcharpb; - - SerializedPayload_t dynamic_payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); - ASSERT_TRUE(wcharpb.deserialize(&dynamic_payload, &wchar)); - - uint32_t static_payloadSize = static_cast(wcharpb.getSerializedSizeProvider(&wchar)()); - SerializedPayload_t static_payload(static_payloadSize); - ASSERT_TRUE(wcharpb.serialize(&wchar, &static_payload)); - ASSERT_TRUE(static_payload.length == static_payloadSize); - types::DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); - ASSERT_TRUE(data3->equals(data)); - - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == eprosima::fastdds::dds::RETCODE_OK); - } - - ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); - ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -} - -#if FASTCDR_VERSION_MAJOR == 1 -TEST_F(DynamicTypesTests, DynamicType_char16_unit_tests) -{ - { - DynamicTypeBuilder_ptr created_builder = DynamicTypeBuilderFactory::get_instance()->create_char16_builder(); - ASSERT_TRUE(created_builder != nullptr); - DynamicType_ptr created_type = DynamicTypeBuilderFactory::get_instance()->create_type(created_builder.get()); - ASSERT_TRUE(created_type != nullptr); - DynamicData* data = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(data != nullptr); - - wchar_t test1 = L'a'; - wchar_t test2 = L'b'; - ASSERT_TRUE(data->set_char16_value(test1, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->get_char16_value(test2, 0) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(data->get_char16_value(test2, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(test1 == test2); - - ASSERT_FALSE(data->set_int32_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_uint32_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_int16_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_uint16_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_int64_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_uint64_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_float32_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_float64_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_float128_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_char8_value('a', MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - //ASSERT_FALSE(data->set_char16_value(L'a', MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_byte_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_bool_value(false, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_wstring_value(L"", MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_enum_value("", MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - - int32_t iTest32; - ASSERT_FALSE(data->get_int32_value(iTest32, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - uint32_t uTest32; - ASSERT_FALSE(data->get_uint32_value(uTest32, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - int16_t iTest16; - ASSERT_FALSE(data->get_int16_value(iTest16, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - uint16_t uTest16; - ASSERT_FALSE(data->get_uint16_value(uTest16, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - int64_t iTest64; - ASSERT_FALSE(data->get_int64_value(iTest64, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - uint64_t uTest64; - ASSERT_FALSE(data->get_uint64_value(uTest64, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - float fTest32; - ASSERT_FALSE(data->get_float32_value(fTest32, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - double fTest64; - ASSERT_FALSE(data->get_float64_value(fTest64, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - long double fTest128; - ASSERT_FALSE(data->get_float128_value(fTest128, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - char cTest8; - ASSERT_FALSE(data->get_char8_value(cTest8, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - //wchar_t cTest16; - //ASSERT_FALSE(data->get_char16_value(cTest16, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - octet oTest; - ASSERT_FALSE(data->get_byte_value(oTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - bool bTest; - ASSERT_FALSE(data->get_bool_value(bTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - std::string sTest; - ASSERT_FALSE(data->get_string_value(sTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - std::wstring wsTest; - ASSERT_FALSE(data->get_wstring_value(wsTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - std::string sEnumTest; - ASSERT_FALSE(data->get_enum_value(sEnumTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - - // Serialize <-> Deserialize Test - DynamicPubSubType pubsubType(created_type); - uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); - SerializedPayload_t payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(data, &payload)); - ASSERT_TRUE(payload.length == payloadSize); - - types::DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); - ASSERT_TRUE(data2->equals(data)); - - // SERIALIZATION TEST - WCharStruct wchar; - WCharStructPubSubType wcharpb; - - SerializedPayload_t dynamic_payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); - ASSERT_TRUE(wcharpb.deserialize(&dynamic_payload, &wchar)); - - uint32_t static_payloadSize = static_cast(wcharpb.getSerializedSizeProvider(&wchar)()); - SerializedPayload_t static_payload(static_payloadSize); - ASSERT_TRUE(wcharpb.serialize(&wchar, &static_payload)); - ASSERT_TRUE(static_payload.length == static_payloadSize); - types::DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); - ASSERT_TRUE(data3->equals(data)); - - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == eprosima::fastdds::dds::RETCODE_OK); - } - ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); - ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -} -#endif // if FASTCDR_VERSION_MAJOR == 1 - -TEST_F(DynamicTypesTests, DynamicType_byte_unit_tests) -{ - { - DynamicTypeBuilder_ptr created_builder = DynamicTypeBuilderFactory::get_instance()->create_byte_builder(); - ASSERT_TRUE(created_builder != nullptr); - DynamicType_ptr created_type = DynamicTypeBuilderFactory::get_instance()->create_type(created_builder.get()); - ASSERT_TRUE(created_type != nullptr); - DynamicData* data = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(data != nullptr); - - octet test1 = 255; - octet test2 = 0; - ASSERT_TRUE(data->set_byte_value(test1, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->get_byte_value(test2, 0) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(data->get_byte_value(test2, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(test1 == test2); - - ASSERT_FALSE(data->set_int32_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_uint32_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_int16_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_uint16_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_int64_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_uint64_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_float32_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_float64_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_float128_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_char8_value('a', MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_char16_value(L'a', MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - //ASSERT_FALSE(data->set_byte_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_bool_value(false, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_wstring_value(L"", MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_enum_value("", MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - - int32_t iTest32; - ASSERT_FALSE(data->get_int32_value(iTest32, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - uint32_t uTest32; - ASSERT_FALSE(data->get_uint32_value(uTest32, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - int16_t iTest16; - ASSERT_FALSE(data->get_int16_value(iTest16, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - uint16_t uTest16; - ASSERT_FALSE(data->get_uint16_value(uTest16, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - int64_t iTest64; - ASSERT_FALSE(data->get_int64_value(iTest64, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - uint64_t uTest64; - ASSERT_FALSE(data->get_uint64_value(uTest64, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - float fTest32; - ASSERT_FALSE(data->get_float32_value(fTest32, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - double fTest64; - ASSERT_FALSE(data->get_float64_value(fTest64, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - long double fTest128; - ASSERT_FALSE(data->get_float128_value(fTest128, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - char cTest8; - ASSERT_FALSE(data->get_char8_value(cTest8, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - wchar_t cTest16; - ASSERT_FALSE(data->get_char16_value(cTest16, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - //octet oTest; - //ASSERT_FALSE(data->get_byte_value(oTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - bool bTest; - ASSERT_FALSE(data->get_bool_value(bTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - std::string sTest; - ASSERT_FALSE(data->get_string_value(sTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - std::wstring wsTest; - ASSERT_FALSE(data->get_wstring_value(wsTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - std::string sEnumTest; - ASSERT_FALSE(data->get_enum_value(sEnumTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - - // Serialize <-> Deserialize Test - DynamicPubSubType pubsubType(created_type); - uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); - SerializedPayload_t payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(data, &payload)); - ASSERT_TRUE(payload.length == payloadSize); - types::DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); - ASSERT_TRUE(data2->equals(data)); - - // SERIALIZATION TEST - OctetStruct wchar; - OctetStructPubSubType wcharpb; - - SerializedPayload_t dynamic_payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); - ASSERT_TRUE(wcharpb.deserialize(&dynamic_payload, &wchar)); - - uint32_t static_payloadSize = static_cast(wcharpb.getSerializedSizeProvider(&wchar)()); - SerializedPayload_t static_payload(static_payloadSize); - ASSERT_TRUE(wcharpb.serialize(&wchar, &static_payload)); - ASSERT_TRUE(static_payload.length == static_payloadSize); - types::DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); - ASSERT_TRUE(data3->equals(data)); - - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == eprosima::fastdds::dds::RETCODE_OK); - } - ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); - ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -} - -TEST_F(DynamicTypesTests, DynamicType_bool_unit_tests) -{ - { - DynamicTypeBuilder_ptr created_builder = DynamicTypeBuilderFactory::get_instance()->create_bool_builder(); - ASSERT_TRUE(created_builder != nullptr); - DynamicType_ptr created_type = DynamicTypeBuilderFactory::get_instance()->create_type(created_builder.get()); - ASSERT_TRUE(created_type != nullptr); - DynamicData* data = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(data != nullptr); - - bool test1 = true; - bool test2 = false; - ASSERT_TRUE(data->set_bool_value(test1, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->get_bool_value(test2, 0) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(data->get_bool_value(test2, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(test1 == test2); - - ASSERT_FALSE(data->set_int32_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_uint32_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_int16_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_uint16_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_int64_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_uint64_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_float32_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_float64_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_float128_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_char8_value('a', MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_char16_value(L'a', MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_byte_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - //ASSERT_FALSE(data->set_bool_value(false, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_wstring_value(L"", MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_enum_value("", MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - - int32_t iTest32; - ASSERT_FALSE(data->get_int32_value(iTest32, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - uint32_t uTest32; - ASSERT_FALSE(data->get_uint32_value(uTest32, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - int16_t iTest16; - ASSERT_FALSE(data->get_int16_value(iTest16, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - uint16_t uTest16; - ASSERT_FALSE(data->get_uint16_value(uTest16, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - int64_t iTest64; - ASSERT_FALSE(data->get_int64_value(iTest64, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - uint64_t uTest64; - ASSERT_FALSE(data->get_uint64_value(uTest64, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - float fTest32; - ASSERT_FALSE(data->get_float32_value(fTest32, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - double fTest64; - ASSERT_FALSE(data->get_float64_value(fTest64, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - long double fTest128; - ASSERT_FALSE(data->get_float128_value(fTest128, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - char cTest8; - ASSERT_FALSE(data->get_char8_value(cTest8, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - wchar_t cTest16; - ASSERT_FALSE(data->get_char16_value(cTest16, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - octet oTest; - ASSERT_FALSE(data->get_byte_value(oTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - //bool bTest; - //ASSERT_FALSE(data->get_bool_value(bTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - std::string sTest; - ASSERT_FALSE(data->get_string_value(sTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - std::wstring wsTest; - ASSERT_FALSE(data->get_wstring_value(wsTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - std::string sEnumTest; - ASSERT_FALSE(data->get_enum_value(sEnumTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - - // Serialize <-> Deserialize Test - DynamicPubSubType pubsubType(created_type); - uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); - SerializedPayload_t payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(data, &payload)); - ASSERT_TRUE(payload.length == payloadSize); - types::DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); - ASSERT_TRUE(data2->equals(data)); - - // SERIALIZATION TEST - BoolStruct wbool; - BoolStructPubSubType wboolpb; - - SerializedPayload_t dynamic_payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); - ASSERT_TRUE(wboolpb.deserialize(&dynamic_payload, &wbool)); - - uint32_t static_payloadSize = static_cast(wboolpb.getSerializedSizeProvider(&wbool)()); - SerializedPayload_t static_payload(static_payloadSize); - ASSERT_TRUE(wboolpb.serialize(&wbool, &static_payload)); - ASSERT_TRUE(static_payload.length == static_payloadSize); - types::DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); - ASSERT_TRUE(data3->equals(data)); - - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == eprosima::fastdds::dds::RETCODE_OK); - } - ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); - ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -} - -TEST_F(DynamicTypesTests, DynamicType_enum_unit_tests) -{ - { - DynamicTypeBuilder_ptr created_builder = DynamicTypeBuilderFactory::get_instance()->create_enum_builder(); - ASSERT_TRUE(created_builder != nullptr); - - // Add three members to the enum. - ASSERT_TRUE(created_builder->add_empty_member(0, "DEFAULT") == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(created_builder->add_empty_member(1, "FIRST") == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(created_builder->add_empty_member(2, "SECOND") == eprosima::fastdds::dds::RETCODE_OK); - - // Try to add a descriptor with the same name. - ASSERT_FALSE(created_builder->add_empty_member(4, "DEFAULT") == eprosima::fastdds::dds::RETCODE_OK); - - DynamicType_ptr created_type = DynamicTypeBuilderFactory::get_instance()->create_type(created_builder.get()); - ASSERT_TRUE(created_type != nullptr); - DynamicData* data = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(data != nullptr); - - ASSERT_FALSE(data->set_int32_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - - // Try to set an invalid value. - ASSERT_FALSE(data->set_enum_value("BAD", MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - - std::string test1 = "SECOND"; - ASSERT_FALSE(data->set_enum_value(test1, 1) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(data->set_enum_value(test1, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - - std::string test2; - int iTest; - ASSERT_FALSE(data->get_int32_value(iTest, 0) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->get_enum_value(test2, 1) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(data->get_enum_value(test2, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(test1 == test2); - - // Work as uint32_t - uint32_t uTest1 = 2; - ASSERT_FALSE(data->set_enum_value(uTest1, 1) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(data->set_enum_value(uTest1, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - - uint32_t uTest2; - ASSERT_FALSE(data->get_int32_value(iTest, 0) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->get_enum_value(uTest2, 1) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(data->get_enum_value(uTest2, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(uTest1 == uTest2); - - ASSERT_FALSE(data->set_int32_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_uint32_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_int16_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_uint16_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_int64_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_uint64_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_float32_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_float64_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_float128_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_char8_value('a', MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_char16_value(L'a', MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_byte_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_bool_value(false, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_wstring_value(L"", MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - //ASSERT_FALSE(data->set_enum_value("", MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - - int32_t iTest32; - ASSERT_FALSE(data->get_int32_value(iTest32, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - uint32_t uTest32; - ASSERT_FALSE(data->get_uint32_value(uTest32, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - int16_t iTest16; - ASSERT_FALSE(data->get_int16_value(iTest16, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - uint16_t uTest16; - ASSERT_FALSE(data->get_uint16_value(uTest16, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - int64_t iTest64; - ASSERT_FALSE(data->get_int64_value(iTest64, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - uint64_t uTest64; - ASSERT_FALSE(data->get_uint64_value(uTest64, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - float fTest32; - ASSERT_FALSE(data->get_float32_value(fTest32, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - double fTest64; - ASSERT_FALSE(data->get_float64_value(fTest64, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - long double fTest128; - ASSERT_FALSE(data->get_float128_value(fTest128, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - char cTest8; - ASSERT_FALSE(data->get_char8_value(cTest8, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - wchar_t cTest16; - ASSERT_FALSE(data->get_char16_value(cTest16, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - octet oTest; - ASSERT_FALSE(data->get_byte_value(oTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - bool bTest; - ASSERT_FALSE(data->get_bool_value(bTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - std::string sTest; - ASSERT_FALSE(data->get_string_value(sTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - std::wstring wsTest; - ASSERT_FALSE(data->get_wstring_value(wsTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - //std::string sEnumTest; - //ASSERT_FALSE(data->get_enum_value(sEnumTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - - // Serialize <-> Deserialize Test - DynamicPubSubType pubsubType(created_type); - uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); - SerializedPayload_t payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(data, &payload)); - ASSERT_TRUE(payload.length == payloadSize); - types::DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); - ASSERT_TRUE(data2->equals(data)); - - // SERIALIZATION TEST - EnumStruct wenum; - EnumStructPubSubType wenumpb; - - SerializedPayload_t dynamic_payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); - ASSERT_TRUE(wenumpb.deserialize(&dynamic_payload, &wenum)); - - uint32_t static_payloadSize = static_cast(wenumpb.getSerializedSizeProvider(&wenum)()); - SerializedPayload_t static_payload(static_payloadSize); - ASSERT_TRUE(wenumpb.serialize(&wenum, &static_payload)); - ASSERT_TRUE(static_payload.length == static_payloadSize); - types::DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); - ASSERT_TRUE(data3->equals(data)); - - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == eprosima::fastdds::dds::RETCODE_OK); - } - ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); - ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -} - -TEST_F(DynamicTypesTests, DynamicType_string_unit_tests) -{ - uint32_t length = 15; - { - DynamicTypeBuilderFactory::get_instance()->create_string_type(length); - DynamicTypeBuilder_ptr created_builder = - DynamicTypeBuilderFactory::get_instance()->create_string_builder(length); - ASSERT_TRUE(created_builder != nullptr); - DynamicType_ptr created_type = DynamicTypeBuilderFactory::get_instance()->create_type(created_builder.get()); - ASSERT_TRUE(created_type != nullptr); - DynamicData* data = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(data != nullptr); - - ASSERT_FALSE(data->set_int32_value(10, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_string_value("", 1) == eprosima::fastdds::dds::RETCODE_OK); - std::string sTest1 = "STRING_TEST"; - ASSERT_TRUE(data->set_string_value(sTest1, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - - int test = 0; - ASSERT_FALSE(data->get_int32_value(test, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - std::string sTest2 = ""; - ASSERT_FALSE(data->get_string_value(sTest2, 0) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(data->get_string_value(sTest2, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(sTest1 == sTest2); - - ASSERT_FALSE(data->set_string_value("TEST_OVER_LENGTH_LIMITS", - MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - - ASSERT_FALSE(data->set_int32_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_uint32_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_int16_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_uint16_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_int64_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_uint64_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_float32_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_float64_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_float128_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_char8_value('a', MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_char16_value(L'a', MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_byte_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_bool_value(false, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - //ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_wstring_value(L"", MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_enum_value("", MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - - int32_t iTest32; - ASSERT_FALSE(data->get_int32_value(iTest32, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - uint32_t uTest32; - ASSERT_FALSE(data->get_uint32_value(uTest32, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - int16_t iTest16; - ASSERT_FALSE(data->get_int16_value(iTest16, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - uint16_t uTest16; - ASSERT_FALSE(data->get_uint16_value(uTest16, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - int64_t iTest64; - ASSERT_FALSE(data->get_int64_value(iTest64, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - uint64_t uTest64; - ASSERT_FALSE(data->get_uint64_value(uTest64, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - float fTest32; - ASSERT_FALSE(data->get_float32_value(fTest32, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - double fTest64; - ASSERT_FALSE(data->get_float64_value(fTest64, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - long double fTest128; - ASSERT_FALSE(data->get_float128_value(fTest128, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - char cTest8; - ASSERT_FALSE(data->get_char8_value(cTest8, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - wchar_t cTest16; - ASSERT_FALSE(data->get_char16_value(cTest16, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - octet oTest; - ASSERT_FALSE(data->get_byte_value(oTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - bool bTest; - ASSERT_FALSE(data->get_bool_value(bTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - //std::string sTest; - //ASSERT_FALSE(data->get_string_value(sTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - std::wstring wsTest; - ASSERT_FALSE(data->get_wstring_value(wsTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - std::string sEnumTest; - ASSERT_FALSE(data->get_enum_value(sEnumTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - - // Serialize <-> Deserialize Test - DynamicPubSubType pubsubType(created_type); - uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); - SerializedPayload_t payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(data, &payload)); - ASSERT_TRUE(payload.length == payloadSize); - types::DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); - ASSERT_TRUE(data2->equals(data)); - - // SERIALIZATION TEST - StringStruct wstring; - StringStructPubSubType wstringpb; - - SerializedPayload_t dynamic_payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); - ASSERT_TRUE(wstringpb.deserialize(&dynamic_payload, &wstring)); - - uint32_t static_payloadSize = static_cast(wstringpb.getSerializedSizeProvider(&wstring)()); - SerializedPayload_t static_payload(static_payloadSize); - ASSERT_TRUE(wstringpb.serialize(&wstring, &static_payload)); - ASSERT_TRUE(static_payload.length == static_payloadSize); - types::DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); - ASSERT_TRUE(data3->equals(data)); - - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == eprosima::fastdds::dds::RETCODE_OK); - } - ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); - ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -} - -#if FASTCDR_VERSION_MAJOR == 1 -TEST_F(DynamicTypesTests, DynamicType_wstring_unit_tests) -{ - uint32_t length = 15; - { - DynamicTypeBuilder_ptr created_builder = DynamicTypeBuilderFactory::get_instance()->create_wstring_builder( - length); - ASSERT_TRUE(created_builder != nullptr); - DynamicType_ptr created_type = DynamicTypeBuilderFactory::get_instance()->create_type(created_builder.get()); - ASSERT_TRUE(created_type != nullptr); - DynamicData* data = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(data != nullptr); - - ASSERT_FALSE(data->set_int32_value(10, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_wstring_value(L"", 1) == eprosima::fastdds::dds::RETCODE_OK); - std::wstring sTest1 = L"STRING_TEST"; - ASSERT_TRUE(data->set_wstring_value(sTest1, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - - int test = 0; - ASSERT_FALSE(data->get_int32_value(test, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - std::wstring sTest2 = L""; - ASSERT_FALSE(data->get_wstring_value(sTest2, 0) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(data->get_wstring_value(sTest2, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(sTest1 == sTest2); - - ASSERT_FALSE(data->set_wstring_value(L"TEST_OVER_LENGTH_LIMITS", - MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - - ASSERT_FALSE(data->set_int32_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_uint32_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_int16_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_uint16_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_int64_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_uint64_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_float32_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_float64_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_float128_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_char8_value('a', MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_char16_value(L'a', MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_byte_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_bool_value(false, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - //ASSERT_FALSE(data->set_wstring_value(L"", MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_enum_value("", MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - - int32_t iTest32; - ASSERT_FALSE(data->get_int32_value(iTest32, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - uint32_t uTest32; - ASSERT_FALSE(data->get_uint32_value(uTest32, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - int16_t iTest16; - ASSERT_FALSE(data->get_int16_value(iTest16, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - uint16_t uTest16; - ASSERT_FALSE(data->get_uint16_value(uTest16, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - int64_t iTest64; - ASSERT_FALSE(data->get_int64_value(iTest64, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - uint64_t uTest64; - ASSERT_FALSE(data->get_uint64_value(uTest64, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - float fTest32; - ASSERT_FALSE(data->get_float32_value(fTest32, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - double fTest64; - ASSERT_FALSE(data->get_float64_value(fTest64, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - long double fTest128; - ASSERT_FALSE(data->get_float128_value(fTest128, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - char cTest8; - ASSERT_FALSE(data->get_char8_value(cTest8, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - wchar_t cTest16; - ASSERT_FALSE(data->get_char16_value(cTest16, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - octet oTest; - ASSERT_FALSE(data->get_byte_value(oTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - bool bTest; - ASSERT_FALSE(data->get_bool_value(bTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - std::string sTest; - ASSERT_FALSE(data->get_string_value(sTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - //std::wstring wsTest; - //ASSERT_FALSE(data->get_wstring_value(wsTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - std::string sEnumTest; - ASSERT_FALSE(data->get_enum_value(sEnumTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - - // Serialize <-> Deserialize Test - DynamicPubSubType pubsubType(created_type); - uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); - SerializedPayload_t payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(data, &payload)); - ASSERT_TRUE(payload.length == payloadSize); - types::DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); - ASSERT_TRUE(data2->equals(data)); - - // SERIALIZATION TEST - WStringStruct wwstring; - WStringStructPubSubType wwstringpb; - - SerializedPayload_t dynamic_payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); - ASSERT_TRUE(wwstringpb.deserialize(&dynamic_payload, &wwstring)); - - uint32_t static_payloadSize = static_cast(wwstringpb.getSerializedSizeProvider(&wwstring)()); - SerializedPayload_t static_payload(static_payloadSize); - ASSERT_TRUE(wwstringpb.serialize(&wwstring, &static_payload)); - ASSERT_TRUE(static_payload.length == static_payloadSize); - types::DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); - ASSERT_TRUE(data3->equals(data)); - - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == eprosima::fastdds::dds::RETCODE_OK); - } - ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); - ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -} -#endif // if FASTCDR_VERSION_MAJOR == 1 - -TEST_F(DynamicTypesTests, DynamicType_alias_unit_tests) -{ - { - std::string name = "ALIAS"; - DynamicTypeBuilder_ptr base_builder = DynamicTypeBuilderFactory::get_instance()->create_uint32_builder(); - ASSERT_TRUE(base_builder != nullptr); - DynamicTypeBuilder_ptr alias_builder = DynamicTypeBuilderFactory::get_instance()->create_alias_builder( - base_builder.get(), name); - ASSERT_TRUE(alias_builder != nullptr); - DynamicType_ptr created_type = DynamicTypeBuilderFactory::get_instance()->create_type(alias_builder.get()); - ASSERT_TRUE(created_type != nullptr); - ASSERT_TRUE(created_type->get_name() == "ALIAS"); - DynamicData* aliasData = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(aliasData != nullptr); - - ASSERT_FALSE(aliasData->set_int32_value(10, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(aliasData->set_string_value("", 1) == eprosima::fastdds::dds::RETCODE_OK); - - uint32_t uTest1 = 2; - ASSERT_TRUE(aliasData->set_uint32_value(uTest1, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - - uint32_t uTest2 = 0; - ASSERT_TRUE(aliasData->get_uint32_value(uTest2, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(uTest1 == uTest2); - - // Serialize <-> Deserialize Test - DynamicPubSubType pubsubType(created_type); - uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(aliasData)()); - SerializedPayload_t payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(aliasData, &payload)); - ASSERT_TRUE(payload.length == payloadSize); - types::DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); - ASSERT_TRUE(data2->equals(aliasData)); - - // SERIALIZATION TEST - AliasStruct walias; - AliasStructPubSubType waliaspb; - - SerializedPayload_t dynamic_payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(aliasData, &dynamic_payload)); - ASSERT_TRUE(waliaspb.deserialize(&dynamic_payload, &walias)); - - uint32_t static_payloadSize = static_cast(waliaspb.getSerializedSizeProvider(&walias)()); - SerializedPayload_t static_payload(static_payloadSize); - ASSERT_TRUE(waliaspb.serialize(&walias, &static_payload)); - ASSERT_TRUE(static_payload.length == static_payloadSize); - types::DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); - ASSERT_TRUE(data3->equals(aliasData)); - - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(aliasData) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == eprosima::fastdds::dds::RETCODE_OK); - } - - ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); - ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -} - -TEST_F(DynamicTypesTests, DynamicType_multi_alias_unit_tests) -{ - { - uint32_t length = 15; - std::string name = "ALIAS"; - std::string name2 = "ALIAS2"; - DynamicTypeBuilder_ptr base_builder = DynamicTypeBuilderFactory::get_instance()->create_string_builder(length); - ASSERT_TRUE(base_builder != nullptr); - DynamicTypeBuilder_ptr base_alias_builder = DynamicTypeBuilderFactory::get_instance()->create_alias_builder( - base_builder.get(), name); - ASSERT_TRUE(base_alias_builder != nullptr); - DynamicType_ptr base_type = DynamicTypeBuilderFactory::get_instance()->create_type(base_alias_builder.get()); - ASSERT_TRUE(base_type != nullptr); - ASSERT_TRUE(base_type->get_name() == name); - DynamicTypeBuilder_ptr alias_builder = DynamicTypeBuilderFactory::get_instance()->create_alias_builder( - base_alias_builder.get(), name2); - ASSERT_TRUE(alias_builder != nullptr); - DynamicType_ptr created_type = DynamicTypeBuilderFactory::get_instance()->create_type(alias_builder.get()); - ASSERT_TRUE(created_type != nullptr); - ASSERT_TRUE(created_type->get_name() == name2); - DynamicData* aliasData = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(aliasData != nullptr); - - // Try to create an alias without base type. - DynamicTypeBuilder_ptr alias2_type_builder = DynamicTypeBuilderFactory::get_instance()->create_alias_builder( - nullptr, "ALIAS2"); - ASSERT_FALSE(alias2_type_builder != nullptr); - - ASSERT_FALSE(aliasData->set_int32_value(10, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(aliasData->set_string_value("", 1) == eprosima::fastdds::dds::RETCODE_OK); - std::string sTest1 = "STRING_TEST"; - ASSERT_TRUE(aliasData->set_string_value(sTest1, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - - int test = 0; - ASSERT_FALSE(aliasData->get_int32_value(test, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - std::string sTest2 = ""; - ASSERT_FALSE(aliasData->get_string_value(sTest2, 0) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(aliasData->get_string_value(sTest2, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(sTest1 == sTest2); - - ASSERT_FALSE(aliasData->set_string_value("TEST_OVER_LENGTH_LIMITS", - MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - - // Serialize <-> Deserialize Test - DynamicPubSubType pubsubType(created_type); - uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(aliasData)()); - SerializedPayload_t payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(aliasData, &payload)); - ASSERT_TRUE(payload.length == payloadSize); - types::DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); - ASSERT_TRUE(data2->equals(aliasData)); - - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(aliasData) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == eprosima::fastdds::dds::RETCODE_OK); - } - - ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); - ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -} - -TEST_F(DynamicTypesTests, DynamicType_bitset_unit_tests) -{ - { - DynamicTypeBuilder_ptr base_type_builder = DynamicTypeBuilderFactory::get_instance()->create_byte_builder(); - ASSERT_TRUE(base_type_builder != nullptr); - auto base_type = base_type_builder->build(); - - DynamicTypeBuilder_ptr base_type_builder2 = DynamicTypeBuilderFactory::get_instance()->create_uint32_builder(); - ASSERT_TRUE(base_type_builder2 != nullptr); - auto base_type2 = base_type_builder2->build(); - - DynamicTypeBuilder_ptr bitset_type_builder = - DynamicTypeBuilderFactory::get_instance()->create_bitset_builder(); - ASSERT_TRUE(bitset_type_builder != nullptr); - - // Add members to the struct. - ASSERT_TRUE(bitset_type_builder->add_member(0, "int2", base_type) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(bitset_type_builder->add_member(1, "int20", base_type2) == eprosima::fastdds::dds::RETCODE_OK); - bitset_type_builder->apply_annotation_to_member(0, ANNOTATION_BIT_BOUND_ID, "value", "2"); - bitset_type_builder->apply_annotation_to_member(0, ANNOTATION_POSITION_ID, "value", "0"); - bitset_type_builder->apply_annotation_to_member(1, ANNOTATION_BIT_BOUND_ID, "value", "20"); - bitset_type_builder->apply_annotation_to_member(1, ANNOTATION_POSITION_ID, "value", "10"); // 8 bits empty - - auto bitset_type = bitset_type_builder->build(); - ASSERT_TRUE(bitset_type != nullptr); - auto bitset_data = DynamicDataFactory::get_instance()->create_data(bitset_type); - ASSERT_TRUE(bitset_data != nullptr); - - ASSERT_FALSE(bitset_data->set_int32_value(10, 1) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(bitset_data->set_string_value("", MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - - // Set and get the child values. - octet test1(234); - ASSERT_TRUE(bitset_data->set_byte_value(test1, 0) == eprosima::fastdds::dds::RETCODE_OK); - octet test2(0); - ASSERT_TRUE(bitset_data->get_byte_value(test2, 0) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(test1 == test2); - // 11101010 - // 00000010 (two bits) - ASSERT_TRUE(test2 == 2); - uint32_t test3(289582314); - ASSERT_TRUE(bitset_data->set_uint32_value(test3, 1) == eprosima::fastdds::dds::RETCODE_OK); - uint32_t test4(0); - ASSERT_TRUE(bitset_data->get_uint32_value(test4, 1) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(test3 == test4); - // 00000001010000101010110011101010 - // 00000000000000101010110011101010 (20 bits) - ASSERT_TRUE(test4 == 175338); - - - - // Bitset serialization - // Tested in DynamicTypes_4_2_Tests - - // Delete the structure - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(bitset_data) == eprosima::fastdds::dds::RETCODE_OK); - - } - ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); - ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -} - -TEST_F(DynamicTypesTests, DynamicType_bitmask_unit_tests) -{ - uint32_t limit = 5; - { - DynamicTypeBuilder_ptr created_builder = - DynamicTypeBuilderFactory::get_instance()->create_bitmask_builder(limit); - ASSERT_TRUE(created_builder != nullptr); - - // Add two members to the bitmask - ASSERT_TRUE(created_builder->add_empty_member(0, "TEST") == eprosima::fastdds::dds::RETCODE_OK); - - // Try to add a descriptor with the same name - ASSERT_FALSE(created_builder->add_empty_member(1, "TEST") == eprosima::fastdds::dds::RETCODE_OK); - - ASSERT_TRUE(created_builder->add_empty_member(1, "TEST2") == eprosima::fastdds::dds::RETCODE_OK); - - ASSERT_TRUE(created_builder->add_empty_member(4, "TEST4") == eprosima::fastdds::dds::RETCODE_OK); - - ASSERT_FALSE(created_builder->add_empty_member(5, "TEST5") == eprosima::fastdds::dds::RETCODE_OK); // Out of bounds - - DynamicType_ptr created_type = DynamicTypeBuilderFactory::get_instance()->create_type(created_builder.get()); - ASSERT_TRUE(created_type != nullptr); - DynamicData* data = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(data != nullptr); - - MemberId testId = data->get_member_id_by_name("TEST"); - ASSERT_TRUE(testId != MEMBER_ID_INVALID); - MemberId test2Id = data->get_member_id_by_name("TEST2"); - ASSERT_TRUE(test2Id != MEMBER_ID_INVALID); - MemberId test4Id = data->get_member_id_by_name("TEST4"); - ASSERT_TRUE(test4Id != MEMBER_ID_INVALID); - MemberId test5Id = data->get_member_id_by_name("TEST5"); - ASSERT_TRUE(test5Id == MEMBER_ID_INVALID); - - bool test1 = true; - ASSERT_FALSE(data->set_int32_value(1, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(data->set_bool_value(test1, testId) == eprosima::fastdds::dds::RETCODE_OK); - - // Over the limit - ASSERT_FALSE(data->set_bool_value(test1, limit + 1) == eprosima::fastdds::dds::RETCODE_OK); - - bool test2 = false; - ASSERT_TRUE(data->get_bool_value(test2, 2) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(test2 == false); - ASSERT_TRUE(data->get_bool_value(test2, testId) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(test1 == test2); - ASSERT_TRUE(data->get_bool_value(test2, testId) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(test1 == test2); - bool test3 = data->get_bool_value("TEST"); - ASSERT_TRUE(test1 == test3); - ASSERT_TRUE(data->set_bool_value(true, "TEST4") == eprosima::fastdds::dds::RETCODE_OK); - bool test4 = data->get_bool_value("TEST4"); - ASSERT_TRUE(test4 == true); - - test1 = false; - ASSERT_TRUE(data->set_bool_value(test1, testId) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(data->get_bool_value(test2, test2Id) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(data->get_bool_value(test2, testId) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(test1 == test2); - data->set_bitmask_value(55); // 00110111 - uint64_t value = data->get_bitmask_value(); - ASSERT_TRUE(value == 55); - ASSERT_TRUE(data->get_bool_value("TEST")); - ASSERT_TRUE(data->get_bool_value("TEST2")); - ASSERT_TRUE(data->get_bool_value("TEST4")); - data->set_bitmask_value(37); // 00100101 - ASSERT_TRUE(data->get_bool_value("TEST")); - ASSERT_FALSE(data->get_bool_value("TEST2")); - ASSERT_FALSE(data->get_bool_value("TEST4")); - - ASSERT_FALSE(data->set_int32_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_uint32_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_int16_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_uint16_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_int64_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - //ASSERT_FALSE(data->set_uint64_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_float32_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_float64_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_float128_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_char8_value('a', MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_char16_value(L'a', MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_byte_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - //ASSERT_FALSE(data->set_bool_value(false, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_wstring_value(L"", MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_enum_value("", MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - - int32_t iTest32; - ASSERT_FALSE(data->get_int32_value(iTest32, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - uint32_t uTest32; - ASSERT_FALSE(data->get_uint32_value(uTest32, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - int16_t iTest16; - ASSERT_FALSE(data->get_int16_value(iTest16, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - uint16_t uTest16; - ASSERT_FALSE(data->get_uint16_value(uTest16, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - int64_t iTest64; - ASSERT_FALSE(data->get_int64_value(iTest64, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - //uint64_t uTest64; - //ASSERT_FALSE(data->get_uint64_value(uTest64, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - float fTest32; - ASSERT_FALSE(data->get_float32_value(fTest32, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - double fTest64; - ASSERT_FALSE(data->get_float64_value(fTest64, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - long double fTest128; - ASSERT_FALSE(data->get_float128_value(fTest128, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - char cTest8; - ASSERT_FALSE(data->get_char8_value(cTest8, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - wchar_t cTest16; - ASSERT_FALSE(data->get_char16_value(cTest16, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - octet oTest; - ASSERT_FALSE(data->get_byte_value(oTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - bool bTest; - ASSERT_FALSE(data->get_bool_value(bTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - std::string sTest; - ASSERT_FALSE(data->get_string_value(sTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - std::wstring wsTest; - ASSERT_FALSE(data->get_wstring_value(wsTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - std::string sEnumTest; - ASSERT_FALSE(data->get_enum_value(sEnumTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - - // Serialize <-> Deserialize Test - ASSERT_TRUE(data->set_bool_value(true, 0) == eprosima::fastdds::dds::RETCODE_OK); - DynamicPubSubType pubsubType(created_type); - uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); - SerializedPayload_t payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(data, &payload)); - ASSERT_TRUE(payload.length == payloadSize); - - types::DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); - ASSERT_TRUE(data2->equals(data)); - - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == eprosima::fastdds::dds::RETCODE_OK); - } - ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); - ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -} - -TEST_F(DynamicTypesTests, DynamicType_sequence_unit_tests) -{ - uint32_t length = 2; - { - // Then - DynamicTypeBuilder_ptr base_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); - ASSERT_TRUE(base_type_builder != nullptr); - DynamicTypeBuilder_ptr seq_type_builder = DynamicTypeBuilderFactory::get_instance()->create_sequence_builder( - base_type_builder.get(), length); - ASSERT_TRUE(seq_type_builder != nullptr); - auto seq_type = seq_type_builder->build(); - ASSERT_TRUE(seq_type != nullptr); - - auto data = DynamicDataFactory::get_instance()->create_data(seq_type); - ASSERT_FALSE(data->set_int32_value(10, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - - // Try to write on an empty position - ASSERT_FALSE(data->set_int32_value(234, 1) == eprosima::fastdds::dds::RETCODE_OK); - - MemberId newId; - ASSERT_TRUE(data->insert_sequence_data(newId) == eprosima::fastdds::dds::RETCODE_OK); - MemberId newId2; - ASSERT_TRUE(data->insert_sequence_data(newId2) == eprosima::fastdds::dds::RETCODE_OK); - - // Try to insert more than the limit. - MemberId newId3; - ASSERT_FALSE(data->insert_sequence_data(newId3) == eprosima::fastdds::dds::RETCODE_OK); - - // Set and get a value. - int32_t test1(234); - ASSERT_TRUE(data->set_int32_value(test1, newId2) == eprosima::fastdds::dds::RETCODE_OK); - int32_t test2(0); - ASSERT_TRUE(data->get_int32_value(test2, newId2) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(test1 == test2); - - // Serialize <-> Deserialize Test - DynamicPubSubType pubsubType(seq_type); - uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); - SerializedPayload_t payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(data, &payload)); - ASSERT_TRUE(payload.length == payloadSize); - - types::DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(seq_type); - ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); - ASSERT_TRUE(data2->equals(data)); - - // Remove the elements. - ASSERT_TRUE(data->remove_sequence_data(newId) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(data->clear_all_values() == eprosima::fastdds::dds::RETCODE_OK); - - // New Insert Methods - ASSERT_TRUE(data->insert_int32_value(test1, newId) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(data->get_int32_value(test2, newId) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(test1 == test2); - ASSERT_TRUE(data->clear_all_values() == eprosima::fastdds::dds::RETCODE_OK); - - // Check that the sequence is empty. - ASSERT_FALSE(data->get_int32_value(test2, 0) == eprosima::fastdds::dds::RETCODE_OK); - - ASSERT_FALSE(data->set_int32_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_uint32_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_int16_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_uint16_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_int64_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_uint64_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_float32_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_float64_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_float128_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_char8_value('a', MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_char16_value(L'a', MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_byte_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_bool_value(false, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_wstring_value(L"", MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_enum_value("", MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - - int32_t iTest32; - ASSERT_FALSE(data->get_int32_value(iTest32, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - uint32_t uTest32; - ASSERT_FALSE(data->get_uint32_value(uTest32, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - int16_t iTest16; - ASSERT_FALSE(data->get_int16_value(iTest16, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - uint16_t uTest16; - ASSERT_FALSE(data->get_uint16_value(uTest16, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - int64_t iTest64; - ASSERT_FALSE(data->get_int64_value(iTest64, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - uint64_t uTest64; - ASSERT_FALSE(data->get_uint64_value(uTest64, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - float fTest32; - ASSERT_FALSE(data->get_float32_value(fTest32, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - double fTest64; - ASSERT_FALSE(data->get_float64_value(fTest64, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - long double fTest128; - ASSERT_FALSE(data->get_float128_value(fTest128, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - char cTest8; - ASSERT_FALSE(data->get_char8_value(cTest8, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - wchar_t cTest16; - ASSERT_FALSE(data->get_char16_value(cTest16, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - octet oTest; - ASSERT_FALSE(data->get_byte_value(oTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - bool bTest; - ASSERT_FALSE(data->get_bool_value(bTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - std::string sTest; - ASSERT_FALSE(data->get_string_value(sTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - std::wstring wsTest; - ASSERT_FALSE(data->get_wstring_value(wsTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - std::string sEnumTest; - ASSERT_FALSE(data->get_enum_value(sEnumTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - - - // SERIALIZATION TEST - SequenceStruct seq; - SequenceStructPubSubType seqpb; - - SerializedPayload_t dynamic_payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); - ASSERT_TRUE(seqpb.deserialize(&dynamic_payload, &seq)); - - uint32_t static_payloadSize = static_cast(seqpb.getSerializedSizeProvider(&seq)()); - SerializedPayload_t static_payload(static_payloadSize); - ASSERT_TRUE(seqpb.serialize(&seq, &static_payload)); - ASSERT_TRUE(static_payload.length == static_payloadSize); - types::DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(seq_type); - ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); - ASSERT_TRUE(data3->equals(data)); - - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == eprosima::fastdds::dds::RETCODE_OK); - } - ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); - ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -} - -TEST_F(DynamicTypesTests, DynamicType_sequence_of_sequences_unit_tests) -{ - uint32_t sequence_length = 2; - uint32_t sup_sequence_length = 3; - { - // Then - DynamicTypeBuilder_ptr base_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); - ASSERT_TRUE(base_type_builder != nullptr); - - DynamicTypeBuilder_ptr seq_type_builder = DynamicTypeBuilderFactory::get_instance()->create_sequence_builder( - base_type_builder.get(), sequence_length); - ASSERT_TRUE(seq_type_builder != nullptr); - auto seq_type = seq_type_builder->build(); - ASSERT_TRUE(seq_type != nullptr); - - DynamicTypeBuilder_ptr seq_seq_type_builder = - DynamicTypeBuilderFactory::get_instance()->create_sequence_builder( - seq_type_builder.get(), sup_sequence_length); - ASSERT_TRUE(seq_seq_type_builder != nullptr); - auto seq_seq_type = seq_seq_type_builder->build(); - ASSERT_TRUE(seq_seq_type != nullptr); - - auto data = DynamicDataFactory::get_instance()->create_data(seq_seq_type); - ASSERT_FALSE(data->set_int32_value(10, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - - MemberId newId; - ASSERT_TRUE(data->insert_sequence_data(newId) == eprosima::fastdds::dds::RETCODE_OK); - MemberId newId2; - ASSERT_TRUE(data->insert_sequence_data(newId2) == eprosima::fastdds::dds::RETCODE_OK); - - // Loan Value to modify the first sequence - auto seq_data = data->loan_value(newId); - ASSERT_TRUE(seq_data != nullptr); - - MemberId newSeqId; - ASSERT_TRUE(seq_data->insert_sequence_data(newSeqId) == eprosima::fastdds::dds::RETCODE_OK); - - // Set and get a value. - int32_t test1(234); - ASSERT_TRUE(seq_data->set_int32_value(test1, newSeqId) == eprosima::fastdds::dds::RETCODE_OK); - int32_t test2(0); - ASSERT_TRUE(seq_data->get_int32_value(test2, newSeqId) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(test1 == test2); - - // Return the pointer of the sequence - ASSERT_TRUE(data->return_loaned_value(seq_data) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->return_loaned_value(seq_data) == eprosima::fastdds::dds::RETCODE_OK); - - // Serialize <-> Deserialize Test - DynamicPubSubType pubsubType(seq_seq_type); - uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); - SerializedPayload_t payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(data, &payload)); - ASSERT_TRUE(payload.length == payloadSize); - - types::DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(seq_seq_type); - ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); - ASSERT_TRUE(data2->equals(data)); - - // Remove the elements. - ASSERT_TRUE(data->remove_sequence_data(newId) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(data->clear_all_values() == eprosima::fastdds::dds::RETCODE_OK); - - // Check that the sequence is empty. - ASSERT_FALSE(data->get_int32_value(test2, 0) == eprosima::fastdds::dds::RETCODE_OK); - - ASSERT_FALSE(data->set_int32_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_uint32_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_int16_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_uint16_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_int64_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_uint64_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_float32_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_float64_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_float128_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_char8_value('a', MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_char16_value(L'a', MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_byte_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_bool_value(false, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_wstring_value(L"", MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_enum_value("", MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - - int32_t iTest32; - ASSERT_FALSE(data->get_int32_value(iTest32, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - uint32_t uTest32; - ASSERT_FALSE(data->get_uint32_value(uTest32, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - int16_t iTest16; - ASSERT_FALSE(data->get_int16_value(iTest16, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - uint16_t uTest16; - ASSERT_FALSE(data->get_uint16_value(uTest16, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - int64_t iTest64; - ASSERT_FALSE(data->get_int64_value(iTest64, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - uint64_t uTest64; - ASSERT_FALSE(data->get_uint64_value(uTest64, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - float fTest32; - ASSERT_FALSE(data->get_float32_value(fTest32, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - double fTest64; - ASSERT_FALSE(data->get_float64_value(fTest64, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - long double fTest128; - ASSERT_FALSE(data->get_float128_value(fTest128, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - char cTest8; - ASSERT_FALSE(data->get_char8_value(cTest8, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - wchar_t cTest16; - ASSERT_FALSE(data->get_char16_value(cTest16, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - octet oTest; - ASSERT_FALSE(data->get_byte_value(oTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - bool bTest; - ASSERT_FALSE(data->get_bool_value(bTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - std::string sTest; - ASSERT_FALSE(data->get_string_value(sTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - std::wstring wsTest; - ASSERT_FALSE(data->get_wstring_value(wsTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - std::string sEnumTest; - ASSERT_FALSE(data->get_enum_value(sEnumTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - - // SERIALIZATION TEST - SequenceSequenceStruct seq; - SequenceSequenceStructPubSubType seqpb; - - SerializedPayload_t dynamic_payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); - ASSERT_TRUE(seqpb.deserialize(&dynamic_payload, &seq)); - - uint32_t static_payloadSize = static_cast(seqpb.getSerializedSizeProvider(&seq)()); - SerializedPayload_t static_payload(static_payloadSize); - ASSERT_TRUE(seqpb.serialize(&seq, &static_payload)); - ASSERT_TRUE(static_payload.length == static_payloadSize); - types::DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(seq_type); - ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); - ASSERT_TRUE(data3->equals(data)); - - // New Insert Methods - ASSERT_TRUE(data->clear_all_values() == eprosima::fastdds::dds::RETCODE_OK); - seq_data = DynamicDataFactory::get_instance()->create_data(seq_type); - ASSERT_TRUE(seq_data->insert_int32_value(test1, newSeqId) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(seq_data->get_int32_value(test2, newSeqId) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(test1 == test2); - ASSERT_TRUE(data->insert_complex_value(seq_data, newId) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(data->clear_all_values() == eprosima::fastdds::dds::RETCODE_OK); - - - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == eprosima::fastdds::dds::RETCODE_OK); - } - - ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); - ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -} - -TEST_F(DynamicTypesTests, DynamicType_array_unit_tests) -{ - std::vector sequence_lengths = { 2, 2, 2 }; - { - // Then - DynamicTypeBuilder_ptr base_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); - ASSERT_TRUE(base_type_builder != nullptr); - auto base_type = base_type_builder->build(); - - DynamicTypeBuilder_ptr array_type_builder = DynamicTypeBuilderFactory::get_instance()->create_array_builder( - base_type_builder.get(), sequence_lengths); - ASSERT_TRUE(array_type_builder != nullptr); - auto array_type = array_type_builder->build(); - ASSERT_TRUE(array_type != nullptr); - - auto data = DynamicDataFactory::get_instance()->create_data(array_type); - ASSERT_FALSE(data->set_int32_value(10, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - - MemberId newId; - ASSERT_FALSE(data->insert_sequence_data(newId) == eprosima::fastdds::dds::RETCODE_OK); - - // Get an index in the multidimensional array. - std::vector vPosition = { 1, 1, 1 }; - MemberId testPos(0); - testPos = data->get_array_index(vPosition); - ASSERT_TRUE(testPos != MEMBER_ID_INVALID); - - // Invalid input vectors. - std::vector vPosition2 = { 1, 1 }; - ASSERT_FALSE(data->get_array_index(vPosition2) != MEMBER_ID_INVALID); - std::vector vPosition3 = { 1, 1, 1, 1 }; - ASSERT_FALSE(data->get_array_index(vPosition3) != MEMBER_ID_INVALID); - - // Set and get a value. - int32_t test1 = 156; - ASSERT_TRUE(data->set_int32_value(test1, testPos) == eprosima::fastdds::dds::RETCODE_OK); - int32_t test2(0); - ASSERT_TRUE(data->get_int32_value(test2, testPos) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(test1 == test2); - - // Serialize <-> Deserialize Test - DynamicPubSubType pubsubType(array_type); - uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); - SerializedPayload_t payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(data, &payload)); - ASSERT_TRUE(payload.length == payloadSize); - - types::DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(array_type); - ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); - ASSERT_TRUE(data2->equals(data)); - - // Check items count before and after remove an element. - ASSERT_TRUE(data->get_item_count() == array_type->get_total_bounds()); - ASSERT_TRUE(data->clear_value(testPos) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(data->get_item_count() == array_type->get_total_bounds()); - ASSERT_TRUE(data->clear_array_data(testPos) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(data->get_item_count() == array_type->get_total_bounds()); - - // Check the clear values method - ASSERT_TRUE(data->set_int32_value(test1, testPos) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(data->get_item_count() == array_type->get_total_bounds()); - ASSERT_TRUE(data->clear_all_values() == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(data->get_item_count() == array_type->get_total_bounds()); - - // Try to set a value out of the array. - ASSERT_FALSE(data->set_int32_value(test1, 100) == eprosima::fastdds::dds::RETCODE_OK); - - ASSERT_FALSE(data->set_int32_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_uint32_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_int16_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_uint16_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_int64_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_uint64_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_float32_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_float64_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_float128_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_char8_value('a', MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_char16_value(L'a', MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_byte_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_bool_value(false, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_wstring_value(L"", MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_enum_value("", MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - - int32_t iTest32; - ASSERT_FALSE(data->get_int32_value(iTest32, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - uint32_t uTest32; - ASSERT_FALSE(data->get_uint32_value(uTest32, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - int16_t iTest16; - ASSERT_FALSE(data->get_int16_value(iTest16, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - uint16_t uTest16; - ASSERT_FALSE(data->get_uint16_value(uTest16, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - int64_t iTest64; - ASSERT_FALSE(data->get_int64_value(iTest64, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - uint64_t uTest64; - ASSERT_FALSE(data->get_uint64_value(uTest64, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - float fTest32; - ASSERT_FALSE(data->get_float32_value(fTest32, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - double fTest64; - ASSERT_FALSE(data->get_float64_value(fTest64, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - long double fTest128; - ASSERT_FALSE(data->get_float128_value(fTest128, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - char cTest8; - ASSERT_FALSE(data->get_char8_value(cTest8, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - wchar_t cTest16; - ASSERT_FALSE(data->get_char16_value(cTest16, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - octet oTest; - ASSERT_FALSE(data->get_byte_value(oTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - bool bTest; - ASSERT_FALSE(data->get_bool_value(bTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - std::string sTest; - ASSERT_FALSE(data->get_string_value(sTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - std::wstring wsTest; - ASSERT_FALSE(data->get_wstring_value(wsTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - std::string sEnumTest; - ASSERT_FALSE(data->get_enum_value(sEnumTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - - // SERIALIZATION TEST - ArraytStruct seq; - ArraytStructPubSubType seqpb; - - SerializedPayload_t dynamic_payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); - ASSERT_TRUE(seqpb.deserialize(&dynamic_payload, &seq)); - - uint32_t static_payloadSize = static_cast(seqpb.getSerializedSizeProvider(&seq)()); - SerializedPayload_t static_payload(static_payloadSize); - ASSERT_TRUE(seqpb.serialize(&seq, &static_payload)); - ASSERT_TRUE(static_payload.length == static_payloadSize); - types::DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(array_type); - ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); - ASSERT_TRUE(data3->equals(data)); - - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == eprosima::fastdds::dds::RETCODE_OK); - } - ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); - ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -} - -TEST_F(DynamicTypesTests, DynamicType_array_of_arrays_unit_tests) -{ - std::vector sequence_lengths = { 2, 2 }; - { - DynamicTypeBuilder_ptr base_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); - ASSERT_TRUE(base_type_builder != nullptr); - auto base_type = base_type_builder->build(); - - DynamicTypeBuilder_ptr array_type_builder = DynamicTypeBuilderFactory::get_instance()->create_array_builder( - base_type_builder.get(), sequence_lengths); - ASSERT_TRUE(array_type_builder != nullptr); - auto array_type = array_type_builder->build(); - ASSERT_TRUE(array_type != nullptr); - - DynamicTypeBuilder_ptr parent_array_type_builder = - DynamicTypeBuilderFactory::get_instance()->create_array_builder( - array_type_builder.get(), sequence_lengths); - ASSERT_TRUE(parent_array_type_builder != nullptr); - auto parent_array_type = parent_array_type_builder->build(); - ASSERT_TRUE(parent_array_type != nullptr); - - auto data = DynamicDataFactory::get_instance()->create_data(parent_array_type); - ASSERT_FALSE(data->set_int32_value(10, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - - MemberId newId; - ASSERT_FALSE(data->insert_sequence_data(newId) == eprosima::fastdds::dds::RETCODE_OK); - - // Get an index in the multidimensional array. - std::vector vPosition = { 1, 1 }; - MemberId testPos(0); - testPos = data->get_array_index(vPosition); - ASSERT_TRUE(testPos != MEMBER_ID_INVALID); - - // Invalid input vectors. - std::vector vPosition2 = { 1, 1, 1 }; - ASSERT_FALSE(data->get_array_index(vPosition2) != MEMBER_ID_INVALID); - std::vector vPosition3 = { 1, 1, 1, 1 }; - ASSERT_FALSE(data->get_array_index(vPosition3) != MEMBER_ID_INVALID); - - // Loan Complex values. - DynamicData* temp = data->loan_value(testPos); - ASSERT_TRUE(temp != nullptr); - DynamicData* temp2 = data->loan_value(testPos); - ASSERT_FALSE(temp2 != nullptr); - - int32_t test1 = 156; - ASSERT_TRUE(temp->set_int32_value(test1, testPos) == eprosima::fastdds::dds::RETCODE_OK); - int32_t test2(0); - ASSERT_TRUE(temp->get_int32_value(test2, testPos) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(test1 == test2); - - ASSERT_TRUE(data->return_loaned_value(temp) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->return_loaned_value(temp) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->return_loaned_value(temp2) == eprosima::fastdds::dds::RETCODE_OK); - - // Serialize <-> Deserialize Test - DynamicPubSubType pubsubType(parent_array_type); - uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); - SerializedPayload_t payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(data, &payload)); - ASSERT_TRUE(payload.length == payloadSize); - - types::DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(parent_array_type); - ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); - ASSERT_TRUE(data2->equals(data)); - - // Check items count before and after remove an element. - ASSERT_TRUE(data->get_item_count() == parent_array_type->get_total_bounds()); - ASSERT_TRUE(data->clear_value(testPos) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(data->get_item_count() == parent_array_type->get_total_bounds()); - ASSERT_TRUE(data->clear_array_data(testPos) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(data->get_item_count() == parent_array_type->get_total_bounds()); - - // Try to set a value out of the array. - ASSERT_FALSE(data->set_int32_value(test1, 100) == eprosima::fastdds::dds::RETCODE_OK); - - ASSERT_FALSE(data->set_int32_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_uint32_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_int16_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_uint16_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_int64_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_uint64_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_float32_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_float64_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_float128_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_char8_value('a', MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_char16_value(L'a', MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_byte_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_bool_value(false, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_wstring_value(L"", MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_enum_value("", MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - - int32_t iTest32; - ASSERT_FALSE(data->get_int32_value(iTest32, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - uint32_t uTest32; - ASSERT_FALSE(data->get_uint32_value(uTest32, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - int16_t iTest16; - ASSERT_FALSE(data->get_int16_value(iTest16, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - uint16_t uTest16; - ASSERT_FALSE(data->get_uint16_value(uTest16, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - int64_t iTest64; - ASSERT_FALSE(data->get_int64_value(iTest64, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - uint64_t uTest64; - ASSERT_FALSE(data->get_uint64_value(uTest64, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - float fTest32; - ASSERT_FALSE(data->get_float32_value(fTest32, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - double fTest64; - ASSERT_FALSE(data->get_float64_value(fTest64, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - long double fTest128; - ASSERT_FALSE(data->get_float128_value(fTest128, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - char cTest8; - ASSERT_FALSE(data->get_char8_value(cTest8, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - wchar_t cTest16; - ASSERT_FALSE(data->get_char16_value(cTest16, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - octet oTest; - ASSERT_FALSE(data->get_byte_value(oTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - bool bTest; - ASSERT_FALSE(data->get_bool_value(bTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - std::string sTest; - ASSERT_FALSE(data->get_string_value(sTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - std::wstring wsTest; - ASSERT_FALSE(data->get_wstring_value(wsTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - std::string sEnumTest; - ASSERT_FALSE(data->get_enum_value(sEnumTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - - // SERIALIZATION TEST - ArrayArrayStruct seq; - ArrayArrayStructPubSubType seqpb; - - SerializedPayload_t dynamic_payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); - ASSERT_TRUE(seqpb.deserialize(&dynamic_payload, &seq)); - - uint32_t static_payloadSize = static_cast(seqpb.getSerializedSizeProvider(&seq)()); - SerializedPayload_t static_payload(static_payloadSize); - ASSERT_TRUE(seqpb.serialize(&seq, &static_payload)); - ASSERT_TRUE(static_payload.length == static_payloadSize); - types::DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(array_type); - ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); - ASSERT_TRUE(data3->equals(data)); - - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == eprosima::fastdds::dds::RETCODE_OK); - } - ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); - ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -} - -TEST_F(DynamicTypesTests, DynamicType_map_unit_tests) -{ - uint32_t map_length = 2; - { - // Then - DynamicTypeBuilder_ptr base_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); - ASSERT_TRUE(base_type_builder != nullptr); - auto base_type = base_type_builder->build(); - - DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder( - base_type_builder.get(), base_type_builder.get(), map_length); - ASSERT_TRUE(map_type_builder != nullptr); - auto map_type = map_type_builder->build(); - ASSERT_TRUE(map_type != nullptr); - - DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); - - ASSERT_FALSE(data->set_int32_value(10, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - - // Try to write on an empty position - ASSERT_FALSE(data->set_int32_value(234, 0) == eprosima::fastdds::dds::RETCODE_OK); - - MemberId keyId; - MemberId valueId; - auto key_data = DynamicDataFactory::get_instance()->create_data(base_type); - ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == eprosima::fastdds::dds::RETCODE_OK); - - // Try to Add the same key twice. - ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == eprosima::fastdds::dds::RETCODE_OK); - - MemberId keyId2; - MemberId valueId2; - key_data = DynamicDataFactory::get_instance()->create_data(base_type); - key_data->set_int32_value(2, MEMBER_ID_INVALID); - ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == eprosima::fastdds::dds::RETCODE_OK); - - // Try to Add one more than the limit - auto key_data2 = DynamicDataFactory::get_instance()->create_data(base_type); - key_data2->set_int32_value(3, MEMBER_ID_INVALID); - ASSERT_FALSE(data->insert_map_data(key_data2, keyId, valueId) == eprosima::fastdds::dds::RETCODE_OK); - - // Set and get a value. - int32_t test1(234); - ASSERT_TRUE(data->set_int32_value(test1, valueId) == eprosima::fastdds::dds::RETCODE_OK); - int32_t test2(0); - ASSERT_TRUE(data->get_int32_value(test2, valueId) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(test1 == test2); - - // Serialize <-> Deserialize Test - DynamicPubSubType pubsubType(map_type); - uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); - SerializedPayload_t payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(data, &payload)); - ASSERT_TRUE(payload.length == payloadSize); - - types::DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); - ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); - ASSERT_TRUE(data2->equals(data)); - - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == eprosima::fastdds::dds::RETCODE_OK); - - // Check items count with removes - ASSERT_TRUE(data->get_item_count() == 2); - ASSERT_FALSE(data->remove_map_data(valueId) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(data->get_item_count() == 2); - ASSERT_TRUE(data->remove_map_data(keyId) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(data->get_item_count() == 1); - ASSERT_TRUE(data->clear_all_values() == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(data->get_item_count() == 0); - - ASSERT_FALSE(data->set_int32_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_uint32_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_int16_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_uint16_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_int64_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_uint64_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_float32_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_float64_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_float128_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_char8_value('a', MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_char16_value(L'a', MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_byte_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_bool_value(false, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_wstring_value(L"", MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_enum_value("", MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - - int32_t iTest32; - ASSERT_FALSE(data->get_int32_value(iTest32, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - uint32_t uTest32; - ASSERT_FALSE(data->get_uint32_value(uTest32, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - int16_t iTest16; - ASSERT_FALSE(data->get_int16_value(iTest16, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - uint16_t uTest16; - ASSERT_FALSE(data->get_uint16_value(uTest16, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - int64_t iTest64; - ASSERT_FALSE(data->get_int64_value(iTest64, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - uint64_t uTest64; - ASSERT_FALSE(data->get_uint64_value(uTest64, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - float fTest32; - ASSERT_FALSE(data->get_float32_value(fTest32, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - double fTest64; - ASSERT_FALSE(data->get_float64_value(fTest64, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - long double fTest128; - ASSERT_FALSE(data->get_float128_value(fTest128, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - char cTest8; - ASSERT_FALSE(data->get_char8_value(cTest8, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - wchar_t cTest16; - ASSERT_FALSE(data->get_char16_value(cTest16, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - octet oTest; - ASSERT_FALSE(data->get_byte_value(oTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - bool bTest; - ASSERT_FALSE(data->get_bool_value(bTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - std::string sTest; - ASSERT_FALSE(data->get_string_value(sTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - std::wstring wsTest; - ASSERT_FALSE(data->get_wstring_value(wsTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - std::string sEnumTest; - ASSERT_FALSE(data->get_enum_value(sEnumTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - - //// SERIALIZATION TEST - //MapStruct seq; - //MapStructPubSubType seqpb; - - //uint32_t payloadSize3 = static_cast(pubsubType.getSerializedSizeProvider(data)()); - //SerializedPayload_t dynamic_payload(payloadSize3); - //ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); - //ASSERT_TRUE(dynamic_payload.length == payloadSize3); - //ASSERT_TRUE(seqpb.deserialize(&dynamic_payload, &seq)); - - //uint32_t static_payloadSize = static_cast(seqpb.getSerializedSizeProvider(&seq)()); - //SerializedPayload_t static_payload(static_payloadSize); - //ASSERT_TRUE(seqpb.serialize(&seq, &static_payload)); - //ASSERT_TRUE(static_payload.length == static_payloadSize); - //types::DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); - //ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); - //ASSERT_TRUE(data3->equals(data)); - - //ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == eprosima::fastdds::dds::RETCODE_OK); - //ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == eprosima::fastdds::dds::RETCODE_OK); - //ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == eprosima::fastdds::dds::RETCODE_OK); - - // Delete the map - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data2) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == eprosima::fastdds::dds::RETCODE_OK); - } - ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); - ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -} - -TEST_F(DynamicTypesTests, DynamicType_map_of_maps_unit_tests) -{ - uint32_t map_length = 2; - { - // Then - DynamicTypeBuilder_ptr base_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); - ASSERT_TRUE(base_type_builder != nullptr); - auto base_type = base_type_builder->build(); - - DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder( - base_type_builder.get(), base_type_builder.get(), map_length); - ASSERT_TRUE(map_type_builder != nullptr); - auto map_type = map_type_builder->build(); - ASSERT_TRUE(map_type != nullptr); - - DynamicTypeBuilder_ptr map_map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder( - base_type_builder.get(), map_type_builder.get(), map_length); - ASSERT_TRUE(map_map_type_builder != nullptr); - auto map_map_type = map_map_type_builder->build(); - ASSERT_TRUE(map_map_type != nullptr); - - DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_map_type); - - ASSERT_FALSE(data->set_int32_value(10, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - - MemberId keyId; - MemberId valueId; - auto key_data = DynamicDataFactory::get_instance()->create_data(base_type); - ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == eprosima::fastdds::dds::RETCODE_OK); - - // Try to Add the same key twice. - ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == eprosima::fastdds::dds::RETCODE_OK); - - MemberId keyId2; - MemberId valueId2; - key_data = DynamicDataFactory::get_instance()->create_data(base_type); - key_data->set_int32_value(2, MEMBER_ID_INVALID); - ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == eprosima::fastdds::dds::RETCODE_OK); - - // Try to Add one more than the limit - auto key_data2 = DynamicDataFactory::get_instance()->create_data(base_type); - key_data2->set_int32_value(3, MEMBER_ID_INVALID); - ASSERT_FALSE(data->insert_map_data(key_data2, keyId, valueId) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data2) == eprosima::fastdds::dds::RETCODE_OK); - - auto seq_data = data->loan_value(valueId); - ASSERT_TRUE(seq_data != nullptr); - - auto key_data3 = DynamicDataFactory::get_instance()->create_data(base_type); - ASSERT_TRUE(seq_data->insert_map_data(key_data3, keyId, valueId) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data3) == eprosima::fastdds::dds::RETCODE_OK); - - // Set and get a value. - int32_t test1(234); - ASSERT_TRUE(seq_data->set_int32_value(test1, valueId) == eprosima::fastdds::dds::RETCODE_OK); - int32_t test2(0); - ASSERT_TRUE(seq_data->get_int32_value(test2, valueId) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(test1 == test2); - - ASSERT_TRUE(data->return_loaned_value(seq_data) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->return_loaned_value(seq_data) == eprosima::fastdds::dds::RETCODE_OK); - - ASSERT_FALSE(data->set_int32_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_uint32_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_int16_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_uint16_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_int64_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_uint64_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_float32_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_float64_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_float128_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_char8_value('a', MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_char16_value(L'a', MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_byte_value(0, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_bool_value(false, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_wstring_value(L"", MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(data->set_enum_value("", MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - - int32_t iTest32; - ASSERT_FALSE(data->get_int32_value(iTest32, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - uint32_t uTest32; - ASSERT_FALSE(data->get_uint32_value(uTest32, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - int16_t iTest16; - ASSERT_FALSE(data->get_int16_value(iTest16, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - uint16_t uTest16; - ASSERT_FALSE(data->get_uint16_value(uTest16, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - int64_t iTest64; - ASSERT_FALSE(data->get_int64_value(iTest64, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - uint64_t uTest64; - ASSERT_FALSE(data->get_uint64_value(uTest64, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - float fTest32; - ASSERT_FALSE(data->get_float32_value(fTest32, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - double fTest64; - ASSERT_FALSE(data->get_float64_value(fTest64, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - long double fTest128; - ASSERT_FALSE(data->get_float128_value(fTest128, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - char cTest8; - ASSERT_FALSE(data->get_char8_value(cTest8, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - wchar_t cTest16; - ASSERT_FALSE(data->get_char16_value(cTest16, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - octet oTest; - ASSERT_FALSE(data->get_byte_value(oTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - bool bTest; - ASSERT_FALSE(data->get_bool_value(bTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - std::string sTest; - ASSERT_FALSE(data->get_string_value(sTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - std::wstring wsTest; - ASSERT_FALSE(data->get_wstring_value(wsTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - std::string sEnumTest; - ASSERT_FALSE(data->get_enum_value(sEnumTest, MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - - // Serialize <-> Deserialize Test - DynamicPubSubType pubsubType(map_map_type); - uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); - SerializedPayload_t payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(data, &payload)); - ASSERT_TRUE(payload.length == payloadSize); - - types::DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_map_type); - ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); - ASSERT_TRUE(data2->equals(data)); - - //// SERIALIZATION TEST - //MapMapStruct seq; - //MapMapStructPubSubType seqpb; - - //uint32_t payloadSize3 = static_cast(pubsubType.getSerializedSizeProvider(data)()); - //SerializedPayload_t dynamic_payload(payloadSize3); - //ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); - //ASSERT_TRUE(dynamic_payload.length == payloadSize3); - //ASSERT_TRUE(seqpb.deserialize(&dynamic_payload, &seq)); - - //uint32_t static_payloadSize = static_cast(seqpb.getSerializedSizeProvider(&seq)()); - //SerializedPayload_t static_payload(static_payloadSize); - //ASSERT_TRUE(seqpb.serialize(&seq, &static_payload)); - //ASSERT_TRUE(static_payload.length == static_payloadSize); - //types::DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_map_type); - //ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); - //ASSERT_TRUE(data3->equals(data)); - - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == eprosima::fastdds::dds::RETCODE_OK); - //ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == eprosima::fastdds::dds::RETCODE_OK); - } - ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); - ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -} - -TEST_F(DynamicTypesTests, DynamicType_structure_unit_tests) -{ - { - DynamicTypeBuilder_ptr base_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); - ASSERT_TRUE(base_type_builder != nullptr); - auto base_type = base_type_builder->build(); - - DynamicTypeBuilder_ptr base_type_builder2 = DynamicTypeBuilderFactory::get_instance()->create_int64_builder(); - ASSERT_TRUE(base_type_builder2 != nullptr); - auto base_type2 = base_type_builder2->build(); - - DynamicTypeBuilder_ptr struct_type_builder = DynamicTypeBuilderFactory::get_instance()->create_struct_builder(); - ASSERT_TRUE(struct_type_builder != nullptr); - - // Add members to the struct. - ASSERT_TRUE(struct_type_builder->add_member(0, "int32", base_type) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(struct_type_builder->add_member(1, "int64", base_type2) == eprosima::fastdds::dds::RETCODE_OK); - - auto struct_type = struct_type_builder->build(); - ASSERT_TRUE(struct_type != nullptr); - auto struct_data = DynamicDataFactory::get_instance()->create_data(struct_type); - ASSERT_TRUE(struct_data != nullptr); - - ASSERT_FALSE(struct_data->set_int32_value(10, 1) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(struct_data->set_string_value("", MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - - // Set and get the child values. - int32_t test1(234); - ASSERT_TRUE(struct_data->set_int32_value(test1, 0) == eprosima::fastdds::dds::RETCODE_OK); - int32_t test2(0); - ASSERT_TRUE(struct_data->get_int32_value(test2, 0) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(test1 == test2); - int64_t test3(234); - ASSERT_TRUE(struct_data->set_int64_value(test3, 1) == eprosima::fastdds::dds::RETCODE_OK); - int64_t test4(0); - ASSERT_TRUE(struct_data->get_int64_value(test4, 1) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(test3 == test4); - - // Serialize <-> Deserialize Test - DynamicPubSubType pubsubType(struct_type); - uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(struct_data)()); - SerializedPayload_t payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(struct_data, &payload)); - ASSERT_TRUE(payload.length == payloadSize); - - types::DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(struct_type); - ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); - ASSERT_TRUE(data2->equals(struct_data)); - - // SERIALIZATION TEST - StructStruct seq; - StructStructPubSubType seqpb; - - uint32_t payloadSize3 = static_cast(pubsubType.getSerializedSizeProvider(struct_data)()); - SerializedPayload_t dynamic_payload(payloadSize3); - ASSERT_TRUE(pubsubType.serialize(struct_data, &dynamic_payload)); - ASSERT_TRUE(dynamic_payload.length == payloadSize3); - ASSERT_TRUE(seqpb.deserialize(&dynamic_payload, &seq)); - - uint32_t static_payloadSize = static_cast(seqpb.getSerializedSizeProvider(&seq)()); - SerializedPayload_t static_payload(static_payloadSize); - ASSERT_TRUE(seqpb.serialize(&seq, &static_payload)); - ASSERT_TRUE(static_payload.length == static_payloadSize); - types::DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(struct_type); - ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); - ASSERT_TRUE(data3->equals(struct_data)); - - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == eprosima::fastdds::dds::RETCODE_OK); - - // Delete the structure - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(struct_data) == eprosima::fastdds::dds::RETCODE_OK); - - } - ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); - ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -} - -TEST_F(DynamicTypesTests, DynamicType_structure_inheritance_unit_tests) -{ - { - DynamicTypeBuilder_ptr base_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); - ASSERT_TRUE(base_type_builder != nullptr); - auto base_type = base_type_builder->build(); - - DynamicTypeBuilder_ptr base_type_builder2 = DynamicTypeBuilderFactory::get_instance()->create_int64_builder(); - ASSERT_TRUE(base_type_builder2 != nullptr); - auto base_type2 = base_type_builder2->build(); - - DynamicTypeBuilder_ptr struct_type_builder = DynamicTypeBuilderFactory::get_instance()->create_struct_builder(); - ASSERT_TRUE(struct_type_builder != nullptr); - - // Add members to the struct. - ASSERT_TRUE(struct_type_builder->add_member(0, "int32", base_type) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(struct_type_builder->add_member(1, "int64", base_type2) == eprosima::fastdds::dds::RETCODE_OK); - - auto struct_type = struct_type_builder->build(); - ASSERT_TRUE(struct_type != nullptr); - - // Try to create the child struct without parent - DynamicTypeBuilder_ptr child_struct_type_builder = - DynamicTypeBuilderFactory::get_instance()->create_child_struct_builder(nullptr); - ASSERT_FALSE(child_struct_type_builder != nullptr); - - // Create the child struct. - child_struct_type_builder = DynamicTypeBuilderFactory::get_instance()->create_child_struct_builder( - struct_type_builder.get()); - ASSERT_TRUE(child_struct_type_builder != nullptr); - - // Add a new member to the child struct. - ASSERT_TRUE(child_struct_type_builder->add_member(2, "child_int32", - base_type) == eprosima::fastdds::dds::RETCODE_OK); - - // try to add a member to override one of the parent struct. - ASSERT_FALSE(child_struct_type_builder->add_member(3, "int32", - base_type) == eprosima::fastdds::dds::RETCODE_OK); - - auto child_struct_type = child_struct_type_builder->build(); - ASSERT_TRUE(child_struct_type != nullptr); - auto struct_data = DynamicDataFactory::get_instance()->create_data(child_struct_type); - ASSERT_TRUE(struct_data != nullptr); - - ASSERT_FALSE(struct_data->set_int32_value(10, 1) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(struct_data->set_string_value("", MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - - // Set and get the parent values. - int32_t test1(234); - ASSERT_TRUE(struct_data->set_int32_value(test1, 0) == eprosima::fastdds::dds::RETCODE_OK); - int32_t test2(0); - ASSERT_TRUE(struct_data->get_int32_value(test2, 0) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(test1 == test2); - int64_t test3(234); - ASSERT_TRUE(struct_data->set_int64_value(test3, 1) == eprosima::fastdds::dds::RETCODE_OK); - int64_t test4(0); - ASSERT_TRUE(struct_data->get_int64_value(test4, 1) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(test3 == test4); - // Set and get the child value. - int32_t test5(234); - ASSERT_TRUE(struct_data->set_int32_value(test5, 2) == eprosima::fastdds::dds::RETCODE_OK); - int32_t test6(0); - ASSERT_TRUE(struct_data->get_int32_value(test6, 2) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(test5 == test6); - - // Serialize <-> Deserialize Test - DynamicPubSubType pubsubType(child_struct_type); - uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(struct_data)()); - SerializedPayload_t payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(struct_data, &payload)); - ASSERT_TRUE(payload.length == payloadSize); - - types::DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(child_struct_type); - ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); - ASSERT_TRUE(data2->equals(struct_data)); - - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == eprosima::fastdds::dds::RETCODE_OK); - - // Delete the structure - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(struct_data) == eprosima::fastdds::dds::RETCODE_OK); - } - ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); - ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -} - -TEST_F(DynamicTypesTests, DynamicType_multi_structure_unit_tests) -{ - { - DynamicTypeBuilder_ptr base_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); - ASSERT_TRUE(base_type_builder != nullptr); - auto base_type = base_type_builder->build(); - - DynamicTypeBuilder_ptr base_type_builder2 = DynamicTypeBuilderFactory::get_instance()->create_int64_builder(); - ASSERT_TRUE(base_type_builder2 != nullptr); - auto base_type2 = base_type_builder2->build(); - - DynamicTypeBuilder_ptr struct_type_builder = DynamicTypeBuilderFactory::get_instance()->create_struct_builder(); - ASSERT_TRUE(struct_type_builder != nullptr); - - // Add members to the struct. - ASSERT_TRUE(struct_type_builder->add_member(0, "int32", base_type) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(struct_type_builder->add_member(1, "int64", base_type2) == eprosima::fastdds::dds::RETCODE_OK); - - auto struct_type = struct_type_builder->build(); - ASSERT_TRUE(struct_type != nullptr); - - // Create the parent struct. - DynamicTypeBuilder_ptr parent_struct_type_builder = - DynamicTypeBuilderFactory::get_instance()->create_struct_builder(); - ASSERT_TRUE(parent_struct_type_builder != nullptr); - - // Add members to the parent struct. - ASSERT_TRUE(parent_struct_type_builder->add_member(0, "child_struct", - struct_type) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(parent_struct_type_builder->add_member(1, "child_int64", - base_type2) == eprosima::fastdds::dds::RETCODE_OK); - - auto parent_struct_type = parent_struct_type_builder->build(); - ASSERT_TRUE(parent_struct_type != nullptr); - - auto struct_data = DynamicDataFactory::get_instance()->create_data(parent_struct_type); - ASSERT_TRUE(struct_data != nullptr); - - ASSERT_FALSE(struct_data->set_int32_value(10, 1) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(struct_data->set_string_value("", MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - - // Set and get the child values. - int64_t test1(234); - ASSERT_TRUE(struct_data->set_int64_value(test1, 1) == eprosima::fastdds::dds::RETCODE_OK); - int64_t test2(0); - ASSERT_TRUE(struct_data->get_int64_value(test2, 1) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(test1 == test2); - - auto child_struct_data = struct_data->loan_value(0); - ASSERT_TRUE(child_struct_data != nullptr); - - // Set and get the child values. - int32_t test3(234); - ASSERT_TRUE(child_struct_data->set_int32_value(test3, 0) == eprosima::fastdds::dds::RETCODE_OK); - int32_t test4(0); - ASSERT_TRUE(child_struct_data->get_int32_value(test4, 0) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(test3 == test4); - int64_t test5(234); - ASSERT_TRUE(child_struct_data->set_int64_value(test5, 1) == eprosima::fastdds::dds::RETCODE_OK); - int64_t test6(0); - ASSERT_TRUE(child_struct_data->get_int64_value(test6, 1) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(test5 == test6); - - ASSERT_TRUE(struct_data->return_loaned_value(child_struct_data) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(struct_data->return_loaned_value(child_struct_data) == eprosima::fastdds::dds::RETCODE_OK); - - // Serialize <-> Deserialize Test - DynamicPubSubType pubsubType(parent_struct_type); - uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(struct_data)()); - SerializedPayload_t payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(struct_data, &payload)); - ASSERT_TRUE(payload.length == payloadSize); - - types::DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(parent_struct_type); - ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); - ASSERT_TRUE(data2->equals(struct_data)); - - // SERIALIZATION TEST - StructStructStruct seq; - StructStructStructPubSubType seqpb; - - uint32_t payloadSize3 = static_cast(pubsubType.getSerializedSizeProvider(struct_data)()); - SerializedPayload_t dynamic_payload(payloadSize3); - ASSERT_TRUE(pubsubType.serialize(struct_data, &dynamic_payload)); - ASSERT_TRUE(dynamic_payload.length == payloadSize3); - ASSERT_TRUE(seqpb.deserialize(&dynamic_payload, &seq)); - - uint32_t static_payloadSize = static_cast(seqpb.getSerializedSizeProvider(&seq)()); - SerializedPayload_t static_payload(static_payloadSize); - ASSERT_TRUE(seqpb.serialize(&seq, &static_payload)); - ASSERT_TRUE(static_payload.length == static_payloadSize); - types::DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(parent_struct_type); - ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); - ASSERT_TRUE(data3->equals(struct_data)); - - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == eprosima::fastdds::dds::RETCODE_OK); - - // Delete the map - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(struct_data) == eprosima::fastdds::dds::RETCODE_OK); - } - ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); - ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -} - -TEST_F(DynamicTypesTests, DynamicType_union_unit_tests) -{ - { - DynamicTypeBuilder_ptr base_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); - ASSERT_TRUE(base_type_builder != nullptr); - auto base_type = base_type_builder->build(); - - DynamicTypeBuilder_ptr base_type_builder2 = DynamicTypeBuilderFactory::get_instance()->create_int64_builder(); - ASSERT_TRUE(base_type_builder2 != nullptr); - auto base_type2 = base_type_builder2->build(); - - DynamicTypeBuilder_ptr union_type_builder = DynamicTypeBuilderFactory::get_instance()->create_union_builder( - base_type_builder.get()); - ASSERT_TRUE(union_type_builder != nullptr); - - // Add members to the union. - ASSERT_TRUE(union_type_builder->add_member(0, "first", base_type, "", { 0 }, - true) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(union_type_builder->add_member(1, "second", base_type2, "", { 1 }, - false) == eprosima::fastdds::dds::RETCODE_OK); - - // Try to add a second "DEFAULT" value to the union - ASSERT_FALSE(union_type_builder->add_member(0, "third", base_type, "", { 0 }, - true) == eprosima::fastdds::dds::RETCODE_OK); - - // Try to add a second value to the same case label - ASSERT_FALSE(union_type_builder->add_member(0, "third", base_type, "", { 1 }, - false) == eprosima::fastdds::dds::RETCODE_OK); - - // Create a data of this union - auto union_type = union_type_builder->build(); - ASSERT_TRUE(union_type != nullptr); - auto union_data = DynamicDataFactory::get_instance()->create_data(union_type); - ASSERT_TRUE(union_data != nullptr); - - // Set and get the child values. - ASSERT_FALSE(union_data->set_int32_value(10, 1) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(union_data->set_string_value("", MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - - uint64_t label; - ASSERT_TRUE(union_data->get_union_label(label) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(label == 0); - - int32_t test1(234); - ASSERT_TRUE(union_data->set_int32_value(test1, 0) == eprosima::fastdds::dds::RETCODE_OK); - int32_t test2(0); - ASSERT_TRUE(union_data->get_int32_value(test2, 0) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(test1 == test2); - ASSERT_TRUE(union_data->get_union_label(label) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(label == 0); - - int64_t test3(234); - int64_t test4(0); - - // Try to get values from invalid indexes and from an invalid element ( not the current one ) - ASSERT_FALSE(union_data->get_int32_value(test2, 1) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(union_data->get_int64_value(test4, 1) == eprosima::fastdds::dds::RETCODE_OK); - - ASSERT_TRUE(union_data->set_int64_value(test3, 1) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(union_data->get_int64_value(test4, 1) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(test3 == test4); - ASSERT_TRUE(union_data->get_union_label(label) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(label == 1); - - // Serialize <-> Deserialize Test - DynamicPubSubType pubsubType(union_type); - uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(union_data)()); - SerializedPayload_t payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(union_data, &payload)); - ASSERT_TRUE(payload.length == payloadSize); - - types::DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(union_type); - ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); - ASSERT_TRUE(data2->equals(union_data)); - - // SERIALIZATION TEST - SimpleUnionStruct seq; - SimpleUnionStructPubSubType seqpb; - - uint32_t payloadSize3 = static_cast(pubsubType.getSerializedSizeProvider(union_data)()); - SerializedPayload_t dynamic_payload(payloadSize3); - ASSERT_TRUE(pubsubType.serialize(union_data, &dynamic_payload)); - ASSERT_TRUE(dynamic_payload.length == payloadSize3); - ASSERT_TRUE(seqpb.deserialize(&dynamic_payload, &seq)); - - uint32_t static_payloadSize = static_cast(seqpb.getSerializedSizeProvider(&seq)()); - SerializedPayload_t static_payload(static_payloadSize); - ASSERT_TRUE(seqpb.serialize(&seq, &static_payload)); - ASSERT_TRUE(static_payload.length == static_payloadSize); - types::DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(union_type); - ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); - ASSERT_TRUE(data3->equals(union_data)); - - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == eprosima::fastdds::dds::RETCODE_OK); - - // Delete the map - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(union_data) == eprosima::fastdds::dds::RETCODE_OK); - } - ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); - ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -} - -TEST_F(DynamicTypesTests, DynamicType_union_with_unions_unit_tests) -{ - { - DynamicTypeBuilder_ptr base_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); - ASSERT_TRUE(base_type_builder != nullptr); - auto base_type = base_type_builder->build(); - - DynamicTypeBuilder_ptr base_type_builder2 = DynamicTypeBuilderFactory::get_instance()->create_int64_builder(); - ASSERT_TRUE(base_type_builder2 != nullptr); - auto base_type2 = base_type_builder2->build(); - - DynamicTypeBuilder_ptr union_type_builder = DynamicTypeBuilderFactory::get_instance()->create_union_builder( - base_type); - ASSERT_TRUE(union_type_builder != nullptr); - - // Add members to the union. - ASSERT_TRUE(union_type_builder->add_member(0, "first", base_type, "", { 0 }, - true) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(union_type_builder->add_member(1, "second", base_type2, "", { 1 }, - false) == eprosima::fastdds::dds::RETCODE_OK); - - // Try to add a second "DEFAULT" value to the union - ASSERT_FALSE(union_type_builder->add_member(0, "third", base_type, "", { 0 }, - true) == eprosima::fastdds::dds::RETCODE_OK); - - // Try to add a second value to the same case label - ASSERT_FALSE(union_type_builder->add_member(0, "third", base_type, "", { 1 }, - false) == eprosima::fastdds::dds::RETCODE_OK); - - // Create a data of this union - auto union_type = union_type_builder->build(); - ASSERT_TRUE(union_type != nullptr); - - DynamicTypeBuilder_ptr parent_union_type_builder = - DynamicTypeBuilderFactory::get_instance()->create_union_builder(base_type); - ASSERT_TRUE(parent_union_type_builder != nullptr); - - // Add Members to the parent union - ASSERT_TRUE(parent_union_type_builder->add_member(0, "first", base_type, "", { 0 }, - true) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(parent_union_type_builder->add_member(1, "second", union_type, "", { 1 }, - false) == eprosima::fastdds::dds::RETCODE_OK); - - DynamicType_ptr created_type = DynamicTypeBuilderFactory::get_instance()->create_type( - parent_union_type_builder.get()); - ASSERT_TRUE(created_type != nullptr); - auto union_data = DynamicDataFactory::get_instance()->create_data(parent_union_type_builder.get()); - ASSERT_TRUE(union_data != nullptr); - - // Set and get the child values. - ASSERT_FALSE(union_data->set_int32_value(10, 1) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(union_data->set_string_value("", MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - - uint64_t label; - ASSERT_TRUE(union_data->get_union_label(label) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(label == 0); - - int32_t test1(234); - ASSERT_TRUE(union_data->set_int32_value(test1, 0) == eprosima::fastdds::dds::RETCODE_OK); - int32_t test2(0); - ASSERT_TRUE(union_data->get_int32_value(test2, 0) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(test1 == test2); - ASSERT_TRUE(union_data->get_union_label(label) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(label == 0); - - // Loan Value ( Activates this union id ) - DynamicData* child_data = union_data->loan_value(1); - ASSERT_TRUE(child_data != 0); - - int64_t test3(234); - int64_t test4(0); - - // Try to get values from invalid indexes and from an invalid element ( not the current one ) - ASSERT_FALSE(child_data->get_int32_value(test2, 1) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_FALSE(child_data->get_int64_value(test4, 1) == eprosima::fastdds::dds::RETCODE_OK); - - ASSERT_TRUE(child_data->set_int64_value(test3, 1) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(child_data->get_int64_value(test4, 1) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(test3 == test4); - - ASSERT_TRUE(union_data->return_loaned_value(child_data) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(union_data->get_union_label(label) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(label == 1); - - // Serialize <-> Deserialize Test - DynamicPubSubType pubsubType(created_type); - uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(union_data)()); - SerializedPayload_t payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(union_data, &payload)); - ASSERT_TRUE(payload.length == payloadSize); - - types::DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); - ASSERT_TRUE(data2->equals(union_data)); - - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == eprosima::fastdds::dds::RETCODE_OK); - - // Delete the map - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(union_data) == eprosima::fastdds::dds::RETCODE_OK); - } - ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); - ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -} - -TEST_F(DynamicTypesTests, DynamicType_XML_EnumStruct_test) -{ - using namespace xmlparser; - using namespace types; - - XMLP_ret ret = XMLProfileManager::loadXMLFile(DynamicTypesTests::config_file()); - ASSERT_EQ(ret, XMLP_ret::XML_OK); - { - DynamicPubSubType* pbType = XMLProfileManager::CreateDynamicPubSubType("EnumStruct"); - - DynamicTypeBuilderFactory* m_factory = DynamicTypeBuilderFactory::get_instance(); - - // Enum - DynamicTypeBuilder_ptr enum_builder = m_factory->create_enum_builder(); - enum_builder->add_empty_member(0, "A"); - enum_builder->add_empty_member(1, "B"); - enum_builder->add_empty_member(2, "C"); - enum_builder->set_name("MyEnum"); - - // Struct EnumStruct - DynamicTypeBuilder_ptr es_builder = m_factory->create_struct_builder(); - es_builder->add_member(0, "my_enum", enum_builder.get()); - es_builder->set_name("EnumStruct"); - - ASSERT_TRUE(pbType->GetDynamicType()->equals(es_builder->build().get())); - - delete(pbType); - XMLProfileManager::DeleteInstance(); - } -} - -TEST_F(DynamicTypesTests, DynamicType_XML_AliasStruct_test) -{ - using namespace xmlparser; - using namespace types; - - XMLP_ret ret = XMLProfileManager::loadXMLFile(DynamicTypesTests::config_file()); - ASSERT_EQ(ret, XMLP_ret::XML_OK); - { - DynamicPubSubType* pbType = XMLProfileManager::CreateDynamicPubSubType("AliasStruct"); - - DynamicTypeBuilderFactory* m_factory = DynamicTypeBuilderFactory::get_instance(); - - // Enum - DynamicTypeBuilder_ptr enum_builder = m_factory->create_enum_builder(); - enum_builder->add_empty_member(0, "A"); - enum_builder->add_empty_member(1, "B"); - enum_builder->add_empty_member(2, "C"); - enum_builder->set_name("MyEnum"); - - // Alias - DynamicTypeBuilder_ptr alias_builder = m_factory->create_alias_builder(enum_builder.get(), "MyAliasEnum"); - - // Struct AliasStruct - DynamicTypeBuilder_ptr aliass_builder_ptr = m_factory->create_struct_builder(); - aliass_builder_ptr->add_member(0, "my_alias", alias_builder.get()); - aliass_builder_ptr->set_name("AliasStruct"); - - ASSERT_TRUE(pbType->GetDynamicType()->equals(aliass_builder_ptr->build().get())); - - delete(pbType); - XMLProfileManager::DeleteInstance(); - } -} - -TEST_F(DynamicTypesTests, DynamicType_XML_AliasAliasStruct_test) -{ - using namespace xmlparser; - using namespace types; - - XMLP_ret ret = XMLProfileManager::loadXMLFile(DynamicTypesTests::config_file()); - ASSERT_EQ(ret, XMLP_ret::XML_OK); - { - DynamicPubSubType* pbType = XMLProfileManager::CreateDynamicPubSubType("AliasAliasStruct"); - - DynamicTypeBuilderFactory* m_factory = DynamicTypeBuilderFactory::get_instance(); - - // Enum - DynamicTypeBuilder_ptr enum_builder = m_factory->create_enum_builder(); - enum_builder->add_empty_member(0, "A"); - enum_builder->add_empty_member(1, "B"); - enum_builder->add_empty_member(2, "C"); - enum_builder->set_name("MyEnum"); - - // Alias and aliasalias - DynamicTypeBuilder_ptr alias_builder = m_factory->create_alias_builder(enum_builder.get(), "MyAliasEnum"); - DynamicTypeBuilder_ptr alias_alias_builder = m_factory->create_alias_builder( - alias_builder.get(), "MyAliasAliasEnum"); - - // Struct AliasAliasStruct - DynamicTypeBuilder_ptr aliasAliasS_builder_ptr = m_factory->create_struct_builder(); - aliasAliasS_builder_ptr->add_member(0, "my_alias_alias", alias_alias_builder.get()); - aliasAliasS_builder_ptr->set_name("AliasAliasStruct"); - - ASSERT_TRUE(pbType->GetDynamicType()->equals(aliasAliasS_builder_ptr->build().get())); - - delete(pbType); - XMLProfileManager::DeleteInstance(); - } -} - -TEST_F(DynamicTypesTests, DynamicType_XML_BoolStruct_test) -{ - using namespace xmlparser; - using namespace types; - - XMLP_ret ret = XMLProfileManager::loadXMLFile(DynamicTypesTests::config_file()); - ASSERT_EQ(ret, XMLP_ret::XML_OK); - { - DynamicPubSubType* pbType = XMLProfileManager::CreateDynamicPubSubType("BoolStruct"); - - DynamicTypeBuilderFactory* m_factory = DynamicTypeBuilderFactory::get_instance(); - - // Boolean - DynamicTypeBuilder_ptr boolean_builder = m_factory->create_bool_builder(); - - // Struct BoolStruct - DynamicTypeBuilder_ptr bool_builder_ptr = m_factory->create_struct_builder(); - bool_builder_ptr->add_member(0, "my_bool", boolean_builder.get()); - bool_builder_ptr->set_name("BoolStruct"); - - ASSERT_TRUE(pbType->GetDynamicType()->equals(bool_builder_ptr->build().get())); - - delete(pbType); - XMLProfileManager::DeleteInstance(); - } -} - -TEST_F(DynamicTypesTests, DynamicType_XML_OctetStruct_test) -{ - using namespace xmlparser; - using namespace types; - - XMLP_ret ret = XMLProfileManager::loadXMLFile(DynamicTypesTests::config_file()); - ASSERT_EQ(ret, XMLP_ret::XML_OK); - { - DynamicPubSubType* pbType = XMLProfileManager::CreateDynamicPubSubType("OctetStruct"); - - DynamicTypeBuilderFactory* m_factory = DynamicTypeBuilderFactory::get_instance(); - - // Byte - DynamicTypeBuilder_ptr byte_builder = m_factory->create_byte_builder(); - - // Struct OctetStruct - DynamicTypeBuilder_ptr octet_builder_ptr = m_factory->create_struct_builder(); - octet_builder_ptr->add_member(0, "my_octet", byte_builder.get()); - octet_builder_ptr->set_name("OctetStruct"); - - ASSERT_TRUE(pbType->GetDynamicType()->equals(octet_builder_ptr->build().get())); - - delete(pbType); - XMLProfileManager::DeleteInstance(); - } -} - -TEST_F(DynamicTypesTests, DynamicType_XML_ShortStruct_test) -{ - using namespace xmlparser; - using namespace types; - - XMLP_ret ret = XMLProfileManager::loadXMLFile(DynamicTypesTests::config_file()); - ASSERT_EQ(ret, XMLP_ret::XML_OK); - { - DynamicPubSubType* pbType = XMLProfileManager::CreateDynamicPubSubType("ShortStruct"); - - DynamicTypeBuilderFactory* m_factory = DynamicTypeBuilderFactory::get_instance(); - - // Int16 - DynamicTypeBuilder_ptr int16_builder = m_factory->create_int16_builder(); - - // Struct ShortStruct - DynamicTypeBuilder_ptr int16_builder_ptr = m_factory->create_struct_builder(); - int16_builder_ptr->add_member(0, "my_int16", int16_builder.get()); - int16_builder_ptr->set_name("ShortStruct"); - - ASSERT_TRUE(pbType->GetDynamicType()->equals(int16_builder_ptr->build().get())); - - delete(pbType); - XMLProfileManager::DeleteInstance(); - } -} - -TEST_F(DynamicTypesTests, DynamicType_XML_LongStruct_test) -{ - using namespace xmlparser; - using namespace types; - - XMLP_ret ret = XMLProfileManager::loadXMLFile(DynamicTypesTests::config_file()); - ASSERT_EQ(ret, XMLP_ret::XML_OK); - { - DynamicPubSubType* pbType = XMLProfileManager::CreateDynamicPubSubType("LongStruct"); - - DynamicTypeBuilderFactory* m_factory = DynamicTypeBuilderFactory::get_instance(); - - // Int32 - DynamicTypeBuilder_ptr int32_builder = m_factory->create_int32_builder(); - - // Struct LongStruct - DynamicTypeBuilder_ptr int32_builder_ptr = m_factory->create_struct_builder(); - int32_builder_ptr->add_member(0, "my_int32", int32_builder.get()); - int32_builder_ptr->set_name("LongStruct"); - - ASSERT_TRUE(pbType->GetDynamicType()->equals(int32_builder_ptr->build().get())); - - delete(pbType); - XMLProfileManager::DeleteInstance(); - } -} - -TEST_F(DynamicTypesTests, DynamicType_XML_LongLongStruct_test) -{ - using namespace xmlparser; - using namespace types; - - XMLP_ret ret = XMLProfileManager::loadXMLFile(DynamicTypesTests::config_file()); - ASSERT_EQ(ret, XMLP_ret::XML_OK); - { - DynamicPubSubType* pbType = XMLProfileManager::CreateDynamicPubSubType("LongLongStruct"); - - DynamicTypeBuilderFactory* m_factory = DynamicTypeBuilderFactory::get_instance(); - - // Int64 - DynamicTypeBuilder_ptr int64_builder = m_factory->create_int64_builder(); - - // Struct LongLongStruct - DynamicTypeBuilder_ptr int64_builder_ptr = m_factory->create_struct_builder(); - int64_builder_ptr->add_member(0, "my_int64", int64_builder.get()); - int64_builder_ptr->set_name("LongLongStruct"); - - ASSERT_TRUE(pbType->GetDynamicType()->equals(int64_builder_ptr->build().get())); - - delete(pbType); - XMLProfileManager::DeleteInstance(); - } -} - -TEST_F(DynamicTypesTests, DynamicType_XML_UShortStruct_test) -{ - using namespace xmlparser; - using namespace types; - - XMLP_ret ret = XMLProfileManager::loadXMLFile(DynamicTypesTests::config_file()); - ASSERT_EQ(ret, XMLP_ret::XML_OK); - { - DynamicPubSubType* pbType = XMLProfileManager::CreateDynamicPubSubType("UShortStruct"); - - DynamicTypeBuilderFactory* m_factory = DynamicTypeBuilderFactory::get_instance(); - - // uint16 - DynamicTypeBuilder_ptr uint16_builder = m_factory->create_uint16_builder(); - - // Struct UShortStruct - DynamicTypeBuilder_ptr uint16_builder_ptr = m_factory->create_struct_builder(); - uint16_builder_ptr->add_member(0, "my_uint16", uint16_builder.get()); - uint16_builder_ptr->set_name("UShortStruct"); - - ASSERT_TRUE(pbType->GetDynamicType()->equals(uint16_builder_ptr->build().get())); - - delete(pbType); - XMLProfileManager::DeleteInstance(); - } -} - -TEST_F(DynamicTypesTests, DynamicType_XML_ULongStruct_test) -{ - using namespace xmlparser; - using namespace types; - - XMLP_ret ret = XMLProfileManager::loadXMLFile(DynamicTypesTests::config_file()); - ASSERT_EQ(ret, XMLP_ret::XML_OK); - { - DynamicPubSubType* pbType = XMLProfileManager::CreateDynamicPubSubType("ULongStruct"); - - DynamicTypeBuilderFactory* m_factory = DynamicTypeBuilderFactory::get_instance(); - - // uint32 - DynamicTypeBuilder_ptr uint32_builder = m_factory->create_uint32_builder(); - - // Struct ULongStruct - DynamicTypeBuilder_ptr uint32_builder_ptr = m_factory->create_struct_builder(); - uint32_builder_ptr->add_member(0, "my_uint32", uint32_builder.get()); - uint32_builder_ptr->set_name("ULongStruct"); - - ASSERT_TRUE(pbType->GetDynamicType()->equals(uint32_builder_ptr->build().get())); - - delete(pbType); - XMLProfileManager::DeleteInstance(); - } -} - -TEST_F(DynamicTypesTests, DynamicType_XML_ULongLongStruct_test) -{ - using namespace xmlparser; - using namespace types; - - XMLP_ret ret = XMLProfileManager::loadXMLFile(DynamicTypesTests::config_file()); - ASSERT_EQ(ret, XMLP_ret::XML_OK); - { - DynamicPubSubType* pbType = XMLProfileManager::CreateDynamicPubSubType("ULongLongStruct"); - - DynamicTypeBuilderFactory* m_factory = DynamicTypeBuilderFactory::get_instance(); - - // uint64 - DynamicTypeBuilder_ptr uint64_builder = m_factory->create_uint64_builder(); - - // Struct ULongLongStruct - DynamicTypeBuilder_ptr uint64_builder_ptr = m_factory->create_struct_builder(); - uint64_builder_ptr->add_member(0, "my_uint64", uint64_builder.get()); - uint64_builder_ptr->set_name("ULongLongStruct"); - - ASSERT_TRUE(pbType->GetDynamicType()->equals(uint64_builder_ptr->build().get())); - - delete(pbType); - XMLProfileManager::DeleteInstance(); - } -} - -TEST_F(DynamicTypesTests, DynamicType_XML_FloatStruct_test) -{ - using namespace xmlparser; - using namespace types; - - XMLP_ret ret = XMLProfileManager::loadXMLFile(DynamicTypesTests::config_file()); - ASSERT_EQ(ret, XMLP_ret::XML_OK); - { - DynamicPubSubType* pbType = XMLProfileManager::CreateDynamicPubSubType("FloatStruct"); - - DynamicTypeBuilderFactory* m_factory = DynamicTypeBuilderFactory::get_instance(); - - // float32 - DynamicTypeBuilder_ptr float32_builder = m_factory->create_float32_builder(); - - // Struct FloatStruct - DynamicTypeBuilder_ptr float32_builder_ptr = m_factory->create_struct_builder(); - float32_builder_ptr->add_member(0, "my_float32", float32_builder.get()); - float32_builder_ptr->set_name("FloatStruct"); - - ASSERT_TRUE(pbType->GetDynamicType()->equals(float32_builder_ptr->build().get())); - - delete(pbType); - XMLProfileManager::DeleteInstance(); - } -} - -TEST_F(DynamicTypesTests, DynamicType_XML_DoubleStruct_test) -{ - using namespace xmlparser; - using namespace types; - - XMLP_ret ret = XMLProfileManager::loadXMLFile(DynamicTypesTests::config_file()); - ASSERT_EQ(ret, XMLP_ret::XML_OK); - { - DynamicPubSubType* pbType = XMLProfileManager::CreateDynamicPubSubType("DoubleStruct"); - - DynamicTypeBuilderFactory* m_factory = DynamicTypeBuilderFactory::get_instance(); - - // float64 - DynamicTypeBuilder_ptr float64_builder = m_factory->create_float64_builder(); - - // Struct DoubleStruct - DynamicTypeBuilder_ptr float64_builder_ptr = m_factory->create_struct_builder(); - float64_builder_ptr->add_member(0, "my_float64", float64_builder.get()); - float64_builder_ptr->set_name("DoubleStruct"); - - ASSERT_TRUE(pbType->GetDynamicType()->equals(float64_builder_ptr->build().get())); - - delete(pbType); - XMLProfileManager::DeleteInstance(); - } -} - -TEST_F(DynamicTypesTests, DynamicType_XML_LongDoubleStruct_test) -{ - using namespace xmlparser; - using namespace types; - - XMLP_ret ret = XMLProfileManager::loadXMLFile(DynamicTypesTests::config_file()); - ASSERT_EQ(ret, XMLP_ret::XML_OK); - { - DynamicPubSubType* pbType = XMLProfileManager::CreateDynamicPubSubType("LongDoubleStruct"); - - DynamicTypeBuilderFactory* m_factory = DynamicTypeBuilderFactory::get_instance(); - - // float128 - DynamicTypeBuilder_ptr float128_builder = m_factory->create_float128_builder(); - - // Struct LongDoubleStruct - DynamicTypeBuilder_ptr float128_builder_ptr = m_factory->create_struct_builder(); - float128_builder_ptr->add_member(0, "my_float128", float128_builder.get()); - float128_builder_ptr->set_name("LongDoubleStruct"); - - ASSERT_TRUE(pbType->GetDynamicType()->equals(float128_builder_ptr->build().get())); - - delete(pbType); - XMLProfileManager::DeleteInstance(); - } -} - -TEST_F(DynamicTypesTests, DynamicType_XML_CharStruct_test) -{ - using namespace xmlparser; - using namespace types; - - XMLP_ret ret = XMLProfileManager::loadXMLFile(DynamicTypesTests::config_file()); - ASSERT_EQ(ret, XMLP_ret::XML_OK); - { - DynamicPubSubType* pbType = XMLProfileManager::CreateDynamicPubSubType("CharStruct"); - - DynamicTypeBuilderFactory* m_factory = DynamicTypeBuilderFactory::get_instance(); - - // char - DynamicTypeBuilder_ptr char8_builder = m_factory->create_char8_builder(); - - // Struct CharStruct - DynamicTypeBuilder_ptr char_builder_ptr = m_factory->create_struct_builder(); - char_builder_ptr->add_member(0, "my_char", char8_builder.get()); - char_builder_ptr->set_name("CharStruct"); - - ASSERT_TRUE(pbType->GetDynamicType()->equals(char_builder_ptr->build().get())); - - delete(pbType); - XMLProfileManager::DeleteInstance(); - } -} - -TEST_F(DynamicTypesTests, DynamicType_XML_WCharStruct_test) -{ - using namespace xmlparser; - using namespace types; - - XMLP_ret ret = XMLProfileManager::loadXMLFile(DynamicTypesTests::config_file()); - ASSERT_EQ(ret, XMLP_ret::XML_OK); - { - DynamicPubSubType* pbType = XMLProfileManager::CreateDynamicPubSubType("WCharStruct"); - - DynamicTypeBuilderFactory* m_factory = DynamicTypeBuilderFactory::get_instance(); - - // wchar - DynamicTypeBuilder_ptr char16_builder = m_factory->create_char16_builder(); - - // Struct WCharStruct - DynamicTypeBuilder_ptr wchar_builder_ptr = m_factory->create_struct_builder(); - wchar_builder_ptr->add_member(0, "my_wchar", char16_builder.get()); - wchar_builder_ptr->set_name("WCharStruct"); - - ASSERT_TRUE(pbType->GetDynamicType()->equals(wchar_builder_ptr->build().get())); - - delete(pbType); - XMLProfileManager::DeleteInstance(); - } -} - -TEST_F(DynamicTypesTests, DynamicType_XML_StringStruct_test) -{ - using namespace xmlparser; - using namespace types; - - XMLP_ret ret = XMLProfileManager::loadXMLFile(DynamicTypesTests::config_file()); - ASSERT_EQ(ret, XMLP_ret::XML_OK); - { - DynamicPubSubType* pbType = XMLProfileManager::CreateDynamicPubSubType("StringStruct"); - - DynamicTypeBuilderFactory* m_factory = DynamicTypeBuilderFactory::get_instance(); - - // string - DynamicTypeBuilder_ptr string_builder = m_factory->create_string_builder(); - - // Struct StringStruct - DynamicTypeBuilder_ptr string_builder_ptr = m_factory->create_struct_builder(); - string_builder_ptr->add_member(0, "my_string", string_builder.get()); - string_builder_ptr->set_name("StringStruct"); - - ASSERT_TRUE(pbType->GetDynamicType()->equals(string_builder_ptr->build().get())); - - delete(pbType); - XMLProfileManager::DeleteInstance(); - } -} - -TEST_F(DynamicTypesTests, DynamicType_XML_WStringStruct_test) -{ - using namespace xmlparser; - using namespace types; - - XMLP_ret ret = XMLProfileManager::loadXMLFile(DynamicTypesTests::config_file()); - ASSERT_EQ(ret, XMLP_ret::XML_OK); - { - DynamicPubSubType* pbType = XMLProfileManager::CreateDynamicPubSubType("WStringStruct"); - - DynamicTypeBuilderFactory* m_factory = DynamicTypeBuilderFactory::get_instance(); - - // wstring - DynamicTypeBuilder_ptr wstring_builder = m_factory->create_wstring_builder(); - - // Struct WStringStruct - DynamicTypeBuilder_ptr wstring_builder_ptr = m_factory->create_struct_builder(); - wstring_builder_ptr->add_member(0, "my_wstring", wstring_builder.get()); - wstring_builder_ptr->set_name("WStringStruct"); - - ASSERT_TRUE(pbType->GetDynamicType()->equals(wstring_builder_ptr->build().get())); - - delete(pbType); - XMLProfileManager::DeleteInstance(); - } -} - -TEST_F(DynamicTypesTests, DynamicType_XML_LargeStringStruct_test) -{ - using namespace xmlparser; - using namespace types; - - XMLP_ret ret = XMLProfileManager::loadXMLFile(DynamicTypesTests::config_file()); - ASSERT_EQ(ret, XMLP_ret::XML_OK); - { - DynamicPubSubType* pbType = XMLProfileManager::CreateDynamicPubSubType("LargeStringStruct"); - - DynamicTypeBuilderFactory* m_factory = DynamicTypeBuilderFactory::get_instance(); - - // large string - DynamicTypeBuilder_ptr string_builder = m_factory->create_string_builder(41925); - - // Struct LargeStringStruct - DynamicTypeBuilder_ptr large_string_builder_ptr = m_factory->create_struct_builder(); - large_string_builder_ptr->add_member(0, "my_large_string", string_builder.get()); - large_string_builder_ptr->set_name("LargeStringStruct"); - - ASSERT_TRUE(pbType->GetDynamicType()->equals(large_string_builder_ptr->build().get())); - - delete(pbType); - XMLProfileManager::DeleteInstance(); - } -} - -TEST_F(DynamicTypesTests, DynamicType_XML_LargeWStringStruct_test) -{ - using namespace xmlparser; - using namespace types; - - XMLP_ret ret = XMLProfileManager::loadXMLFile(DynamicTypesTests::config_file()); - ASSERT_EQ(ret, XMLP_ret::XML_OK); - { - DynamicPubSubType* pbType = XMLProfileManager::CreateDynamicPubSubType("LargeWStringStruct"); - - DynamicTypeBuilderFactory* m_factory = DynamicTypeBuilderFactory::get_instance(); - - // large wstring - DynamicTypeBuilder_ptr wstring_builder = m_factory->create_wstring_builder(41925); - - // Struct LargeWStringStruct - DynamicTypeBuilder_ptr large_wstring_builder_ptr = m_factory->create_struct_builder(); - large_wstring_builder_ptr->add_member(0, "my_large_wstring", wstring_builder.get()); - large_wstring_builder_ptr->set_name("LargeWStringStruct"); - - ASSERT_TRUE(pbType->GetDynamicType()->equals(large_wstring_builder_ptr->build().get())); - - delete(pbType); - XMLProfileManager::DeleteInstance(); - } -} - -TEST_F(DynamicTypesTests, DynamicType_XML_ShortStringStruct_test) -{ - using namespace xmlparser; - using namespace types; - - XMLP_ret ret = XMLProfileManager::loadXMLFile(DynamicTypesTests::config_file()); - ASSERT_EQ(ret, XMLP_ret::XML_OK); - { - DynamicPubSubType* pbType = XMLProfileManager::CreateDynamicPubSubType("ShortStringStruct"); - - DynamicTypeBuilderFactory* m_factory = DynamicTypeBuilderFactory::get_instance(); - - // Short string - DynamicTypeBuilder_ptr string_builder = m_factory->create_string_builder(15); - - // Struct ShortStringStruct - DynamicTypeBuilder_ptr short_string_builder_ptr = m_factory->create_struct_builder(); - short_string_builder_ptr->add_member(0, "my_short_string", string_builder.get()); - short_string_builder_ptr->set_name("ShortStringStruct"); - - ASSERT_TRUE(pbType->GetDynamicType()->equals(short_string_builder_ptr->build().get())); - - delete(pbType); - XMLProfileManager::DeleteInstance(); - } -} - -TEST_F(DynamicTypesTests, DynamicType_XML_ShortWStringStruct_test) -{ - using namespace xmlparser; - using namespace types; - - XMLP_ret ret = XMLProfileManager::loadXMLFile(DynamicTypesTests::config_file()); - ASSERT_EQ(ret, XMLP_ret::XML_OK); - { - DynamicPubSubType* pbType = XMLProfileManager::CreateDynamicPubSubType("ShortWStringStruct"); - - DynamicTypeBuilderFactory* m_factory = DynamicTypeBuilderFactory::get_instance(); - - // Short wstring - DynamicTypeBuilder_ptr wstring_builder = m_factory->create_wstring_builder(15); - - // Struct ShortWStringStruct - DynamicTypeBuilder_ptr short_wstring_builder_ptr = m_factory->create_struct_builder(); - short_wstring_builder_ptr->add_member(0, "my_short_wstring", wstring_builder.get()); - short_wstring_builder_ptr->set_name("ShortWStringStruct"); - - ASSERT_TRUE(pbType->GetDynamicType()->equals(short_wstring_builder_ptr->build().get())); - - delete(pbType); - XMLProfileManager::DeleteInstance(); - } -} - -TEST_F(DynamicTypesTests, DynamicType_XML_AliasStringStruct_test) -{ - using namespace xmlparser; - using namespace types; - - XMLP_ret ret = XMLProfileManager::loadXMLFile(DynamicTypesTests::config_file()); - ASSERT_EQ(ret, XMLP_ret::XML_OK); - { - DynamicPubSubType* pbType = XMLProfileManager::CreateDynamicPubSubType("StructAliasString"); - - DynamicTypeBuilderFactory* m_factory = DynamicTypeBuilderFactory::get_instance(); - - // String - DynamicTypeBuilder_ptr string_builder = m_factory->create_string_builder(); - - // Alias - DynamicTypeBuilder_ptr myAlias_builder = m_factory->create_alias_builder(string_builder.get(), "MyAliasString"); - - // Struct StructAliasString - DynamicTypeBuilder_ptr alias_string_builder_ptr = m_factory->create_struct_builder(); - alias_string_builder_ptr->add_member(0, "my_alias_string", myAlias_builder.get()); - alias_string_builder_ptr->set_name("StructAliasString"); - - ASSERT_TRUE(pbType->GetDynamicType()->equals(alias_string_builder_ptr->build().get())); - - delete(pbType); - XMLProfileManager::DeleteInstance(); - } -} - -TEST_F(DynamicTypesTests, DynamicType_XML_StructAliasWString_test) -{ - using namespace xmlparser; - using namespace types; - - XMLP_ret ret = XMLProfileManager::loadXMLFile(DynamicTypesTests::config_file()); - ASSERT_EQ(ret, XMLP_ret::XML_OK); - { - DynamicPubSubType* pbType = XMLProfileManager::CreateDynamicPubSubType("StructAliasWString"); - - DynamicTypeBuilderFactory* m_factory = DynamicTypeBuilderFactory::get_instance(); - - // wstring - DynamicTypeBuilder_ptr wstring_builder = m_factory->create_wstring_builder(); - - // Alias - DynamicTypeBuilder_ptr myAlias_builder = - m_factory->create_alias_builder(wstring_builder.get(), "MyAliasWString"); - - // Struct StructAliasWString - DynamicTypeBuilder_ptr alias_wstring_builder_ptr = m_factory->create_struct_builder(); - alias_wstring_builder_ptr->add_member(0, "my_alias_wstring", myAlias_builder.get()); - alias_wstring_builder_ptr->set_name("StructAliasWString"); - - ASSERT_TRUE(pbType->GetDynamicType()->equals(alias_wstring_builder_ptr->build().get())); - - delete(pbType); - XMLProfileManager::DeleteInstance(); - } -} - -TEST_F(DynamicTypesTests, DynamicType_XML_ArraytStruct_test) -{ - using namespace xmlparser; - using namespace types; - - XMLP_ret ret = XMLProfileManager::loadXMLFile(DynamicTypesTests::config_file()); - ASSERT_EQ(ret, XMLP_ret::XML_OK); - { - DynamicPubSubType* pbType = XMLProfileManager::CreateDynamicPubSubType("ArraytStruct"); - - DynamicTypeBuilderFactory* m_factory = DynamicTypeBuilderFactory::get_instance(); - - // Int32 - DynamicTypeBuilder_ptr int32_builder = m_factory->create_int32_builder(); - - // Array - DynamicTypeBuilder_ptr array_builder = m_factory->create_array_builder(int32_builder.get(), { 2, 2, 2 }); - - // Struct ShortWStringStruct - DynamicTypeBuilder_ptr array_int32_builder_ptr = m_factory->create_struct_builder(); - array_int32_builder_ptr->add_member(0, "my_array", array_builder.get()); - array_int32_builder_ptr->set_name("ArraytStruct"); - - ASSERT_TRUE(pbType->GetDynamicType()->equals(array_int32_builder_ptr->build().get())); - - delete(pbType); - XMLProfileManager::DeleteInstance(); - } -} - -TEST_F(DynamicTypesTests, DynamicType_XML_ArrayArrayStruct_test) -{ - using namespace xmlparser; - using namespace types; - - XMLP_ret ret = XMLProfileManager::loadXMLFile(DynamicTypesTests::config_file()); - ASSERT_EQ(ret, XMLP_ret::XML_OK); - { - DynamicPubSubType* pbType = XMLProfileManager::CreateDynamicPubSubType("ArrayArrayStruct"); - - DynamicTypeBuilderFactory* m_factory = DynamicTypeBuilderFactory::get_instance(); - - // Typedef aka Alias - DynamicTypeBuilder_ptr int32_builder = m_factory->create_int32_builder(); - DynamicTypeBuilder_ptr array_builder = m_factory->create_array_builder(int32_builder.get(), { 2, 2 }); - DynamicTypeBuilder_ptr myArray_builder = m_factory->create_alias_builder(array_builder.get(), "MyArray"); - - // Struct ArrayArrayStruct - DynamicTypeBuilder_ptr aas_builder = m_factory->create_struct_builder(); - DynamicTypeBuilder_ptr aMyArray_builder = m_factory->create_array_builder(myArray_builder.get(), { 2, 2 }); - aas_builder->add_member(0, "my_array_array", aMyArray_builder.get()); - aas_builder->set_name("ArrayArrayStruct"); - - ASSERT_TRUE(pbType->GetDynamicType()->equals(aas_builder->build().get())); - - delete(pbType); - XMLProfileManager::DeleteInstance(); - } -} - -TEST_F(DynamicTypesTests, DynamicType_XML_ArrayArrayArrayStruct_test) -{ - using namespace xmlparser; - using namespace types; - - XMLP_ret ret = XMLProfileManager::loadXMLFile(DynamicTypesTests::config_file()); - ASSERT_EQ(ret, XMLP_ret::XML_OK); - { - DynamicPubSubType* pbType = XMLProfileManager::CreateDynamicPubSubType("ArrayArrayArrayStruct"); - - DynamicTypeBuilderFactory* m_factory = DynamicTypeBuilderFactory::get_instance(); - // Manual comparision test - /* - typedef long MyArray[2][2]; - - struct ArrayArrayStruct - { - MyArray my_array_array[2][2]; - }; - - struct ArrayArrayArrayStruct - { - ArrayArrayStruct my_array_array_array[2][2]; - }; - - ====== - - - - - - - - - - - - - - - */ - // Typedef aka Alias - DynamicTypeBuilder_ptr int32_builder = m_factory->create_int32_builder(); - DynamicTypeBuilder_ptr array_builder = m_factory->create_array_builder(int32_builder.get(), { 2, 2 }); - DynamicTypeBuilder_ptr myArray_builder = m_factory->create_alias_builder(array_builder.get(), "MyArray"); - - // Struct ArrayArrayStruct - DynamicTypeBuilder_ptr aas_builder = m_factory->create_struct_builder(); - DynamicTypeBuilder_ptr aMyArray_builder = m_factory->create_array_builder(myArray_builder.get(), { 2, 2 }); - aas_builder->add_member(0, "my_array_array", aMyArray_builder.get()); - aas_builder->set_name("ArrayArrayStruct"); - - // Struct ArrayArrayArrayStruct - DynamicTypeBuilder_ptr aaas_builder = m_factory->create_struct_builder(); - DynamicTypeBuilder_ptr aas_array_builder = m_factory->create_array_builder(aas_builder.get(), { 2, 2 }); - aaas_builder->add_member(0, "my_array_array_array", aas_array_builder.get()); - aaas_builder->set_name("ArrayArrayArrayStruct"); - - ASSERT_TRUE(pbType->GetDynamicType()->equals(aaas_builder->build().get())); - - delete(pbType); - XMLProfileManager::DeleteInstance(); - } -} - -TEST_F(DynamicTypesTests, DynamicType_XML_SequenceStruct_test) -{ - using namespace xmlparser; - using namespace types; - - XMLP_ret ret = XMLProfileManager::loadXMLFile(DynamicTypesTests::config_file()); - ASSERT_EQ(ret, XMLP_ret::XML_OK); - { - DynamicPubSubType* pbType = XMLProfileManager::CreateDynamicPubSubType("SequenceStruct"); - - DynamicTypeBuilderFactory* m_factory = DynamicTypeBuilderFactory::get_instance(); - - DynamicTypeBuilder_ptr int32_builder = m_factory->create_int32_builder(); - DynamicTypeBuilder_ptr seq_builder = m_factory->create_sequence_builder(int32_builder.get(), 2); - - DynamicTypeBuilder_ptr seqs_builder = m_factory->create_struct_builder(); - seqs_builder->add_member(0, "my_sequence", seq_builder.get()); - seqs_builder->set_name("SequenceStruct"); - - ASSERT_TRUE(pbType->GetDynamicType()->equals(seqs_builder->build().get())); - - delete(pbType); - XMLProfileManager::DeleteInstance(); - } -} - -TEST_F(DynamicTypesTests, DynamicType_XML_SequenceSequenceStruct_test) -{ - using namespace xmlparser; - using namespace types; - - XMLP_ret ret = XMLProfileManager::loadXMLFile(DynamicTypesTests::config_file()); - ASSERT_EQ(ret, XMLP_ret::XML_OK); - { - DynamicPubSubType* pbType = XMLProfileManager::CreateDynamicPubSubType("SequenceSequenceStruct"); - - DynamicTypeBuilderFactory* m_factory = DynamicTypeBuilderFactory::get_instance(); - - DynamicTypeBuilder_ptr int32_builder = m_factory->create_int32_builder(); - DynamicTypeBuilder_ptr seq_builder = m_factory->create_sequence_builder(int32_builder.get(), 2); - DynamicTypeBuilder_ptr alias_builder = m_factory->create_alias_builder( - seq_builder.get(), "my_sequence_sequence_inner"); - - DynamicTypeBuilder_ptr sss_builder = m_factory->create_struct_builder(); - DynamicTypeBuilder_ptr seq_seq_builder = m_factory->create_sequence_builder(alias_builder.get(), 2); - sss_builder->add_member(0, "my_sequence_sequence", seq_seq_builder.get()); - sss_builder->set_name("SequenceSequenceStruct"); - - ASSERT_TRUE(pbType->GetDynamicType()->equals(sss_builder->build().get())); - - delete(pbType); - XMLProfileManager::DeleteInstance(); - } -} - -TEST_F(DynamicTypesTests, DynamicType_XML_MapStruct_test) -{ - using namespace xmlparser; - using namespace types; - - XMLP_ret ret = XMLProfileManager::loadXMLFile(DynamicTypesTests::config_file()); - ASSERT_EQ(ret, XMLP_ret::XML_OK); - { - DynamicPubSubType* pbType = XMLProfileManager::CreateDynamicPubSubType("MapStruct"); - - DynamicTypeBuilderFactory* m_factory = DynamicTypeBuilderFactory::get_instance(); - - DynamicTypeBuilder_ptr int32_builder = m_factory->create_int32_builder(); - DynamicTypeBuilder_ptr map_builder = m_factory->create_map_builder(int32_builder.get(), int32_builder.get(), 7); - - DynamicTypeBuilder_ptr maps_builder = m_factory->create_struct_builder(); - maps_builder->add_member(0, "my_map", map_builder.get()); - maps_builder->set_name("MapStruct"); - - ASSERT_TRUE(pbType->GetDynamicType()->equals(maps_builder->build().get())); - - delete(pbType); - XMLProfileManager::DeleteInstance(); - } -} - -TEST_F(DynamicTypesTests, DynamicType_XML_MapMapStruct_test) -{ - using namespace xmlparser; - using namespace types; - - XMLP_ret ret = XMLProfileManager::loadXMLFile(DynamicTypesTests::config_file()); - ASSERT_EQ(ret, XMLP_ret::XML_OK); - { - DynamicPubSubType* pbType = XMLProfileManager::CreateDynamicPubSubType("MapMapStruct"); - - DynamicTypeBuilderFactory* m_factory = DynamicTypeBuilderFactory::get_instance(); - - DynamicTypeBuilder_ptr int32_builder = m_factory->create_int32_builder(); - DynamicTypeBuilder_ptr map_builder = m_factory->create_map_builder(int32_builder.get(), int32_builder.get(), 7); - DynamicTypeBuilder_ptr alias_builder = m_factory->create_alias_builder(map_builder.get(), "my_map_map_inner"); - DynamicTypeBuilder_ptr map_map_builder = m_factory->create_map_builder(alias_builder.get(), - int32_builder.get(), 2); - - - DynamicTypeBuilder_ptr maps_builder = m_factory->create_struct_builder(); - maps_builder->add_member(0, "my_map_map", map_map_builder.get()); - maps_builder->set_name("MapMapStruct"); - - ASSERT_TRUE(pbType->GetDynamicType()->equals(maps_builder->build().get())); - - delete(pbType); - XMLProfileManager::DeleteInstance(); - } -} - -TEST_F(DynamicTypesTests, DynamicType_XML_StructStruct_test) -{ - using namespace xmlparser; - using namespace types; - - XMLP_ret ret = XMLProfileManager::loadXMLFile(DynamicTypesTests::config_file()); - ASSERT_EQ(ret, XMLP_ret::XML_OK); - { - DynamicPubSubType* pbType = XMLProfileManager::CreateDynamicPubSubType("StructStruct"); - - DynamicTypeBuilderFactory* m_factory = DynamicTypeBuilderFactory::get_instance(); - - DynamicTypeBuilder_ptr int32_builder = m_factory->create_int32_builder(); - DynamicTypeBuilder_ptr int64_builder = m_factory->create_int64_builder(); - - DynamicTypeBuilder_ptr structs_builder = m_factory->create_struct_builder(); - structs_builder->add_member(0, "a", int32_builder.get()); - structs_builder->add_member(1, "b", int64_builder.get()); - structs_builder->set_name("StructStruct"); - - ASSERT_TRUE(pbType->GetDynamicType()->equals(structs_builder->build().get())); - - delete(pbType); - XMLProfileManager::DeleteInstance(); - } -} - -TEST_F(DynamicTypesTests, DynamicType_XML_StructStructStruct_test) -{ - using namespace xmlparser; - using namespace types; - - XMLP_ret ret = XMLProfileManager::loadXMLFile(DynamicTypesTests::config_file()); - ASSERT_EQ(ret, XMLP_ret::XML_OK); - { - DynamicPubSubType* pbType = XMLProfileManager::CreateDynamicPubSubType("StructStructStruct"); - - DynamicTypeBuilderFactory* m_factory = DynamicTypeBuilderFactory::get_instance(); - - DynamicTypeBuilder_ptr int32_builder = m_factory->create_int32_builder(); - DynamicTypeBuilder_ptr int64_builder = m_factory->create_int64_builder(); - - DynamicTypeBuilder_ptr structs_builder = m_factory->create_struct_builder(); - structs_builder->add_member(0, "a", int32_builder.get()); - structs_builder->add_member(1, "b", int64_builder.get()); - structs_builder->set_name("StructStruct"); - - DynamicTypeBuilder_ptr sss_builder = m_factory->create_struct_builder(); - sss_builder->add_member(0, "child_struct", structs_builder.get()); - sss_builder->add_member(1, "child_int64", int64_builder.get()); - sss_builder->set_name("StructStructStruct"); - - ASSERT_TRUE(pbType->GetDynamicType()->equals(sss_builder->build().get())); - - delete(pbType); - XMLProfileManager::DeleteInstance(); - } -} - -TEST_F(DynamicTypesTests, DynamicType_XML_SimpleUnionStruct_test) -{ - using namespace xmlparser; - using namespace types; - - XMLP_ret ret = XMLProfileManager::loadXMLFile(DynamicTypesTests::config_file()); - ASSERT_EQ(ret, XMLP_ret::XML_OK); - { - DynamicPubSubType* pbType = XMLProfileManager::CreateDynamicPubSubType("SimpleUnionStruct"); - - DynamicTypeBuilderFactory* m_factory = DynamicTypeBuilderFactory::get_instance(); - - DynamicTypeBuilder_ptr int32_builder = m_factory->create_int32_builder(); - DynamicTypeBuilder_ptr int64_builder = m_factory->create_int64_builder(); - - DynamicTypeBuilder_ptr union_builder = m_factory->create_union_builder(int32_builder.get()); - union_builder->add_member(0, "first", int32_builder.get(), "", { 0 }, true); - union_builder->add_member(1, "second", int64_builder.get(), "", { 1 }, false); - union_builder->set_name("SimpleUnion"); - - - DynamicTypeBuilder_ptr us_builder = m_factory->create_struct_builder(); - us_builder->add_member(0, "my_union", union_builder.get()); - us_builder->set_name("SimpleUnionStruct"); - - ASSERT_TRUE(pbType->GetDynamicType()->equals(us_builder->build().get())); - - delete(pbType); - XMLProfileManager::DeleteInstance(); - } -} - -TEST_F(DynamicTypesTests, DynamicType_XML_UnionUnionStruct_test) -{ - using namespace xmlparser; - using namespace types; - - XMLP_ret ret = XMLProfileManager::loadXMLFile(DynamicTypesTests::config_file()); - ASSERT_EQ(ret, XMLP_ret::XML_OK); - { - DynamicPubSubType* pbType = XMLProfileManager::CreateDynamicPubSubType("UnionUnionStruct"); - - DynamicTypeBuilderFactory* m_factory = DynamicTypeBuilderFactory::get_instance(); - - DynamicTypeBuilder_ptr int32_builder = m_factory->create_int32_builder(); - DynamicTypeBuilder_ptr int64_builder = m_factory->create_int64_builder(); - - DynamicTypeBuilder_ptr union_builder = m_factory->create_union_builder(int32_builder.get()); - union_builder->add_member(0, "first", int32_builder.get(), "", { 0 }, true); - union_builder->add_member(1, "second", int64_builder.get(), "", { 1 }, false); - union_builder->set_name("SimpleUnion"); - - DynamicTypeBuilder_ptr union_union_builder = m_factory->create_union_builder(int32_builder.get()); - union_union_builder->add_member(0, "first", int32_builder.get(), "", { 0 }, true); - union_union_builder->add_member(1, "second", union_builder.get(), "", { 1 }, false); - union_union_builder->set_name("UnionUnion"); - - - DynamicTypeBuilder_ptr uus_builder = m_factory->create_struct_builder(); - uus_builder->add_member(0, "my_union", union_union_builder.get()); - uus_builder->set_name("UnionUnionStruct"); - - ASSERT_TRUE(pbType->GetDynamicType()->equals(uus_builder->build().get())); - - delete(pbType); - XMLProfileManager::DeleteInstance(); - } -} - -TEST_F(DynamicTypesTests, DynamicType_XML_WCharUnionStruct_test) -{ - using namespace xmlparser; - using namespace types; - - XMLP_ret ret = XMLProfileManager::loadXMLFile(DynamicTypesTests::config_file()); - ASSERT_EQ(ret, XMLP_ret::XML_OK); - { - DynamicPubSubType* pbType = XMLProfileManager::CreateDynamicPubSubType("WCharUnionStruct"); - - DynamicTypeBuilderFactory* m_factory = DynamicTypeBuilderFactory::get_instance(); - - DynamicTypeBuilder_ptr wchar_builder = m_factory->create_char16_builder(); - DynamicTypeBuilder_ptr int32_builder = m_factory->create_int32_builder(); - DynamicTypeBuilder_ptr int64_builder = m_factory->create_int64_builder(); - - DynamicTypeBuilder_ptr union_builder = m_factory->create_union_builder(wchar_builder.get()); - union_builder->add_member(0, "first", int32_builder.get(), "", { 0 }, true); - union_builder->add_member(1, "second", int64_builder.get(), "", { 1 }, false); - union_builder->set_name("WCharUnion"); - - - DynamicTypeBuilder_ptr us_builder = m_factory->create_struct_builder(); - us_builder->add_member(0, "my_union", union_builder.get()); - us_builder->set_name("WCharUnionStruct"); - - ASSERT_TRUE(pbType->GetDynamicType()->equals(us_builder->build().get())); - - delete(pbType); - XMLProfileManager::DeleteInstance(); - } -} - -TEST_F(DynamicTypesTests, DynamicType_bounded_string_unit_tests) -{ - using namespace xmlparser; - using namespace types; - - XMLP_ret ret = XMLProfileManager::loadXMLFile(DynamicTypesTests::config_file()); - ASSERT_EQ(ret, XMLP_ret::XML_OK); - { - DynamicPubSubType* pbType = XMLProfileManager::CreateDynamicPubSubType("ShortStringStruct"); - DynamicData* data = DynamicDataFactory::get_instance()->create_data(pbType->GetDynamicType()); - - // SERIALIZATION TEST - StringStruct refData; - StringStructPubSubType refDatapb; - - uint32_t payloadSize = static_cast(pbType->getSerializedSizeProvider(data)()); - SerializedPayload_t payload(payloadSize); - SerializedPayload_t dynamic_payload(payloadSize); - ASSERT_TRUE(pbType->serialize(data, &dynamic_payload)); - ASSERT_TRUE(refDatapb.deserialize(&dynamic_payload, &refData)); - - uint32_t static_payloadSize = static_cast(refDatapb.getSerializedSizeProvider(&refData)()); - SerializedPayload_t static_payload(static_payloadSize); - ASSERT_TRUE(refDatapb.serialize(&refData, &static_payload)); - ASSERT_TRUE(static_payload.length == static_payloadSize); - ASSERT_FALSE(data->set_string_value("TEST_OVER_LENGTH_LIMITS", - MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == eprosima::fastdds::dds::RETCODE_OK); - - delete(pbType); - XMLProfileManager::DeleteInstance(); - } -} - -TEST_F(DynamicTypesTests, DynamicType_bounded_wstring_unit_tests) -{ - using namespace xmlparser; - using namespace types; - - XMLP_ret ret = XMLProfileManager::loadXMLFile(DynamicTypesTests::config_file()); - ASSERT_EQ(ret, XMLP_ret::XML_OK); - { - DynamicPubSubType* pbType = XMLProfileManager::CreateDynamicPubSubType("ShortWStringStruct"); - DynamicData* data = DynamicDataFactory::get_instance()->create_data(pbType->GetDynamicType()); - - // SERIALIZATION TEST - StringStruct refData; - StringStructPubSubType refDatapb; - - uint32_t payloadSize = static_cast(pbType->getSerializedSizeProvider(data)()); - SerializedPayload_t payload(payloadSize); - SerializedPayload_t dynamic_payload(payloadSize); - ASSERT_TRUE(pbType->serialize(data, &dynamic_payload)); - ASSERT_TRUE(refDatapb.deserialize(&dynamic_payload, &refData)); - - uint32_t static_payloadSize = static_cast(refDatapb.getSerializedSizeProvider(&refData)()); - SerializedPayload_t static_payload(static_payloadSize); - ASSERT_TRUE(refDatapb.serialize(&refData, &static_payload)); - ASSERT_TRUE(static_payload.length == static_payloadSize); - ASSERT_FALSE(data->set_string_value("TEST_OVER_LENGTH_LIMITS", - MEMBER_ID_INVALID) == eprosima::fastdds::dds::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == eprosima::fastdds::dds::RETCODE_OK); - - delete(pbType); - XMLProfileManager::DeleteInstance(); - } -} - -TEST_F(DynamicTypesTests, DynamicType_XML_Bitset_test) -{ - using namespace xmlparser; - using namespace types; - - XMLP_ret ret = XMLProfileManager::loadXMLFile(DynamicTypesTests::config_file()); - ASSERT_EQ(ret, XMLP_ret::XML_OK); - { - DynamicPubSubType* pbType = XMLProfileManager::CreateDynamicPubSubType("MyBitSet"); - - DynamicTypeBuilderFactory* m_factory = DynamicTypeBuilderFactory::get_instance(); - - DynamicTypeBuilder_ptr a_builder = m_factory->create_byte_builder(); - DynamicTypeBuilder_ptr b_builder = m_factory->create_bool_builder(); - DynamicTypeBuilder_ptr empty_builder = m_factory->create_byte_builder(); - DynamicTypeBuilder_ptr c_builder = m_factory->create_uint16_builder(); - DynamicTypeBuilder_ptr d_builder = m_factory->create_int16_builder(); - auto a_type = a_builder->build(); - auto b_type = b_builder->build(); - auto e_type = empty_builder->build(); - auto c_type = c_builder->build(); - auto d_type = d_builder->build(); - - // Bitset - DynamicTypeBuilder_ptr builder_ptr = m_factory->create_bitset_builder(); - builder_ptr->add_member(0, "a", a_type); - builder_ptr->add_member(1, "b", b_type); - builder_ptr->add_member(2, "", e_type); - builder_ptr->add_member(3, "c", c_type); - builder_ptr->add_member(4, "d", d_type); - builder_ptr->add_member(5, "", e_type); // Test more than one empty member. Trailing shouldn't affect equallity. - builder_ptr->apply_annotation_to_member(0, ANNOTATION_BIT_BOUND_ID, "value", "3"); - builder_ptr->apply_annotation_to_member(0, ANNOTATION_POSITION_ID, "value", "0"); - builder_ptr->apply_annotation_to_member(1, ANNOTATION_BIT_BOUND_ID, "value", "1"); - builder_ptr->apply_annotation_to_member(1, ANNOTATION_POSITION_ID, "value", "3"); - // The member doesn't exist so the annotation application will fail, and isn't needed. - //builder_ptr->apply_annotation_to_member(2, ANNOTATION_BIT_BOUND_ID, "value", "4"); - //builder_ptr->apply_annotation_to_member(2, ANNOTATION_POSITION_ID, "value", "4"); - builder_ptr->apply_annotation_to_member(3, ANNOTATION_BIT_BOUND_ID, "value", "10"); - builder_ptr->apply_annotation_to_member(3, ANNOTATION_POSITION_ID, "value", "8"); // 4 empty - builder_ptr->apply_annotation_to_member(4, ANNOTATION_BIT_BOUND_ID, "value", "12"); - builder_ptr->apply_annotation_to_member(4, ANNOTATION_POSITION_ID, "value", "18"); - builder_ptr->set_name("MyBitSet"); - - ASSERT_TRUE(pbType->GetDynamicType()->equals(builder_ptr->build().get())); - - delete(pbType); - XMLProfileManager::DeleteInstance(); - } -} - -TEST_F(DynamicTypesTests, DynamicType_XML_Bitmask_test) -{ - using namespace xmlparser; - using namespace types; - - XMLP_ret ret = XMLProfileManager::loadXMLFile(DynamicTypesTests::config_file()); - ASSERT_EQ(ret, XMLP_ret::XML_OK); - { - DynamicPubSubType* pbType = XMLProfileManager::CreateDynamicPubSubType("MyBitMask"); - - DynamicTypeBuilderFactory* m_factory = DynamicTypeBuilderFactory::get_instance(); - - // Bitset - DynamicTypeBuilder_ptr builder_ptr = m_factory->create_bitmask_builder(8); - builder_ptr->add_empty_member(0, "flag0"); - builder_ptr->add_empty_member(1, "flag1"); - builder_ptr->add_empty_member(2, "flag2"); - builder_ptr->add_empty_member(5, "flag5"); - builder_ptr->set_name("MyBitMask"); - - ASSERT_TRUE(pbType->GetDynamicType()->equals(builder_ptr->build().get())); - - delete(pbType); - XMLProfileManager::DeleteInstance(); - } -} - -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/dynamic_types/DynamicTypes_4_2_Tests.cpp b/test/unittest/dynamic_types/DynamicTypes_4_2_Tests.cpp deleted file mode 100644 index 35e56aed1a8..00000000000 --- a/test/unittest/dynamic_types/DynamicTypes_4_2_Tests.cpp +++ /dev/null @@ -1,465 +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 -#include -#include -#include -#include -#include -#include -#include - -#include "idl/new_features_4_2PubSubTypes.h" -#include "idl/new_features_4_2TypeObjectSupport.hpp" - -using namespace eprosima::fastrtps; -using namespace eprosima::fastrtps::rtps; -using namespace eprosima::fastrtps::types; -using namespace eprosima::fastcdr::exception; - -class DynamicTypes_4_2_Tests : public ::testing::Test -{ - const std::string config_file_ = "types_profile.xml"; - -public: - - DynamicTypes_4_2_Tests() - { - } - - ~DynamicTypes_4_2_Tests() - { - eprosima::fastdds::dds::Log::KillThread(); - } - - virtual void TearDown() override - { - DynamicDataFactory::delete_instance(); - DynamicTypeBuilderFactory::delete_instance(); - } - -}; - -TEST_F(DynamicTypes_4_2_Tests, Inheritance_And_Default_Value) -{ - StructTest struct_test; - ASSERT_TRUE(struct_test.uint64_() == 555); - ASSERT_TRUE(struct_test.int64_() == 0); -} - -TEST_F(DynamicTypes_4_2_Tests, Bitmask) -{ - using namespace bitmodule; - MyBitMask bitmask(static_cast(0)); - - ASSERT_TRUE(bitmask == static_cast(0)); - bitmask = MyBitMaskBits::flag0; - ASSERT_TRUE(bitmask == static_cast(1)); - bitmask = MyBitMaskBits::flag1; - ASSERT_TRUE(bitmask == static_cast(2)); - bitmask = MyBitMaskBits::flag4; - ASSERT_TRUE(bitmask == static_cast(16)); - bitmask = MyBitMaskBits::flag6; - ASSERT_TRUE(bitmask == static_cast(64)); - bitmask = MyBitMaskBits::flag7; - ASSERT_TRUE(bitmask == static_cast(128)); - - bitmask = static_cast(MyBitMaskBits::flag0 | MyBitMaskBits::flag4); - ASSERT_TRUE(bitmask == static_cast(17)); - - bitmask = static_cast(9); - ASSERT_TRUE(bitmask & MyBitMaskBits::flag0); - ASSERT_FALSE(bitmask & MyBitMaskBits::flag1); - ASSERT_FALSE(bitmask & MyBitMaskBits::flag4); -} - -TEST_F(DynamicTypes_4_2_Tests, Bitset) -{ - using namespace bitmodule; - MyBitset mybitset; - - ASSERT_TRUE(mybitset.a() == 0); - ASSERT_TRUE(mybitset.b() == 0); - ASSERT_TRUE(mybitset.c() == 0); - ASSERT_TRUE(mybitset.d() == 0); - ASSERT_TRUE(mybitset.e() == 0); - ASSERT_TRUE(mybitset.f() == 0); - ASSERT_TRUE(mybitset.parent_bitfield() == 0); - - mybitset.a(static_cast(15)); // 00001111 - ASSERT_TRUE(mybitset.a() == 7); // 00000111 - ASSERT_TRUE(mybitset.b() == 0); // b unaffected - ASSERT_FALSE(mybitset.b()); - mybitset.b(true); - ASSERT_TRUE(mybitset.b()); - mybitset.c(static_cast(-1));// 1111111111111111 - ASSERT_TRUE(mybitset.c() == 1023); // 0000001111111111 (2^10 - 1) - mybitset.d(-1); // 1111111111111111 - mybitset.e(5555); // 0001010110110011 (The most significant bit is not stored) - mybitset.f(3851); - ASSERT_TRUE(mybitset.d() == 31); // 0000111111111111 (2^12 - 1) - ASSERT_TRUE(mybitset.e() == 19); // 0000010110110011 (The most significant bit is not stored) - ASSERT_TRUE(mybitset.f() == 11); - mybitset.parent_bitfield(static_cast(-1));// 11111111111111111111111111111111 - ASSERT_TRUE(mybitset.parent_bitfield() == 131071); // 00000000000000111111111111111111 (2^17 - 1) -} - -TEST_F(DynamicTypes_4_2_Tests, Non_Serialized_Annotation) -{ - NewAliases struct_test; - struct_test.int8_(-8); - struct_test.uint8_(8); - struct_test.int16_(-16); - struct_test.uint16_(16); - struct_test.int32_(-32); - struct_test.uint32_(32); - struct_test.int64_(-64); - struct_test.uint64_(64); - struct_test.local_string("DON'T_SERIALIZE"); - - NewAliasesPubSubType pst; - NewAliases destination; - uint32_t payloadSize = static_cast(pst.getSerializedSizeProvider(&struct_test)()); - SerializedPayload_t payload(payloadSize); - - pst.serialize(&struct_test, &payload); - pst.deserialize(&payload, &destination); - - ASSERT_TRUE(destination.int8_() == -8); - ASSERT_TRUE(destination.uint8_() == 8); - ASSERT_TRUE(destination.int16_() == -16); - ASSERT_TRUE(destination.uint16_() == 16); - ASSERT_TRUE(destination.int32_() == -32); - ASSERT_TRUE(destination.uint32_() == 32); - ASSERT_TRUE(destination.int64_() == -64); - ASSERT_TRUE(destination.uint64_() == 64); - ASSERT_FALSE(destination.local_string() == "DON'T_SERIALIZE"); // Is non_serialized annotated -} - -TEST_F(DynamicTypes_4_2_Tests, New_Union_Discriminators) -{ - StructTest struct_test; - - ASSERT_TRUE(sizeof(struct_test.int8Union()._d()) == 1); - ASSERT_TRUE(sizeof(struct_test.octetUnion()._d()) == 1); - //ASSERT_TRUE(sizeof(struct_test.charUnion()._d()) == sizeof(wchar_t)); - - // int8Union - struct_test.int8Union().case_three(333); - struct_test.int8Union().case_six(666); - - struct_test.int8Union()._d() = 3; - ASSERT_TRUE(struct_test.int8Union().case_three() == 333); - try - { - ASSERT_FALSE(struct_test.int8Union().case_six() == 666); - ASSERT_TRUE(false); - } - catch (const BadParamException&) - { - } - - struct_test.int8Union()._d() = 6; - try - { - ASSERT_FALSE(struct_test.int8Union().case_three() == 333); - ASSERT_TRUE(false); - } - catch (const BadParamException&) - { - } - ASSERT_TRUE(struct_test.int8Union().case_six() == 666); - - // octetUnion - struct_test.octetUnion().case_five(555); - struct_test.octetUnion().case_seven(777); - - struct_test.octetUnion()._d() = 5; - ASSERT_TRUE(struct_test.octetUnion().case_five() == 555); - try - { - ASSERT_FALSE(struct_test.octetUnion().case_seven() == 777); - ASSERT_TRUE(false); - } - catch (const BadParamException&) - { - } - - struct_test.octetUnion()._d() = 7; - try - { - ASSERT_FALSE(struct_test.octetUnion().case_five() == 555); - ASSERT_TRUE(false); - } - catch (const BadParamException&) - { - } - ASSERT_TRUE(struct_test.octetUnion().case_seven() == 777); - - /* - // charUnion - struct_test.charUnion().case_zero(111); - struct_test.charUnion().case_one(222); - - struct_test.charUnion()._d() = L'a'; - ASSERT_TRUE(struct_test.charUnion().case_zero() == 111); - try - { - ASSERT_FALSE(struct_test.charUnion().case_one() == 222); - ASSERT_TRUE(false); - } - catch (const BadParamException&) - { - } - - struct_test.charUnion()._d() = L'b'; - try - { - ASSERT_FALSE(struct_test.charUnion().case_zero() == 111); - ASSERT_TRUE(false); - } - catch (const BadParamException&) - { - } - ASSERT_TRUE(struct_test.charUnion().case_one() == 222); - */ -} - -/* TODO(jlbueno): XTypes v1.3 PENDING implementation DynamicTypeBuilderFactory::create_type_w_type_object - TEST_F(DynamicTypes_4_2_Tests, TypeObject_DynamicType_Conversion) - { - register_new_features_4_2_type_objects(); - - // TODO Bitset serialization isn't compatible. - const TypeIdentifier* identifier = GetStructTestIdentifier(true); - const TypeObject* object = GetCompleteStructTestObject(); - - DynamicType_ptr dyn_type = - TypeObjectFactory::get_instance()->build_dynamic_type("StructTest", identifier, object); - - TypeIdentifier conv_identifier; - TypeObject conv_object; - DynamicTypeBuilderFactory::get_instance()->build_type_object(dyn_type, conv_object, true, true); // Avoid factory - DynamicTypeBuilderFactory::get_instance()->build_type_identifier(dyn_type, conv_identifier, true); - - ASSERT_TRUE(*identifier == conv_identifier); - //ASSERT_TRUE(*object == conv_object); //TODO(richiware) Fails because not implemented get appendable flag to - //dynamic_type in `build_dynamic_type()`. - - // Serialize static <-> dynamic - - StructTest struct_test; - DynamicData_ptr dyn_data(DynamicDataFactory::get_instance()->create_data(dyn_type)); - - DynamicPubSubType pst_dynamic(dyn_type); - uint32_t payload_dyn_size = static_cast(pst_dynamic.getSerializedSizeProvider(dyn_data.get())()); - SerializedPayload_t payload(payload_dyn_size); - ASSERT_TRUE(pst_dynamic.serialize(dyn_data.get(), &payload)); - ASSERT_TRUE(payload.length == payload_dyn_size); - - StructTestPubSubType pst_static; - uint32_t payload_size = static_cast(pst_static.getSerializedSizeProvider(&struct_test)()); - SerializedPayload_t st_payload(payload_size); - ASSERT_TRUE(pst_static.serialize(&struct_test, &st_payload)); - ASSERT_TRUE(st_payload.length == payload_size); - - DynamicData_ptr dyn_data_from_dynamic(DynamicDataFactory::get_instance()->create_data(dyn_type)); - ASSERT_TRUE(pst_dynamic.deserialize(&payload, dyn_data_from_dynamic.get())); - - types::DynamicData_ptr dyn_data_from_static(DynamicDataFactory::get_instance()->create_data(dyn_type)); - //ASSERT_TRUE(pst_dynamic.deserialize(&st_payload, dyn_data_from_static.get())); //TODO(richiware) Bitsets are not - //serialized correctly currently by DynamicData. - //dynamic_type in `build_dynamic_type()`. - - // DEBUG Printing payloads - */ -/* - std::cout << "Payload: " << std::endl; - for (int i = 0; i < payload_size; ++i) - { - std::cout << std::hex << (uint32_t)(payload.data[i]) << " "; - } - std::cout << std::endl; - std::cout << "ST_Payload: " << std::endl; - for (int i = 0; i < st_payload.length; ++i) - { - std::cout << std::hex << (uint32_t)(st_payload.data[i]) << " "; - } - std::cout << "--------------------------" << std::endl; - */ -/* - ASSERT_TRUE(dyn_data_from_static->equals(dyn_data_from_dynamic.get())); - } - */ - -/* TODO(richiware) Bitsets are not serialized correctly currently by DynamicData. - TEST_F(DynamicTypes_4_2_Tests, Static_Dynamic_Values) - { - register_new_features_4_2_type_objects(); - - const TypeIdentifier* identifier = GetStructTestIdentifier(true); - const TypeObject* object = GetCompleteStructTestObject(); - - DynamicType_ptr dyn_type = - TypeObjectFactory::get_instance()->build_dynamic_type("StructTest", identifier, object); - - // Serialize static initialization with values - StructTest struct_test; - StructTestPubSubType pst_static; - - struct_test.int8_(-8); - struct_test.uint8_(8); - struct_test.int16_(-16); - struct_test.uint16_(16); - struct_test.int32_(-32); - struct_test.uint32_(32); - struct_test.int64_(-64); - struct_test.uint64_(64); - struct_test.local_string("DON'T_SERIALIZE"); - struct_test.charUnion().case_one(11111); - struct_test.octetUnion().case_seven(77777); - struct_test.int8Union().case_three(33333); - struct_test.myStructBits().mybitset().parent_bitfield(2121); - struct_test.myStructBits().mybitset().a(5); - struct_test.myStructBits().mybitset().b(true); - struct_test.myStructBits().mybitset().c(333); - struct_test.myStructBits().mybitset().d(4000); - struct_test.myStructBits().mybitset().e(4001); - struct_test.myStructBits().mybitset().f(3001); - struct_test.myStructBits().mybitmask( - static_cast(bitmodule::MyBitMaskBits::flag0 | bitmodule::MyBitMaskBits::flag4)); - struct_test.myStructBits().two( - static_cast(bitmodule::MyBitMaskBits::flag1 | bitmodule::MyBitMaskBits::flag6)); - struct_test.myStructBits().mylong(static_cast(struct_test.myStructBits().two())); - - // Static serialization - uint32_t payload_size = static_cast(pst_static.getSerializedSizeProvider(&struct_test)()); - SerializedPayload_t st_payload(payload_size); - ASSERT_TRUE(pst_static.serialize(&struct_test, &st_payload)); - ASSERT_TRUE(st_payload.length == payload_size); - - // Dynamic deserialization from static - DynamicPubSubType pst_dynamic(dyn_type); - DynamicData_ptr dyn_data(DynamicDataFactory::get_instance()->create_data(dyn_type)); - ASSERT_TRUE(pst_dynamic.deserialize(&st_payload, dyn_data.get())); - - - // Dynamic serialization - uint32_t payload_dyn_size = static_cast(pst_dynamic.getSerializedSizeProvider(dyn_data.get())()); - SerializedPayload_t dyn_payload(payload_dyn_size); - ASSERT_TRUE(pst_dynamic.serialize(dyn_data.get(), &dyn_payload)); - ASSERT_TRUE(dyn_payload.length == payload_dyn_size); - - // Static deserialization from dynamic - StructTest struct_test_from_dynamic; - ASSERT_TRUE(pst_static.deserialize(&dyn_payload, &struct_test_from_dynamic)); - - // Check values - ASSERT_TRUE(struct_test_from_dynamic.int8_() == struct_test.int8_()); - ASSERT_TRUE(struct_test_from_dynamic.uint8_() == struct_test.uint8_()); - ASSERT_TRUE(struct_test_from_dynamic.int16_() == struct_test.int16_()); - ASSERT_TRUE(struct_test_from_dynamic.uint16_() == struct_test.uint16_()); - ASSERT_TRUE(struct_test_from_dynamic.int32_() == struct_test.int32_()); - ASSERT_TRUE(struct_test_from_dynamic.uint32_() == struct_test.uint32_()); - ASSERT_TRUE(struct_test_from_dynamic.int64_() == struct_test.int64_()); - ASSERT_TRUE(struct_test_from_dynamic.uint64_() == struct_test.uint64_()); - ASSERT_FALSE(struct_test_from_dynamic.local_string() == struct_test.local_string()); // Non serialized - //ASSERT_TRUE(struct_test_from_dynamic.charUnion().case_one() == struct_test.charUnion().case_one()); - ASSERT_TRUE(struct_test_from_dynamic.octetUnion().case_seven() == struct_test.octetUnion().case_seven()); - ASSERT_TRUE(struct_test_from_dynamic.int8Union().case_three() == struct_test.int8Union().case_three()); - ASSERT_TRUE( - struct_test_from_dynamic.myStructBits().mybitset().parent_bitfield() == - struct_test.myStructBits().mybitset().parent_bitfield()); - ASSERT_TRUE(struct_test_from_dynamic.myStructBits().mybitset().a() == struct_test.myStructBits().mybitset().a()); - ASSERT_TRUE(struct_test_from_dynamic.myStructBits().mybitset().b() == struct_test.myStructBits().mybitset().b()); - ASSERT_TRUE(struct_test_from_dynamic.myStructBits().mybitset().c() == struct_test.myStructBits().mybitset().c()); - ASSERT_TRUE(struct_test_from_dynamic.myStructBits().mybitset().d() == struct_test.myStructBits().mybitset().d()); - ASSERT_TRUE(struct_test_from_dynamic.myStructBits().mybitset().e() == struct_test.myStructBits().mybitset().e()); - ASSERT_TRUE(struct_test_from_dynamic.myStructBits().mybitset().f() == struct_test.myStructBits().mybitset().f()); - ASSERT_TRUE(struct_test_from_dynamic.myStructBits().mybitmask() == struct_test.myStructBits().mybitmask()); - ASSERT_TRUE(struct_test_from_dynamic.myStructBits().two() == struct_test.myStructBits().two()); - ASSERT_TRUE(struct_test_from_dynamic.myStructBits().mylong() == struct_test.myStructBits().mylong()); - - ASSERT_TRUE(dyn_data->get_int8_value(dyn_data->get_member_id_by_name("int8_")) == struct_test.int8_()); - ASSERT_TRUE(dyn_data->get_uint8_value(dyn_data->get_member_id_by_name("uint8_")) == struct_test.uint8_()); - ASSERT_TRUE(dyn_data->get_int16_value(dyn_data->get_member_id_by_name("int16_")) == struct_test.int16_()); - ASSERT_TRUE(dyn_data->get_uint16_value(dyn_data->get_member_id_by_name("uint16_")) == struct_test.uint16_()); - ASSERT_TRUE(dyn_data->get_int32_value(dyn_data->get_member_id_by_name("int32_")) == struct_test.int32_()); - ASSERT_TRUE(dyn_data->get_uint32_value(dyn_data->get_member_id_by_name("uint32_")) == struct_test.uint32_()); - ASSERT_TRUE(dyn_data->get_int64_value(dyn_data->get_member_id_by_name("int64_")) == struct_test.int64_()); - ASSERT_TRUE(dyn_data->get_uint64_value(dyn_data->get_member_id_by_name("uint64_")) == struct_test.uint64_()); - ASSERT_FALSE(dyn_data->get_string_value(dyn_data->get_member_id_by_name("local_string")) == - struct_test.local_string()); // Non serialized - - DynamicData* charUnion = dyn_data->loan_value(dyn_data->get_member_id_by_name("charUnion")); - ASSERT_TRUE(charUnion->get_int32_value(charUnion->get_member_id_by_name("case_one")) == - struct_test.charUnion().case_one()); - dyn_data->return_loaned_value(charUnion); - - DynamicData* octetUnion = dyn_data->loan_value(dyn_data->get_member_id_by_name("octetUnion")); - ASSERT_TRUE(octetUnion->get_int32_value(octetUnion->get_member_id_by_name("case_seven")) == - struct_test.octetUnion().case_seven()); - dyn_data->return_loaned_value(octetUnion); - - DynamicData* int8Union = dyn_data->loan_value(dyn_data->get_member_id_by_name("int8Union")); - ASSERT_TRUE(int8Union->get_int32_value(int8Union->get_member_id_by_name("case_three")) == - struct_test.int8Union().case_three()); - dyn_data->return_loaned_value(int8Union); - - DynamicData* myStructBits = dyn_data->loan_value(dyn_data->get_member_id_by_name("myStructBits")); - DynamicData* mybitset = myStructBits->loan_value(myStructBits->get_member_id_by_name("mybitset")); - - ASSERT_TRUE(mybitset->get_uint32_value(mybitset->get_member_id_by_name("parent_bitfield")) - == struct_test.myStructBits().mybitset().parent_bitfield()); - ASSERT_TRUE(mybitset->get_char8_value(mybitset->get_member_id_by_name("a")) - == struct_test.myStructBits().mybitset().a()); - ASSERT_TRUE(mybitset->get_bool_value(mybitset->get_member_id_by_name("b")) - == struct_test.myStructBits().mybitset().b()); - ASSERT_TRUE(mybitset->get_uint16_value(mybitset->get_member_id_by_name("c")) - == struct_test.myStructBits().mybitset().c()); - ASSERT_TRUE(mybitset->get_int16_value(mybitset->get_member_id_by_name("d")) - == struct_test.myStructBits().mybitset().d()); - ASSERT_TRUE(mybitset->get_int16_value(mybitset->get_member_id_by_name("e")) - == struct_test.myStructBits().mybitset().e()); - ASSERT_TRUE(mybitset->get_int16_value(mybitset->get_member_id_by_name("f")) - == struct_test.myStructBits().mybitset().f()); - - myStructBits->return_loaned_value(mybitset); - ASSERT_TRUE(myStructBits->get_uint64_value(myStructBits->get_member_id_by_name("mybitmask")) == - struct_test.myStructBits().mybitmask()); - ASSERT_TRUE(myStructBits->get_uint64_value(myStructBits->get_member_id_by_name("two")) == - struct_test.myStructBits().two()); - ASSERT_TRUE(myStructBits->get_int32_value(myStructBits->get_member_id_by_name("mylong")) == - struct_test.myStructBits().mylong()); - dyn_data->return_loaned_value(myStructBits); - } - */ - -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/dynamic_types/idl/Basic.hpp b/test/unittest/dynamic_types/idl/Basic.hpp deleted file mode 100644 index fcf1a2536ba..00000000000 --- a/test/unittest/dynamic_types/idl/Basic.hpp +++ /dev/null @@ -1,5545 +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 Basic.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_BASIC_HPP_ -#define _FAST_DDS_GENERATED_BASIC_HPP_ - -#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(BASIC_SOURCE) -#define BASIC_DllAPI __declspec( dllexport ) -#else -#define BASIC_DllAPI __declspec( dllimport ) -#endif // BASIC_SOURCE -#else -#define BASIC_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define BASIC_DllAPI -#endif // _WIN32 - -/*! - * @brief This class represents the enumeration MyEnum defined by the user in the IDL file. - * @ingroup Basic - */ -enum class MyEnum : uint32_t -{ - A, - B, - C -}; -typedef MyEnum MyAliasEnum; - -typedef MyAliasEnum MyAliasAliasEnum; - -/*! - * @brief This class represents the structure EnumStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class EnumStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport EnumStruct() - { - } - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~EnumStruct() - { - } - - /*! - * @brief Copy constructor. - * @param x Reference to the object EnumStruct that will be copied. - */ - eProsima_user_DllExport EnumStruct( - const EnumStruct& x) - { - m_my_enum = x.m_my_enum; - - } - - /*! - * @brief Move constructor. - * @param x Reference to the object EnumStruct that will be copied. - */ - eProsima_user_DllExport EnumStruct( - EnumStruct&& x) noexcept - { - m_my_enum = x.m_my_enum; - } - - /*! - * @brief Copy assignment. - * @param x Reference to the object EnumStruct that will be copied. - */ - eProsima_user_DllExport EnumStruct& operator =( - const EnumStruct& x) - { - - m_my_enum = x.m_my_enum; - - return *this; - } - - /*! - * @brief Move assignment. - * @param x Reference to the object EnumStruct that will be copied. - */ - eProsima_user_DllExport EnumStruct& operator =( - EnumStruct&& x) noexcept - { - - m_my_enum = x.m_my_enum; - return *this; - } - - /*! - * @brief Comparison operator. - * @param x EnumStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const EnumStruct& x) const - { - return (m_my_enum == x.m_my_enum); - } - - /*! - * @brief Comparison operator. - * @param x EnumStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const EnumStruct& x) const - { - return !(*this == x); - } - - /*! - * @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) - { - m_my_enum = _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 - { - return m_my_enum; - } - - /*! - * @brief This function returns a reference to member my_enum - * @return Reference to member my_enum - */ - eProsima_user_DllExport MyEnum& my_enum() - { - return m_my_enum; - } - - - -private: - - MyEnum m_my_enum{MyEnum::A}; - -}; -/*! - * @brief This class represents the structure AliasStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class AliasStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport AliasStruct() - { - } - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~AliasStruct() - { - } - - /*! - * @brief Copy constructor. - * @param x Reference to the object AliasStruct that will be copied. - */ - eProsima_user_DllExport AliasStruct( - const AliasStruct& x) - { - m_my_alias = x.m_my_alias; - - } - - /*! - * @brief Move constructor. - * @param x Reference to the object AliasStruct that will be copied. - */ - eProsima_user_DllExport AliasStruct( - AliasStruct&& x) noexcept - { - m_my_alias = x.m_my_alias; - } - - /*! - * @brief Copy assignment. - * @param x Reference to the object AliasStruct that will be copied. - */ - eProsima_user_DllExport AliasStruct& operator =( - const AliasStruct& x) - { - - m_my_alias = x.m_my_alias; - - return *this; - } - - /*! - * @brief Move assignment. - * @param x Reference to the object AliasStruct that will be copied. - */ - eProsima_user_DllExport AliasStruct& operator =( - AliasStruct&& x) noexcept - { - - m_my_alias = x.m_my_alias; - return *this; - } - - /*! - * @brief Comparison operator. - * @param x AliasStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const AliasStruct& x) const - { - return (m_my_alias == x.m_my_alias); - } - - /*! - * @brief Comparison operator. - * @param x AliasStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const AliasStruct& x) const - { - return !(*this == x); - } - - /*! - * @brief This function sets a value in member my_alias - * @param _my_alias New value for member my_alias - */ - eProsima_user_DllExport void my_alias( - MyAliasEnum _my_alias) - { - m_my_alias = _my_alias; - } - - /*! - * @brief This function returns the value of member my_alias - * @return Value of member my_alias - */ - eProsima_user_DllExport MyAliasEnum my_alias() const - { - return m_my_alias; - } - - /*! - * @brief This function returns a reference to member my_alias - * @return Reference to member my_alias - */ - eProsima_user_DllExport MyAliasEnum& my_alias() - { - return m_my_alias; - } - - - -private: - - MyAliasEnum m_my_alias{MyEnum::A}; - -}; -/*! - * @brief This class represents the structure AliasAliasStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class AliasAliasStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport AliasAliasStruct() - { - } - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~AliasAliasStruct() - { - } - - /*! - * @brief Copy constructor. - * @param x Reference to the object AliasAliasStruct that will be copied. - */ - eProsima_user_DllExport AliasAliasStruct( - const AliasAliasStruct& x) - { - m_my_alias_alias = x.m_my_alias_alias; - - } - - /*! - * @brief Move constructor. - * @param x Reference to the object AliasAliasStruct that will be copied. - */ - eProsima_user_DllExport AliasAliasStruct( - AliasAliasStruct&& x) noexcept - { - m_my_alias_alias = x.m_my_alias_alias; - } - - /*! - * @brief Copy assignment. - * @param x Reference to the object AliasAliasStruct that will be copied. - */ - eProsima_user_DllExport AliasAliasStruct& operator =( - const AliasAliasStruct& x) - { - - m_my_alias_alias = x.m_my_alias_alias; - - return *this; - } - - /*! - * @brief Move assignment. - * @param x Reference to the object AliasAliasStruct that will be copied. - */ - eProsima_user_DllExport AliasAliasStruct& operator =( - AliasAliasStruct&& x) noexcept - { - - m_my_alias_alias = x.m_my_alias_alias; - return *this; - } - - /*! - * @brief Comparison operator. - * @param x AliasAliasStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const AliasAliasStruct& x) const - { - return (m_my_alias_alias == x.m_my_alias_alias); - } - - /*! - * @brief Comparison operator. - * @param x AliasAliasStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const AliasAliasStruct& x) const - { - return !(*this == x); - } - - /*! - * @brief This function sets a value in member my_alias_alias - * @param _my_alias_alias New value for member my_alias_alias - */ - eProsima_user_DllExport void my_alias_alias( - MyAliasAliasEnum _my_alias_alias) - { - m_my_alias_alias = _my_alias_alias; - } - - /*! - * @brief This function returns the value of member my_alias_alias - * @return Value of member my_alias_alias - */ - eProsima_user_DllExport MyAliasAliasEnum my_alias_alias() const - { - return m_my_alias_alias; - } - - /*! - * @brief This function returns a reference to member my_alias_alias - * @return Reference to member my_alias_alias - */ - eProsima_user_DllExport MyAliasAliasEnum& my_alias_alias() - { - return m_my_alias_alias; - } - - - -private: - - MyAliasAliasEnum m_my_alias_alias{MyEnum::A}; - -}; -/*! - * @brief This class represents the structure BoolStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class BoolStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport BoolStruct() - { - } - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~BoolStruct() - { - } - - /*! - * @brief Copy constructor. - * @param x Reference to the object BoolStruct that will be copied. - */ - eProsima_user_DllExport BoolStruct( - const BoolStruct& x) - { - m_my_bool = x.m_my_bool; - - } - - /*! - * @brief Move constructor. - * @param x Reference to the object BoolStruct that will be copied. - */ - eProsima_user_DllExport BoolStruct( - BoolStruct&& x) noexcept - { - m_my_bool = x.m_my_bool; - } - - /*! - * @brief Copy assignment. - * @param x Reference to the object BoolStruct that will be copied. - */ - eProsima_user_DllExport BoolStruct& operator =( - const BoolStruct& x) - { - - m_my_bool = x.m_my_bool; - - return *this; - } - - /*! - * @brief Move assignment. - * @param x Reference to the object BoolStruct that will be copied. - */ - eProsima_user_DllExport BoolStruct& operator =( - BoolStruct&& x) noexcept - { - - m_my_bool = x.m_my_bool; - return *this; - } - - /*! - * @brief Comparison operator. - * @param x BoolStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const BoolStruct& x) const - { - return (m_my_bool == x.m_my_bool); - } - - /*! - * @brief Comparison operator. - * @param x BoolStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const BoolStruct& x) const - { - return !(*this == x); - } - - /*! - * @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) - { - m_my_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 - { - return m_my_bool; - } - - /*! - * @brief This function returns a reference to member my_bool - * @return Reference to member my_bool - */ - eProsima_user_DllExport bool& my_bool() - { - return m_my_bool; - } - - - -private: - - bool m_my_bool{false}; - -}; -/*! - * @brief This class represents the structure OctetStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class OctetStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport OctetStruct() - { - } - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~OctetStruct() - { - } - - /*! - * @brief Copy constructor. - * @param x Reference to the object OctetStruct that will be copied. - */ - eProsima_user_DllExport OctetStruct( - const OctetStruct& x) - { - m_my_octet = x.m_my_octet; - - } - - /*! - * @brief Move constructor. - * @param x Reference to the object OctetStruct that will be copied. - */ - eProsima_user_DllExport OctetStruct( - OctetStruct&& x) noexcept - { - m_my_octet = x.m_my_octet; - } - - /*! - * @brief Copy assignment. - * @param x Reference to the object OctetStruct that will be copied. - */ - eProsima_user_DllExport OctetStruct& operator =( - const OctetStruct& x) - { - - m_my_octet = x.m_my_octet; - - return *this; - } - - /*! - * @brief Move assignment. - * @param x Reference to the object OctetStruct that will be copied. - */ - eProsima_user_DllExport OctetStruct& operator =( - OctetStruct&& x) noexcept - { - - m_my_octet = x.m_my_octet; - return *this; - } - - /*! - * @brief Comparison operator. - * @param x OctetStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const OctetStruct& x) const - { - return (m_my_octet == x.m_my_octet); - } - - /*! - * @brief Comparison operator. - * @param x OctetStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const OctetStruct& x) const - { - return !(*this == x); - } - - /*! - * @brief This function sets a value in member my_octet - * @param _my_octet New value for member my_octet - */ - eProsima_user_DllExport void my_octet( - uint8_t _my_octet) - { - m_my_octet = _my_octet; - } - - /*! - * @brief This function returns the value of member my_octet - * @return Value of member my_octet - */ - eProsima_user_DllExport uint8_t my_octet() const - { - return m_my_octet; - } - - /*! - * @brief This function returns a reference to member my_octet - * @return Reference to member my_octet - */ - eProsima_user_DllExport uint8_t& my_octet() - { - return m_my_octet; - } - - - -private: - - uint8_t m_my_octet{0}; - -}; -/*! - * @brief This class represents the structure ShortStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class ShortStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport ShortStruct() - { - } - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~ShortStruct() - { - } - - /*! - * @brief Copy constructor. - * @param x Reference to the object ShortStruct that will be copied. - */ - eProsima_user_DllExport ShortStruct( - const ShortStruct& x) - { - m_my_int16 = x.m_my_int16; - - } - - /*! - * @brief Move constructor. - * @param x Reference to the object ShortStruct that will be copied. - */ - eProsima_user_DllExport ShortStruct( - ShortStruct&& x) noexcept - { - m_my_int16 = x.m_my_int16; - } - - /*! - * @brief Copy assignment. - * @param x Reference to the object ShortStruct that will be copied. - */ - eProsima_user_DllExport ShortStruct& operator =( - const ShortStruct& x) - { - - m_my_int16 = x.m_my_int16; - - return *this; - } - - /*! - * @brief Move assignment. - * @param x Reference to the object ShortStruct that will be copied. - */ - eProsima_user_DllExport ShortStruct& operator =( - ShortStruct&& x) noexcept - { - - m_my_int16 = x.m_my_int16; - return *this; - } - - /*! - * @brief Comparison operator. - * @param x ShortStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const ShortStruct& x) const - { - return (m_my_int16 == x.m_my_int16); - } - - /*! - * @brief Comparison operator. - * @param x ShortStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const ShortStruct& x) const - { - return !(*this == x); - } - - /*! - * @brief This function sets a value in member my_int16 - * @param _my_int16 New value for member my_int16 - */ - eProsima_user_DllExport void my_int16( - int16_t _my_int16) - { - m_my_int16 = _my_int16; - } - - /*! - * @brief This function returns the value of member my_int16 - * @return Value of member my_int16 - */ - eProsima_user_DllExport int16_t my_int16() const - { - return m_my_int16; - } - - /*! - * @brief This function returns a reference to member my_int16 - * @return Reference to member my_int16 - */ - eProsima_user_DllExport int16_t& my_int16() - { - return m_my_int16; - } - - - -private: - - int16_t m_my_int16{0}; - -}; -/*! - * @brief This class represents the structure LongStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class LongStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport LongStruct() - { - } - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~LongStruct() - { - } - - /*! - * @brief Copy constructor. - * @param x Reference to the object LongStruct that will be copied. - */ - eProsima_user_DllExport LongStruct( - const LongStruct& x) - { - m_my_int32 = x.m_my_int32; - - } - - /*! - * @brief Move constructor. - * @param x Reference to the object LongStruct that will be copied. - */ - eProsima_user_DllExport LongStruct( - LongStruct&& x) noexcept - { - m_my_int32 = x.m_my_int32; - } - - /*! - * @brief Copy assignment. - * @param x Reference to the object LongStruct that will be copied. - */ - eProsima_user_DllExport LongStruct& operator =( - const LongStruct& x) - { - - m_my_int32 = x.m_my_int32; - - return *this; - } - - /*! - * @brief Move assignment. - * @param x Reference to the object LongStruct that will be copied. - */ - eProsima_user_DllExport LongStruct& operator =( - LongStruct&& x) noexcept - { - - m_my_int32 = x.m_my_int32; - return *this; - } - - /*! - * @brief Comparison operator. - * @param x LongStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const LongStruct& x) const - { - return (m_my_int32 == x.m_my_int32); - } - - /*! - * @brief Comparison operator. - * @param x LongStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const LongStruct& x) const - { - return !(*this == x); - } - - /*! - * @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) - { - m_my_int32 = _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 - { - return m_my_int32; - } - - /*! - * @brief This function returns a reference to member my_int32 - * @return Reference to member my_int32 - */ - eProsima_user_DllExport int32_t& my_int32() - { - return m_my_int32; - } - - - -private: - - int32_t m_my_int32{0}; - -}; -/*! - * @brief This class represents the structure LongLongStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class LongLongStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport LongLongStruct() - { - } - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~LongLongStruct() - { - } - - /*! - * @brief Copy constructor. - * @param x Reference to the object LongLongStruct that will be copied. - */ - eProsima_user_DllExport LongLongStruct( - const LongLongStruct& x) - { - m_my_int64 = x.m_my_int64; - - } - - /*! - * @brief Move constructor. - * @param x Reference to the object LongLongStruct that will be copied. - */ - eProsima_user_DllExport LongLongStruct( - LongLongStruct&& x) noexcept - { - m_my_int64 = x.m_my_int64; - } - - /*! - * @brief Copy assignment. - * @param x Reference to the object LongLongStruct that will be copied. - */ - eProsima_user_DllExport LongLongStruct& operator =( - const LongLongStruct& x) - { - - m_my_int64 = x.m_my_int64; - - return *this; - } - - /*! - * @brief Move assignment. - * @param x Reference to the object LongLongStruct that will be copied. - */ - eProsima_user_DllExport LongLongStruct& operator =( - LongLongStruct&& x) noexcept - { - - m_my_int64 = x.m_my_int64; - return *this; - } - - /*! - * @brief Comparison operator. - * @param x LongLongStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const LongLongStruct& x) const - { - return (m_my_int64 == x.m_my_int64); - } - - /*! - * @brief Comparison operator. - * @param x LongLongStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const LongLongStruct& x) const - { - return !(*this == x); - } - - /*! - * @brief This function sets a value in member my_int64 - * @param _my_int64 New value for member my_int64 - */ - eProsima_user_DllExport void my_int64( - int64_t _my_int64) - { - m_my_int64 = _my_int64; - } - - /*! - * @brief This function returns the value of member my_int64 - * @return Value of member my_int64 - */ - eProsima_user_DllExport int64_t my_int64() const - { - return m_my_int64; - } - - /*! - * @brief This function returns a reference to member my_int64 - * @return Reference to member my_int64 - */ - eProsima_user_DllExport int64_t& my_int64() - { - return m_my_int64; - } - - - -private: - - int64_t m_my_int64{0}; - -}; -/*! - * @brief This class represents the structure UShortStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class UShortStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport UShortStruct() - { - } - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~UShortStruct() - { - } - - /*! - * @brief Copy constructor. - * @param x Reference to the object UShortStruct that will be copied. - */ - eProsima_user_DllExport UShortStruct( - const UShortStruct& x) - { - m_my_uint16 = x.m_my_uint16; - - } - - /*! - * @brief Move constructor. - * @param x Reference to the object UShortStruct that will be copied. - */ - eProsima_user_DllExport UShortStruct( - UShortStruct&& x) noexcept - { - m_my_uint16 = x.m_my_uint16; - } - - /*! - * @brief Copy assignment. - * @param x Reference to the object UShortStruct that will be copied. - */ - eProsima_user_DllExport UShortStruct& operator =( - const UShortStruct& x) - { - - m_my_uint16 = x.m_my_uint16; - - return *this; - } - - /*! - * @brief Move assignment. - * @param x Reference to the object UShortStruct that will be copied. - */ - eProsima_user_DllExport UShortStruct& operator =( - UShortStruct&& x) noexcept - { - - m_my_uint16 = x.m_my_uint16; - return *this; - } - - /*! - * @brief Comparison operator. - * @param x UShortStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const UShortStruct& x) const - { - return (m_my_uint16 == x.m_my_uint16); - } - - /*! - * @brief Comparison operator. - * @param x UShortStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const UShortStruct& x) const - { - return !(*this == x); - } - - /*! - * @brief This function sets a value in member my_uint16 - * @param _my_uint16 New value for member my_uint16 - */ - eProsima_user_DllExport void my_uint16( - uint16_t _my_uint16) - { - m_my_uint16 = _my_uint16; - } - - /*! - * @brief This function returns the value of member my_uint16 - * @return Value of member my_uint16 - */ - eProsima_user_DllExport uint16_t my_uint16() const - { - return m_my_uint16; - } - - /*! - * @brief This function returns a reference to member my_uint16 - * @return Reference to member my_uint16 - */ - eProsima_user_DllExport uint16_t& my_uint16() - { - return m_my_uint16; - } - - - -private: - - uint16_t m_my_uint16{0}; - -}; -/*! - * @brief This class represents the structure ULongStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class ULongStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport ULongStruct() - { - } - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~ULongStruct() - { - } - - /*! - * @brief Copy constructor. - * @param x Reference to the object ULongStruct that will be copied. - */ - eProsima_user_DllExport ULongStruct( - const ULongStruct& x) - { - m_my_uint32 = x.m_my_uint32; - - } - - /*! - * @brief Move constructor. - * @param x Reference to the object ULongStruct that will be copied. - */ - eProsima_user_DllExport ULongStruct( - ULongStruct&& x) noexcept - { - m_my_uint32 = x.m_my_uint32; - } - - /*! - * @brief Copy assignment. - * @param x Reference to the object ULongStruct that will be copied. - */ - eProsima_user_DllExport ULongStruct& operator =( - const ULongStruct& x) - { - - m_my_uint32 = x.m_my_uint32; - - return *this; - } - - /*! - * @brief Move assignment. - * @param x Reference to the object ULongStruct that will be copied. - */ - eProsima_user_DllExport ULongStruct& operator =( - ULongStruct&& x) noexcept - { - - m_my_uint32 = x.m_my_uint32; - return *this; - } - - /*! - * @brief Comparison operator. - * @param x ULongStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const ULongStruct& x) const - { - return (m_my_uint32 == x.m_my_uint32); - } - - /*! - * @brief Comparison operator. - * @param x ULongStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const ULongStruct& x) const - { - return !(*this == x); - } - - /*! - * @brief This function sets a value in member my_uint32 - * @param _my_uint32 New value for member my_uint32 - */ - eProsima_user_DllExport void my_uint32( - uint32_t _my_uint32) - { - m_my_uint32 = _my_uint32; - } - - /*! - * @brief This function returns the value of member my_uint32 - * @return Value of member my_uint32 - */ - eProsima_user_DllExport uint32_t my_uint32() const - { - return m_my_uint32; - } - - /*! - * @brief This function returns a reference to member my_uint32 - * @return Reference to member my_uint32 - */ - eProsima_user_DllExport uint32_t& my_uint32() - { - return m_my_uint32; - } - - - -private: - - uint32_t m_my_uint32{0}; - -}; -/*! - * @brief This class represents the structure ULongLongStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class ULongLongStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport ULongLongStruct() - { - } - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~ULongLongStruct() - { - } - - /*! - * @brief Copy constructor. - * @param x Reference to the object ULongLongStruct that will be copied. - */ - eProsima_user_DllExport ULongLongStruct( - const ULongLongStruct& x) - { - m_my_uint64 = x.m_my_uint64; - - } - - /*! - * @brief Move constructor. - * @param x Reference to the object ULongLongStruct that will be copied. - */ - eProsima_user_DllExport ULongLongStruct( - ULongLongStruct&& x) noexcept - { - m_my_uint64 = x.m_my_uint64; - } - - /*! - * @brief Copy assignment. - * @param x Reference to the object ULongLongStruct that will be copied. - */ - eProsima_user_DllExport ULongLongStruct& operator =( - const ULongLongStruct& x) - { - - m_my_uint64 = x.m_my_uint64; - - return *this; - } - - /*! - * @brief Move assignment. - * @param x Reference to the object ULongLongStruct that will be copied. - */ - eProsima_user_DllExport ULongLongStruct& operator =( - ULongLongStruct&& x) noexcept - { - - m_my_uint64 = x.m_my_uint64; - return *this; - } - - /*! - * @brief Comparison operator. - * @param x ULongLongStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const ULongLongStruct& x) const - { - return (m_my_uint64 == x.m_my_uint64); - } - - /*! - * @brief Comparison operator. - * @param x ULongLongStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const ULongLongStruct& x) const - { - return !(*this == x); - } - - /*! - * @brief This function sets a value in member my_uint64 - * @param _my_uint64 New value for member my_uint64 - */ - eProsima_user_DllExport void my_uint64( - uint64_t _my_uint64) - { - m_my_uint64 = _my_uint64; - } - - /*! - * @brief This function returns the value of member my_uint64 - * @return Value of member my_uint64 - */ - eProsima_user_DllExport uint64_t my_uint64() const - { - return m_my_uint64; - } - - /*! - * @brief This function returns a reference to member my_uint64 - * @return Reference to member my_uint64 - */ - eProsima_user_DllExport uint64_t& my_uint64() - { - return m_my_uint64; - } - - - -private: - - uint64_t m_my_uint64{0}; - -}; -/*! - * @brief This class represents the structure FloatStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class FloatStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport FloatStruct() - { - } - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~FloatStruct() - { - } - - /*! - * @brief Copy constructor. - * @param x Reference to the object FloatStruct that will be copied. - */ - eProsima_user_DllExport FloatStruct( - const FloatStruct& x) - { - m_my_float32 = x.m_my_float32; - - } - - /*! - * @brief Move constructor. - * @param x Reference to the object FloatStruct that will be copied. - */ - eProsima_user_DllExport FloatStruct( - FloatStruct&& x) noexcept - { - m_my_float32 = x.m_my_float32; - } - - /*! - * @brief Copy assignment. - * @param x Reference to the object FloatStruct that will be copied. - */ - eProsima_user_DllExport FloatStruct& operator =( - const FloatStruct& x) - { - - m_my_float32 = x.m_my_float32; - - return *this; - } - - /*! - * @brief Move assignment. - * @param x Reference to the object FloatStruct that will be copied. - */ - eProsima_user_DllExport FloatStruct& operator =( - FloatStruct&& x) noexcept - { - - m_my_float32 = x.m_my_float32; - return *this; - } - - /*! - * @brief Comparison operator. - * @param x FloatStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const FloatStruct& x) const - { - return (m_my_float32 == x.m_my_float32); - } - - /*! - * @brief Comparison operator. - * @param x FloatStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const FloatStruct& x) const - { - return !(*this == x); - } - - /*! - * @brief This function sets a value in member my_float32 - * @param _my_float32 New value for member my_float32 - */ - eProsima_user_DllExport void my_float32( - float _my_float32) - { - m_my_float32 = _my_float32; - } - - /*! - * @brief This function returns the value of member my_float32 - * @return Value of member my_float32 - */ - eProsima_user_DllExport float my_float32() const - { - return m_my_float32; - } - - /*! - * @brief This function returns a reference to member my_float32 - * @return Reference to member my_float32 - */ - eProsima_user_DllExport float& my_float32() - { - return m_my_float32; - } - - - -private: - - float m_my_float32{0.0}; - -}; -/*! - * @brief This class represents the structure DoubleStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class DoubleStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport DoubleStruct() - { - } - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~DoubleStruct() - { - } - - /*! - * @brief Copy constructor. - * @param x Reference to the object DoubleStruct that will be copied. - */ - eProsima_user_DllExport DoubleStruct( - const DoubleStruct& x) - { - m_my_float64 = x.m_my_float64; - - } - - /*! - * @brief Move constructor. - * @param x Reference to the object DoubleStruct that will be copied. - */ - eProsima_user_DllExport DoubleStruct( - DoubleStruct&& x) noexcept - { - m_my_float64 = x.m_my_float64; - } - - /*! - * @brief Copy assignment. - * @param x Reference to the object DoubleStruct that will be copied. - */ - eProsima_user_DllExport DoubleStruct& operator =( - const DoubleStruct& x) - { - - m_my_float64 = x.m_my_float64; - - return *this; - } - - /*! - * @brief Move assignment. - * @param x Reference to the object DoubleStruct that will be copied. - */ - eProsima_user_DllExport DoubleStruct& operator =( - DoubleStruct&& x) noexcept - { - - m_my_float64 = x.m_my_float64; - return *this; - } - - /*! - * @brief Comparison operator. - * @param x DoubleStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const DoubleStruct& x) const - { - return (m_my_float64 == x.m_my_float64); - } - - /*! - * @brief Comparison operator. - * @param x DoubleStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const DoubleStruct& x) const - { - return !(*this == x); - } - - /*! - * @brief This function sets a value in member my_float64 - * @param _my_float64 New value for member my_float64 - */ - eProsima_user_DllExport void my_float64( - double _my_float64) - { - m_my_float64 = _my_float64; - } - - /*! - * @brief This function returns the value of member my_float64 - * @return Value of member my_float64 - */ - eProsima_user_DllExport double my_float64() const - { - return m_my_float64; - } - - /*! - * @brief This function returns a reference to member my_float64 - * @return Reference to member my_float64 - */ - eProsima_user_DllExport double& my_float64() - { - return m_my_float64; - } - - - -private: - - double m_my_float64{0.0}; - -}; -/*! - * @brief This class represents the structure LongDoubleStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class LongDoubleStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport LongDoubleStruct() - { - } - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~LongDoubleStruct() - { - } - - /*! - * @brief Copy constructor. - * @param x Reference to the object LongDoubleStruct that will be copied. - */ - eProsima_user_DllExport LongDoubleStruct( - const LongDoubleStruct& x) - { - m_my_float128 = x.m_my_float128; - - } - - /*! - * @brief Move constructor. - * @param x Reference to the object LongDoubleStruct that will be copied. - */ - eProsima_user_DllExport LongDoubleStruct( - LongDoubleStruct&& x) noexcept - { - m_my_float128 = x.m_my_float128; - } - - /*! - * @brief Copy assignment. - * @param x Reference to the object LongDoubleStruct that will be copied. - */ - eProsima_user_DllExport LongDoubleStruct& operator =( - const LongDoubleStruct& x) - { - - m_my_float128 = x.m_my_float128; - - return *this; - } - - /*! - * @brief Move assignment. - * @param x Reference to the object LongDoubleStruct that will be copied. - */ - eProsima_user_DllExport LongDoubleStruct& operator =( - LongDoubleStruct&& x) noexcept - { - - m_my_float128 = x.m_my_float128; - return *this; - } - - /*! - * @brief Comparison operator. - * @param x LongDoubleStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const LongDoubleStruct& x) const - { - return (m_my_float128 == x.m_my_float128); - } - - /*! - * @brief Comparison operator. - * @param x LongDoubleStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const LongDoubleStruct& x) const - { - return !(*this == x); - } - - /*! - * @brief This function sets a value in member my_float128 - * @param _my_float128 New value for member my_float128 - */ - eProsima_user_DllExport void my_float128( - long double _my_float128) - { - m_my_float128 = _my_float128; - } - - /*! - * @brief This function returns the value of member my_float128 - * @return Value of member my_float128 - */ - eProsima_user_DllExport long double my_float128() const - { - return m_my_float128; - } - - /*! - * @brief This function returns a reference to member my_float128 - * @return Reference to member my_float128 - */ - eProsima_user_DllExport long double& my_float128() - { - return m_my_float128; - } - - - -private: - - long double m_my_float128{0.0}; - -}; -/*! - * @brief This class represents the structure CharStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class CharStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport CharStruct() - { - } - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~CharStruct() - { - } - - /*! - * @brief Copy constructor. - * @param x Reference to the object CharStruct that will be copied. - */ - eProsima_user_DllExport CharStruct( - const CharStruct& x) - { - m_my_char = x.m_my_char; - - } - - /*! - * @brief Move constructor. - * @param x Reference to the object CharStruct that will be copied. - */ - eProsima_user_DllExport CharStruct( - CharStruct&& x) noexcept - { - m_my_char = x.m_my_char; - } - - /*! - * @brief Copy assignment. - * @param x Reference to the object CharStruct that will be copied. - */ - eProsima_user_DllExport CharStruct& operator =( - const CharStruct& x) - { - - m_my_char = x.m_my_char; - - return *this; - } - - /*! - * @brief Move assignment. - * @param x Reference to the object CharStruct that will be copied. - */ - eProsima_user_DllExport CharStruct& operator =( - CharStruct&& x) noexcept - { - - m_my_char = x.m_my_char; - return *this; - } - - /*! - * @brief Comparison operator. - * @param x CharStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const CharStruct& x) const - { - return (m_my_char == x.m_my_char); - } - - /*! - * @brief Comparison operator. - * @param x CharStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const CharStruct& x) const - { - return !(*this == x); - } - - /*! - * @brief This function sets a value in member my_char - * @param _my_char New value for member my_char - */ - eProsima_user_DllExport void my_char( - char _my_char) - { - m_my_char = _my_char; - } - - /*! - * @brief This function returns the value of member my_char - * @return Value of member my_char - */ - eProsima_user_DllExport char my_char() const - { - return m_my_char; - } - - /*! - * @brief This function returns a reference to member my_char - * @return Reference to member my_char - */ - eProsima_user_DllExport char& my_char() - { - return m_my_char; - } - - - -private: - - char m_my_char{0}; - -}; -/*! - * @brief This class represents the structure WCharStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class WCharStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport WCharStruct() - { - } - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~WCharStruct() - { - } - - /*! - * @brief Copy constructor. - * @param x Reference to the object WCharStruct that will be copied. - */ - eProsima_user_DllExport WCharStruct( - const WCharStruct& x) - { - m_my_wchar = x.m_my_wchar; - - } - - /*! - * @brief Move constructor. - * @param x Reference to the object WCharStruct that will be copied. - */ - eProsima_user_DllExport WCharStruct( - WCharStruct&& x) noexcept - { - m_my_wchar = x.m_my_wchar; - } - - /*! - * @brief Copy assignment. - * @param x Reference to the object WCharStruct that will be copied. - */ - eProsima_user_DllExport WCharStruct& operator =( - const WCharStruct& x) - { - - m_my_wchar = x.m_my_wchar; - - return *this; - } - - /*! - * @brief Move assignment. - * @param x Reference to the object WCharStruct that will be copied. - */ - eProsima_user_DllExport WCharStruct& operator =( - WCharStruct&& x) noexcept - { - - m_my_wchar = x.m_my_wchar; - return *this; - } - - /*! - * @brief Comparison operator. - * @param x WCharStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const WCharStruct& x) const - { - return (m_my_wchar == x.m_my_wchar); - } - - /*! - * @brief Comparison operator. - * @param x WCharStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const WCharStruct& x) const - { - return !(*this == x); - } - - /*! - * @brief This function sets a value in member my_wchar - * @param _my_wchar New value for member my_wchar - */ - eProsima_user_DllExport void my_wchar( - wchar_t _my_wchar) - { - m_my_wchar = _my_wchar; - } - - /*! - * @brief This function returns the value of member my_wchar - * @return Value of member my_wchar - */ - eProsima_user_DllExport wchar_t my_wchar() const - { - return m_my_wchar; - } - - /*! - * @brief This function returns a reference to member my_wchar - * @return Reference to member my_wchar - */ - eProsima_user_DllExport wchar_t& my_wchar() - { - return m_my_wchar; - } - - - -private: - - wchar_t m_my_wchar{0}; - -}; -/*! - * @brief This class represents the structure StringStruct defined by the user in the IDL file. - * @ingroup Basic - */ -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) - { - m_my_string = x.m_my_string; - - } - - /*! - * @brief Move constructor. - * @param x Reference to the object StringStruct that will be copied. - */ - eProsima_user_DllExport StringStruct( - StringStruct&& x) noexcept - { - m_my_string = std::move(x.m_my_string); - } - - /*! - * @brief Copy assignment. - * @param x Reference to the object StringStruct that will be copied. - */ - eProsima_user_DllExport StringStruct& operator =( - const StringStruct& x) - { - - m_my_string = x.m_my_string; - - return *this; - } - - /*! - * @brief Move assignment. - * @param x Reference to the object StringStruct that will be copied. - */ - eProsima_user_DllExport StringStruct& operator =( - StringStruct&& x) noexcept - { - - m_my_string = std::move(x.m_my_string); - return *this; - } - - /*! - * @brief Comparison operator. - * @param x StringStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const StringStruct& x) const - { - return (m_my_string == x.m_my_string); - } - - /*! - * @brief Comparison operator. - * @param x StringStruct object to compare. - */ - eProsima_user_DllExport bool 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport const std::string& my_string() const - { - return m_my_string; - } - - /*! - * @brief This function returns a reference to member my_string - * @return Reference to member my_string - */ - eProsima_user_DllExport std::string& my_string() - { - return m_my_string; - } - - - -private: - - std::string m_my_string; - -}; -/*! - * @brief This class represents the structure WStringStruct defined by the user in the IDL file. - * @ingroup Basic - */ -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) - { - m_my_wstring = x.m_my_wstring; - - } - - /*! - * @brief Move constructor. - * @param x Reference to the object WStringStruct that will be copied. - */ - eProsima_user_DllExport WStringStruct( - WStringStruct&& x) noexcept - { - m_my_wstring = std::move(x.m_my_wstring); - } - - /*! - * @brief Copy assignment. - * @param x Reference to the object WStringStruct that will be copied. - */ - eProsima_user_DllExport WStringStruct& operator =( - const WStringStruct& x) - { - - m_my_wstring = x.m_my_wstring; - - return *this; - } - - /*! - * @brief Move assignment. - * @param x Reference to the object WStringStruct that will be copied. - */ - eProsima_user_DllExport WStringStruct& operator =( - WStringStruct&& x) noexcept - { - - m_my_wstring = std::move(x.m_my_wstring); - return *this; - } - - /*! - * @brief Comparison operator. - * @param x WStringStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const WStringStruct& x) const - { - return (m_my_wstring == x.m_my_wstring); - } - - /*! - * @brief Comparison operator. - * @param x WStringStruct object to compare. - */ - eProsima_user_DllExport bool 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport const std::wstring& my_wstring() const - { - return m_my_wstring; - } - - /*! - * @brief This function returns a reference to member my_wstring - * @return Reference to member my_wstring - */ - eProsima_user_DllExport std::wstring& my_wstring() - { - return m_my_wstring; - } - - - -private: - - std::wstring m_my_wstring; - -}; -/*! - * @brief This class represents the structure LargeStringStruct defined by the user in the IDL file. - * @ingroup Basic - */ -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) - { - m_my_large_string = x.m_my_large_string; - - } - - /*! - * @brief Move constructor. - * @param x Reference to the object LargeStringStruct that will be copied. - */ - eProsima_user_DllExport LargeStringStruct( - LargeStringStruct&& x) noexcept - { - m_my_large_string = std::move(x.m_my_large_string); - } - - /*! - * @brief Copy assignment. - * @param x Reference to the object LargeStringStruct that will be copied. - */ - eProsima_user_DllExport LargeStringStruct& operator =( - const LargeStringStruct& x) - { - - m_my_large_string = x.m_my_large_string; - - return *this; - } - - /*! - * @brief Move assignment. - * @param x Reference to the object LargeStringStruct that will be copied. - */ - eProsima_user_DllExport LargeStringStruct& operator =( - LargeStringStruct&& x) noexcept - { - - m_my_large_string = std::move(x.m_my_large_string); - return *this; - } - - /*! - * @brief Comparison operator. - * @param x LargeStringStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const LargeStringStruct& x) const - { - return (m_my_large_string == x.m_my_large_string); - } - - /*! - * @brief Comparison operator. - * @param x LargeStringStruct object to compare. - */ - eProsima_user_DllExport bool 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport const eprosima::fastcdr::fixed_string<41925>& 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_user_DllExport eprosima::fastcdr::fixed_string<41925>& my_large_string() - { - return m_my_large_string; - } - - - -private: - - eprosima::fastcdr::fixed_string<41925> m_my_large_string; - -}; -/*! - * @brief This class represents the structure LargeWStringStruct defined by the user in the IDL file. - * @ingroup Basic - */ -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) - { - m_my_large_wstring = x.m_my_large_wstring; - - } - - /*! - * @brief Move constructor. - * @param x Reference to the object LargeWStringStruct that will be copied. - */ - eProsima_user_DllExport LargeWStringStruct( - LargeWStringStruct&& x) noexcept - { - m_my_large_wstring = std::move(x.m_my_large_wstring); - } - - /*! - * @brief Copy assignment. - * @param x Reference to the object LargeWStringStruct that will be copied. - */ - eProsima_user_DllExport LargeWStringStruct& operator =( - const LargeWStringStruct& x) - { - - m_my_large_wstring = x.m_my_large_wstring; - - return *this; - } - - /*! - * @brief Move assignment. - * @param x Reference to the object LargeWStringStruct that will be copied. - */ - eProsima_user_DllExport LargeWStringStruct& operator =( - LargeWStringStruct&& x) noexcept - { - - m_my_large_wstring = std::move(x.m_my_large_wstring); - return *this; - } - - /*! - * @brief Comparison operator. - * @param x LargeWStringStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const LargeWStringStruct& x) const - { - return (m_my_large_wstring == x.m_my_large_wstring); - } - - /*! - * @brief Comparison operator. - * @param x LargeWStringStruct object to compare. - */ - eProsima_user_DllExport bool 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport const std::wstring& 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 - */ - eProsima_user_DllExport std::wstring& my_large_wstring() - { - return m_my_large_wstring; - } - - - -private: - - std::wstring m_my_large_wstring; - -}; -/*! - * @brief This class represents the structure ArraytStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class ArraytStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport ArraytStruct() - { - } - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~ArraytStruct() - { - } - - /*! - * @brief Copy constructor. - * @param x Reference to the object ArraytStruct that will be copied. - */ - eProsima_user_DllExport ArraytStruct( - const ArraytStruct& x) - { - m_my_array = x.m_my_array; - - } - - /*! - * @brief Move constructor. - * @param x Reference to the object ArraytStruct that will be copied. - */ - eProsima_user_DllExport ArraytStruct( - ArraytStruct&& x) noexcept - { - m_my_array = std::move(x.m_my_array); - } - - /*! - * @brief Copy assignment. - * @param x Reference to the object ArraytStruct that will be copied. - */ - eProsima_user_DllExport ArraytStruct& operator =( - const ArraytStruct& x) - { - - m_my_array = x.m_my_array; - - return *this; - } - - /*! - * @brief Move assignment. - * @param x Reference to the object ArraytStruct that will be copied. - */ - eProsima_user_DllExport ArraytStruct& operator =( - ArraytStruct&& x) noexcept - { - - m_my_array = std::move(x.m_my_array); - return *this; - } - - /*! - * @brief Comparison operator. - * @param x ArraytStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const ArraytStruct& x) const - { - return (m_my_array == x.m_my_array); - } - - /*! - * @brief Comparison operator. - * @param x ArraytStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const ArraytStruct& 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 - */ - eProsima_user_DllExport void my_array( - const std::array, 2>, 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 - */ - eProsima_user_DllExport void my_array( - std::array, 2>, 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 - */ - eProsima_user_DllExport const std::array, 2>, 2>& my_array() const - { - return m_my_array; - } - - /*! - * @brief This function returns a reference to member my_array - * @return Reference to member my_array - */ - eProsima_user_DllExport std::array, 2>, 2>& my_array() - { - return m_my_array; - } - - - -private: - - std::array, 2>, 2> m_my_array{ {{ {{0}} }} }; - -}; -typedef std::array, 2> MyArray; - -/*! - * @brief This class represents the structure ArrayArrayStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class ArrayArrayStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport ArrayArrayStruct() - { - } - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~ArrayArrayStruct() - { - } - - /*! - * @brief Copy constructor. - * @param x Reference to the object ArrayArrayStruct that will be copied. - */ - eProsima_user_DllExport ArrayArrayStruct( - const ArrayArrayStruct& x) - { - m_my_array_array = x.m_my_array_array; - - } - - /*! - * @brief Move constructor. - * @param x Reference to the object ArrayArrayStruct that will be copied. - */ - eProsima_user_DllExport ArrayArrayStruct( - ArrayArrayStruct&& x) noexcept - { - m_my_array_array = std::move(x.m_my_array_array); - } - - /*! - * @brief Copy assignment. - * @param x Reference to the object ArrayArrayStruct that will be copied. - */ - eProsima_user_DllExport ArrayArrayStruct& operator =( - const ArrayArrayStruct& x) - { - - m_my_array_array = x.m_my_array_array; - - return *this; - } - - /*! - * @brief Move assignment. - * @param x Reference to the object ArrayArrayStruct that will be copied. - */ - eProsima_user_DllExport ArrayArrayStruct& operator =( - ArrayArrayStruct&& x) noexcept - { - - m_my_array_array = std::move(x.m_my_array_array); - return *this; - } - - /*! - * @brief Comparison operator. - * @param x ArrayArrayStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const ArrayArrayStruct& x) const - { - return (m_my_array_array == x.m_my_array_array); - } - - /*! - * @brief Comparison operator. - * @param x ArrayArrayStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const ArrayArrayStruct& x) const - { - return !(*this == x); - } - - /*! - * @brief This function copies the value in member my_array_array - * @param _my_array_array New value to be copied in member my_array_array - */ - eProsima_user_DllExport void my_array_array( - const std::array, 2>& _my_array_array) - { - m_my_array_array = _my_array_array; - } - - /*! - * @brief This function moves the value in member my_array_array - * @param _my_array_array New value to be moved in member my_array_array - */ - eProsima_user_DllExport void my_array_array( - std::array, 2>&& _my_array_array) - { - m_my_array_array = std::move(_my_array_array); - } - - /*! - * @brief This function returns a constant reference to member my_array_array - * @return Constant reference to member my_array_array - */ - eProsima_user_DllExport const std::array, 2>& my_array_array() const - { - return m_my_array_array; - } - - /*! - * @brief This function returns a reference to member my_array_array - * @return Reference to member my_array_array - */ - eProsima_user_DllExport std::array, 2>& my_array_array() - { - return m_my_array_array; - } - - - -private: - - std::array, 2> m_my_array_array{ {{ {{ {{0}} }} }} }; - -}; -/*! - * @brief This class represents the structure SequenceStruct defined by the user in the IDL file. - * @ingroup Basic - */ -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) - { - m_my_sequence = x.m_my_sequence; - - } - - /*! - * @brief Move constructor. - * @param x Reference to the object SequenceStruct that will be copied. - */ - eProsima_user_DllExport SequenceStruct( - SequenceStruct&& x) noexcept - { - m_my_sequence = std::move(x.m_my_sequence); - } - - /*! - * @brief Copy assignment. - * @param x Reference to the object SequenceStruct that will be copied. - */ - eProsima_user_DllExport SequenceStruct& operator =( - const SequenceStruct& x) - { - - m_my_sequence = x.m_my_sequence; - - return *this; - } - - /*! - * @brief Move assignment. - * @param x Reference to the object SequenceStruct that will be copied. - */ - eProsima_user_DllExport SequenceStruct& operator =( - SequenceStruct&& x) noexcept - { - - m_my_sequence = std::move(x.m_my_sequence); - return *this; - } - - /*! - * @brief Comparison operator. - * @param x SequenceStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SequenceStruct& x) const - { - return (m_my_sequence == x.m_my_sequence); - } - - /*! - * @brief Comparison operator. - * @param x SequenceStruct object to compare. - */ - eProsima_user_DllExport bool 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport const std::vector& my_sequence() const - { - return m_my_sequence; - } - - /*! - * @brief This function returns a reference to member my_sequence - * @return Reference to member my_sequence - */ - eProsima_user_DllExport std::vector& my_sequence() - { - return m_my_sequence; - } - - - -private: - - std::vector m_my_sequence; - -}; -/*! - * @brief This class represents the structure SequenceSequenceStruct defined by the user in the IDL file. - * @ingroup Basic - */ -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) - { - m_my_sequence_sequence = x.m_my_sequence_sequence; - - } - - /*! - * @brief Move constructor. - * @param x Reference to the object SequenceSequenceStruct that will be copied. - */ - eProsima_user_DllExport SequenceSequenceStruct( - SequenceSequenceStruct&& x) noexcept - { - m_my_sequence_sequence = std::move(x.m_my_sequence_sequence); - } - - /*! - * @brief Copy assignment. - * @param x Reference to the object SequenceSequenceStruct that will be copied. - */ - eProsima_user_DllExport SequenceSequenceStruct& operator =( - const SequenceSequenceStruct& x) - { - - m_my_sequence_sequence = x.m_my_sequence_sequence; - - return *this; - } - - /*! - * @brief Move assignment. - * @param x Reference to the object SequenceSequenceStruct that will be copied. - */ - eProsima_user_DllExport SequenceSequenceStruct& operator =( - SequenceSequenceStruct&& x) noexcept - { - - m_my_sequence_sequence = std::move(x.m_my_sequence_sequence); - return *this; - } - - /*! - * @brief Comparison operator. - * @param x SequenceSequenceStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SequenceSequenceStruct& x) const - { - return (m_my_sequence_sequence == x.m_my_sequence_sequence); - } - - /*! - * @brief Comparison operator. - * @param x SequenceSequenceStruct object to compare. - */ - eProsima_user_DllExport bool 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport const std::vector>& 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 - */ - eProsima_user_DllExport std::vector>& my_sequence_sequence() - { - return m_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 Basic - */ -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) - { - m_my_map = x.m_my_map; - - } - - /*! - * @brief Move constructor. - * @param x Reference to the object MapStruct that will be copied. - */ - eProsima_user_DllExport MapStruct( - MapStruct&& x) noexcept - { - m_my_map = std::move(x.m_my_map); - } - - /*! - * @brief Copy assignment. - * @param x Reference to the object MapStruct that will be copied. - */ - eProsima_user_DllExport MapStruct& operator =( - const MapStruct& x) - { - - m_my_map = x.m_my_map; - - return *this; - } - - /*! - * @brief Move assignment. - * @param x Reference to the object MapStruct that will be copied. - */ - eProsima_user_DllExport MapStruct& operator =( - MapStruct&& x) noexcept - { - - m_my_map = std::move(x.m_my_map); - return *this; - } - - /*! - * @brief Comparison operator. - * @param x MapStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MapStruct& x) const - { - return (m_my_map == x.m_my_map); - } - - /*! - * @brief Comparison operator. - * @param x MapStruct object to compare. - */ - eProsima_user_DllExport bool 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport const std::map& my_map() const - { - return m_my_map; - } - - /*! - * @brief This function returns a reference to member my_map - * @return Reference to member my_map - */ - eProsima_user_DllExport std::map& my_map() - { - return m_my_map; - } - - - -private: - - std::map m_my_map; - -}; -/*! - * @brief This class represents the structure MapMapStruct defined by the user in the IDL file. - * @ingroup Basic - */ -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) - { - m_my_map_map = x.m_my_map_map; - - } - - /*! - * @brief Move constructor. - * @param x Reference to the object MapMapStruct that will be copied. - */ - eProsima_user_DllExport MapMapStruct( - MapMapStruct&& x) noexcept - { - m_my_map_map = std::move(x.m_my_map_map); - } - - /*! - * @brief Copy assignment. - * @param x Reference to the object MapMapStruct that will be copied. - */ - eProsima_user_DllExport MapMapStruct& operator =( - const MapMapStruct& x) - { - - m_my_map_map = x.m_my_map_map; - - return *this; - } - - /*! - * @brief Move assignment. - * @param x Reference to the object MapMapStruct that will be copied. - */ - eProsima_user_DllExport MapMapStruct& operator =( - MapMapStruct&& x) noexcept - { - - m_my_map_map = std::move(x.m_my_map_map); - return *this; - } - - /*! - * @brief Comparison operator. - * @param x MapMapStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MapMapStruct& x) const - { - return (m_my_map_map == x.m_my_map_map); - } - - /*! - * @brief Comparison operator. - * @param x MapMapStruct object to compare. - */ - eProsima_user_DllExport bool 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport const std::map>& 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 - */ - eProsima_user_DllExport std::map>& my_map_map() - { - return m_my_map_map; - } - - - -private: - - std::map> m_my_map_map; - -}; -/*! - * @brief This class represents the structure MyBitset defined by the user in the IDL file. - * @ingroup Basic - */ -class MyBitset -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MyBitset() - { - } - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MyBitset() - { - } - - /*! - * @brief Copy constructor. - * @param x Reference to the object MyBitset that will be copied. - */ - eProsima_user_DllExport MyBitset( - const MyBitset& x) - { - m_bitset = x.m_bitset; - } - - /*! - * @brief Move constructor. - * @param x Reference to the object MyBitset that will be copied. - */ - eProsima_user_DllExport MyBitset( - MyBitset&& x) noexcept - { - m_bitset = x.m_bitset; - } - - /*! - * @brief Copy assignment. - * @param x Reference to the object MyBitset that will be copied. - */ - eProsima_user_DllExport MyBitset& operator =( - const MyBitset& x) - { - - m_bitset = x.m_bitset; - - return *this; - } - - /*! - * @brief Move assignment. - * @param x Reference to the object MyBitset that will be copied. - */ - eProsima_user_DllExport MyBitset& operator =( - MyBitset&& x) noexcept - { - - m_bitset = x.m_bitset; - - return *this; - } - - /*! - * @brief Comparison operator. - * @param x MyBitset object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MyBitset& x) const - { - - return m_bitset == x.m_bitset; - } - - /*! - * @brief Comparison operator. - * @param x MyBitset object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MyBitset& x) const - { - return !(*this == x); - } - - /*! - * @brief This function sets a value in member a - * @param _a New value for member a - */ - eProsima_user_DllExport void a( - uint8_t _a) - { - int base = 0; - int size = 2; - for (int i = base; i < base + size; ++i) - { - m_bitset.set(i, !!(_a & 0x01)); - _a = _a >> 1; - } - - } - - /*! - * @brief This function returns the value of member a - * @return Value of member a - */ - eProsima_user_DllExport uint8_t a() const - { - int base = 0; - int size = 2; - std::bitset<2> aux; - for (int i = 0; i < size; ++i) - { - aux.set(i, m_bitset.test(i + base)); - } - return static_cast(aux.to_ullong()); - - } - - - /*! - * @brief This function sets a value in member b - * @param _b New value for member b - */ - eProsima_user_DllExport void b( - uint32_t _b) - { - int base = 10; - int size = 20; - for (int i = base; i < base + size; ++i) - { - m_bitset.set(i, !!(_b & 0x01)); - _b = _b >> 1; - } - - } - - /*! - * @brief This function returns the value of member b - * @return Value of member b - */ - eProsima_user_DllExport uint32_t b() const - { - int base = 10; - int size = 20; - std::bitset<20> aux; - for (int i = 0; i < size; ++i) - { - aux.set(i, m_bitset.test(i + base)); - } - return static_cast(aux.to_ullong()); - - } - - - eProsima_user_DllExport std::bitset<30> bitset() const - { - std::string str_value; - - str_value = m_bitset.to_string() + str_value; - - return std::bitset<30>(str_value); - } - - eProsima_user_DllExport void bitset( - const std::bitset<30>& bitset) - { - std::string str_value {bitset.to_string()}; - size_t base_diff {0}; - size_t last_post {std::string::npos}; - - base_diff += 30; - m_bitset = std::bitset<30>(str_value.substr(str_value.length() - base_diff, last_post)); - } - - -private: - - std::bitset<30> m_bitset; -}; -/*! - * @brief This class represents the structure BitsetStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class BitsetStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport BitsetStruct() - { - } - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~BitsetStruct() - { - } - - /*! - * @brief Copy constructor. - * @param x Reference to the object BitsetStruct that will be copied. - */ - eProsima_user_DllExport BitsetStruct( - const BitsetStruct& x) - { - m_a = x.m_a; - - } - - /*! - * @brief Move constructor. - * @param x Reference to the object BitsetStruct that will be copied. - */ - eProsima_user_DllExport BitsetStruct( - BitsetStruct&& x) noexcept - { - m_a = std::move(x.m_a); - } - - /*! - * @brief Copy assignment. - * @param x Reference to the object BitsetStruct that will be copied. - */ - eProsima_user_DllExport BitsetStruct& operator =( - const BitsetStruct& x) - { - - m_a = x.m_a; - - return *this; - } - - /*! - * @brief Move assignment. - * @param x Reference to the object BitsetStruct that will be copied. - */ - eProsima_user_DllExport BitsetStruct& operator =( - BitsetStruct&& x) noexcept - { - - m_a = std::move(x.m_a); - return *this; - } - - /*! - * @brief Comparison operator. - * @param x BitsetStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const BitsetStruct& x) const - { - return (m_a == x.m_a); - } - - /*! - * @brief Comparison operator. - * @param x BitsetStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const BitsetStruct& x) const - { - return !(*this == x); - } - - /*! - * @brief This function copies the value in member a - * @param _a New value to be copied in member a - */ - eProsima_user_DllExport void a( - const MyBitset& _a) - { - m_a = _a; - } - - /*! - * @brief This function moves the value in member a - * @param _a New value to be moved in member a - */ - eProsima_user_DllExport void a( - MyBitset&& _a) - { - m_a = std::move(_a); - } - - /*! - * @brief This function returns a constant reference to member a - * @return Constant reference to member a - */ - eProsima_user_DllExport const MyBitset& a() const - { - return m_a; - } - - /*! - * @brief This function returns a reference to member a - * @return Reference to member a - */ - eProsima_user_DllExport MyBitset& a() - { - return m_a; - } - - - -private: - - MyBitset m_a; - -}; -/*! - * @brief This class represents the structure StructStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class StructStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport StructStruct() - { - } - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~StructStruct() - { - } - - /*! - * @brief Copy constructor. - * @param x Reference to the object StructStruct that will be copied. - */ - eProsima_user_DllExport StructStruct( - const StructStruct& x) - { - m_a = x.m_a; - - m_b = x.m_b; - - } - - /*! - * @brief Move constructor. - * @param x Reference to the object StructStruct that will be copied. - */ - eProsima_user_DllExport StructStruct( - StructStruct&& x) noexcept - { - m_a = x.m_a; - m_b = x.m_b; - } - - /*! - * @brief Copy assignment. - * @param x Reference to the object StructStruct that will be copied. - */ - eProsima_user_DllExport StructStruct& operator =( - const StructStruct& x) - { - - m_a = x.m_a; - - m_b = x.m_b; - - return *this; - } - - /*! - * @brief Move assignment. - * @param x Reference to the object StructStruct that will be copied. - */ - eProsima_user_DllExport StructStruct& operator =( - StructStruct&& x) noexcept - { - - m_a = x.m_a; - m_b = x.m_b; - return *this; - } - - /*! - * @brief Comparison operator. - * @param x StructStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const StructStruct& x) const - { - return (m_a == x.m_a && - m_b == x.m_b); - } - - /*! - * @brief Comparison operator. - * @param x StructStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const StructStruct& x) const - { - return !(*this == x); - } - - /*! - * @brief This function sets a value in member a - * @param _a New value for member a - */ - eProsima_user_DllExport void a( - int32_t _a) - { - m_a = _a; - } - - /*! - * @brief This function returns the value of member a - * @return Value of member a - */ - eProsima_user_DllExport int32_t a() const - { - return m_a; - } - - /*! - * @brief This function returns a reference to member a - * @return Reference to member a - */ - eProsima_user_DllExport int32_t& a() - { - return m_a; - } - - - /*! - * @brief This function sets a value in member b - * @param _b New value for member b - */ - eProsima_user_DllExport void b( - int64_t _b) - { - m_b = _b; - } - - /*! - * @brief This function returns the value of member b - * @return Value of member b - */ - eProsima_user_DllExport int64_t b() const - { - return m_b; - } - - /*! - * @brief This function returns a reference to member b - * @return Reference to member b - */ - eProsima_user_DllExport int64_t& b() - { - return m_b; - } - - - -private: - - int32_t m_a{0}; - int64_t m_b{0}; - -}; -/*! - * @brief This class represents the structure StructStructStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class StructStructStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport StructStructStruct() - { - } - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~StructStructStruct() - { - } - - /*! - * @brief Copy constructor. - * @param x Reference to the object StructStructStruct that will be copied. - */ - eProsima_user_DllExport StructStructStruct( - const StructStructStruct& x) - { - m_child_struct = x.m_child_struct; - - m_child_int64 = x.m_child_int64; - - } - - /*! - * @brief Move constructor. - * @param x Reference to the object StructStructStruct that will be copied. - */ - eProsima_user_DllExport StructStructStruct( - StructStructStruct&& x) noexcept - { - m_child_struct = std::move(x.m_child_struct); - m_child_int64 = x.m_child_int64; - } - - /*! - * @brief Copy assignment. - * @param x Reference to the object StructStructStruct that will be copied. - */ - eProsima_user_DllExport StructStructStruct& operator =( - const StructStructStruct& x) - { - - m_child_struct = x.m_child_struct; - - m_child_int64 = x.m_child_int64; - - return *this; - } - - /*! - * @brief Move assignment. - * @param x Reference to the object StructStructStruct that will be copied. - */ - eProsima_user_DllExport StructStructStruct& operator =( - StructStructStruct&& x) noexcept - { - - m_child_struct = std::move(x.m_child_struct); - m_child_int64 = x.m_child_int64; - return *this; - } - - /*! - * @brief Comparison operator. - * @param x StructStructStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const StructStructStruct& x) const - { - return (m_child_struct == x.m_child_struct && - m_child_int64 == x.m_child_int64); - } - - /*! - * @brief Comparison operator. - * @param x StructStructStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const StructStructStruct& x) const - { - return !(*this == x); - } - - /*! - * @brief This function copies the value in member child_struct - * @param _child_struct New value to be copied in member child_struct - */ - eProsima_user_DllExport void child_struct( - const StructStruct& _child_struct) - { - m_child_struct = _child_struct; - } - - /*! - * @brief This function moves the value in member child_struct - * @param _child_struct New value to be moved in member child_struct - */ - eProsima_user_DllExport void child_struct( - StructStruct&& _child_struct) - { - m_child_struct = std::move(_child_struct); - } - - /*! - * @brief This function returns a constant reference to member child_struct - * @return Constant reference to member child_struct - */ - eProsima_user_DllExport const StructStruct& child_struct() const - { - return m_child_struct; - } - - /*! - * @brief This function returns a reference to member child_struct - * @return Reference to member child_struct - */ - eProsima_user_DllExport StructStruct& child_struct() - { - return m_child_struct; - } - - - /*! - * @brief This function sets a value in member child_int64 - * @param _child_int64 New value for member child_int64 - */ - eProsima_user_DllExport void child_int64( - int64_t _child_int64) - { - m_child_int64 = _child_int64; - } - - /*! - * @brief This function returns the value of member child_int64 - * @return Value of member child_int64 - */ - eProsima_user_DllExport int64_t child_int64() const - { - return m_child_int64; - } - - /*! - * @brief This function returns a reference to member child_int64 - * @return Reference to member child_int64 - */ - eProsima_user_DllExport int64_t& child_int64() - { - return m_child_int64; - } - - - -private: - - StructStruct m_child_struct; - int64_t m_child_int64{0}; - -}; -/*! - * @brief This class represents the union SimpleUnion defined by the user in the IDL file. - * @ingroup Basic - */ -class SimpleUnion -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SimpleUnion() - { - m__d = 0; - } - - /*! - * @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) - { - 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; - } - } - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleUnion that will be copied. - */ - eProsima_user_DllExport SimpleUnion( - SimpleUnion&& 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; - } - } - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleUnion that will be copied. - */ - eProsima_user_DllExport SimpleUnion& operator =( - const SimpleUnion& 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; - } - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleUnion that will be copied. - */ - eProsima_user_DllExport SimpleUnion& operator =( - SimpleUnion&& 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; - } - - /*! - * @brief Comparison operator. - * @param x SimpleUnion object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleUnion& 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; - } - - /*! - * @brief Comparison operator. - * @param x SimpleUnion object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimpleUnion& 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( - int32_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 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 int32_t _d() const - { - return m__d; - } - - /*! - * @brief This function returns a reference to the discriminator. - * @return Reference to the discriminator. - */ - eProsima_user_DllExport int32_t& _d() - { - return m__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) - { - m_first = _first; - m__d = 0; - - } - - /*! - * @brief This function returns the value of member first - * @return Value of member first - * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t first() const - { - bool b = false; - - switch (m__d) - { - case 0: - b = true; - break; - default: - break; - } - - if (!b) - { - throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); - } - - return m_first; - } - - /*! - * @brief This function returns a reference to member first - * @return Reference to member first - * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t& first() - { - bool b = false; - - switch (m__d) - { - case 0: - b = true; - break; - default: - break; - } - - if (!b) - { - throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); - } - - return m_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) - { - m_second = _second; - m__d = 1; - - } - - /*! - * @brief This function returns the value of member second - * @return Value of member second - * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t second() const - { - bool b = false; - - switch (m__d) - { - case 1: - b = true; - break; - default: - break; - } - - if (!b) - { - throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); - } - - return m_second; - } - - /*! - * @brief This function returns a reference to member second - * @return Reference to member second - * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t& second() - { - bool b = false; - - switch (m__d) - { - case 1: - b = true; - break; - default: - break; - } - - if (!b) - { - throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); - } - - return m_second; - } - - - -private: - - int32_t m__d; - - int32_t m_first{0}; - int64_t m_second{0}; -}; -/*! - * @brief This class represents the union UnionUnion defined by the user in the IDL file. - * @ingroup Basic - */ -class UnionUnion -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport UnionUnion() - { - m__d = 0; - } - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~UnionUnion() - { - } - - /*! - * @brief Copy constructor. - * @param x Reference to the object UnionUnion that will be copied. - */ - eProsima_user_DllExport UnionUnion( - const UnionUnion& 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; - } - } - - /*! - * @brief Move constructor. - * @param x Reference to the object UnionUnion that will be copied. - */ - eProsima_user_DllExport UnionUnion( - UnionUnion&& x) noexcept - { - m__d = x.m__d; - - switch (m__d) - { - case 0: - m_first = x.m_first; - break; - - - case 1: - m_second = std::move(x.m_second); - - break; - - default: - break; - } - } - - /*! - * @brief Copy assignment. - * @param x Reference to the object UnionUnion that will be copied. - */ - eProsima_user_DllExport UnionUnion& operator =( - const UnionUnion& 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; - } - - /*! - * @brief Move assignment. - * @param x Reference to the object UnionUnion that will be copied. - */ - eProsima_user_DllExport UnionUnion& operator =( - UnionUnion&& x) noexcept - { - m__d = x.m__d; - - switch (m__d) - { - case 0: - m_first = x.m_first; - break; - - - case 1: - m_second = std::move(x.m_second); - - break; - - default: - break; - } - - return *this; - } - - /*! - * @brief Comparison operator. - * @param x UnionUnion object to compare. - */ - eProsima_user_DllExport bool operator ==( - const UnionUnion& 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; - } - - /*! - * @brief Comparison operator. - * @param x UnionUnion object to compare. - */ - eProsima_user_DllExport bool operator !=( - const UnionUnion& 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( - int32_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 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 int32_t _d() const - { - return m__d; - } - - /*! - * @brief This function returns a reference to the discriminator. - * @return Reference to the discriminator. - */ - eProsima_user_DllExport int32_t& _d() - { - return m__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) - { - m_first = _first; - m__d = 0; - - } - - /*! - * @brief This function returns the value of member first - * @return Value of member first - * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t first() const - { - bool b = false; - - switch (m__d) - { - case 0: - b = true; - break; - default: - break; - } - - if (!b) - { - throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); - } - - return m_first; - } - - /*! - * @brief This function returns a reference to member first - * @return Reference to member first - * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t& first() - { - bool b = false; - - switch (m__d) - { - case 0: - b = true; - break; - default: - break; - } - - if (!b) - { - throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); - } - - return m_first; - } - - - /*! - * @brief This function copies the value in member second - * @param _second New value to be copied in member second - */ - eProsima_user_DllExport void second( - const SimpleUnion& _second) - { - m_second = _second; - m__d = 1; - - } - - /*! - * @brief This function moves the value in member second - * @param _second New value to be moved in member second - */ - eProsima_user_DllExport void second( - SimpleUnion&& _second) - { - m_second = std::move(_second); - m__d = 1; - - } - - /*! - * @brief This function returns a constant reference to member second - * @return Constant reference to member second - * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport const SimpleUnion& second() const - { - bool b = false; - - switch (m__d) - { - case 1: - b = true; - break; - default: - break; - } - - if (!b) - { - throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); - } - - return m_second; - } - - /*! - * @brief This function returns a reference to member second - * @return Reference to member second - * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport SimpleUnion& second() - { - bool b = false; - - switch (m__d) - { - case 1: - b = true; - break; - default: - break; - } - - if (!b) - { - throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); - } - - return m_second; - } - - - -private: - - int32_t m__d; - - int32_t m_first{0}; - SimpleUnion m_second; -}; -/*! - * @brief This class represents the union WCharUnion defined by the user in the IDL file. - * @ingroup Basic - */ -class WCharUnion -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport WCharUnion() - { - m__d = 'A'; - } - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~WCharUnion() - { - } - - /*! - * @brief Copy constructor. - * @param x Reference to the object WCharUnion that will be copied. - */ - eProsima_user_DllExport WCharUnion( - const WCharUnion& 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; - } - } - - /*! - * @brief Move constructor. - * @param x Reference to the object WCharUnion that will be copied. - */ - eProsima_user_DllExport WCharUnion( - WCharUnion&& 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; - } - } - - /*! - * @brief Copy assignment. - * @param x Reference to the object WCharUnion that will be copied. - */ - eProsima_user_DllExport WCharUnion& operator =( - const WCharUnion& 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; - } - - /*! - * @brief Move assignment. - * @param x Reference to the object WCharUnion that will be copied. - */ - eProsima_user_DllExport WCharUnion& operator =( - WCharUnion&& 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; - } - - /*! - * @brief Comparison operator. - * @param x WCharUnion object to compare. - */ - eProsima_user_DllExport bool operator ==( - const WCharUnion& 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; - } - - /*! - * @brief Comparison operator. - * @param x WCharUnion object to compare. - */ - eProsima_user_DllExport bool operator !=( - const WCharUnion& 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( - wchar_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 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 wchar_t _d() const - { - return m__d; - } - - /*! - * @brief This function returns a reference to the discriminator. - * @return Reference to the discriminator. - */ - eProsima_user_DllExport wchar_t& _d() - { - return m__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) - { - m_first = _first; - m__d = 'A'; - - } - - /*! - * @brief This function returns the value of member first - * @return Value of member first - * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t first() const - { - bool b = false; - - switch (m__d) - { - case 'A': - b = true; - break; - default: - break; - } - - if (!b) - { - throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); - } - - return m_first; - } - - /*! - * @brief This function returns a reference to member first - * @return Reference to member first - * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t& first() - { - bool b = false; - - switch (m__d) - { - case 'A': - b = true; - break; - default: - break; - } - - if (!b) - { - throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); - } - - return m_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) - { - m_second = _second; - m__d = 'B'; - - } - - /*! - * @brief This function returns the value of member second - * @return Value of member second - * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t second() const - { - bool b = false; - - switch (m__d) - { - case 'B': - b = true; - break; - default: - break; - } - - if (!b) - { - throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); - } - - return m_second; - } - - /*! - * @brief This function returns a reference to member second - * @return Reference to member second - * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t& second() - { - bool b = false; - - switch (m__d) - { - case 'B': - b = true; - break; - default: - break; - } - - if (!b) - { - throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); - } - - return m_second; - } - - - -private: - - wchar_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 Basic - */ -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) - { - m_my_union = x.m_my_union; - - } - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleUnionStruct( - SimpleUnionStruct&& x) noexcept - { - m_my_union = std::move(x.m_my_union); - } - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleUnionStruct& operator =( - const SimpleUnionStruct& x) - { - - m_my_union = x.m_my_union; - - return *this; - } - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleUnionStruct& operator =( - SimpleUnionStruct&& x) noexcept - { - - m_my_union = std::move(x.m_my_union); - return *this; - } - - /*! - * @brief Comparison operator. - * @param x SimpleUnionStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleUnionStruct& x) const - { - return (m_my_union == x.m_my_union); - } - - /*! - * @brief Comparison operator. - * @param x SimpleUnionStruct object to compare. - */ - eProsima_user_DllExport bool 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport const SimpleUnion& my_union() const - { - return m_my_union; - } - - /*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ - eProsima_user_DllExport SimpleUnion& my_union() - { - return m_my_union; - } - - - -private: - - SimpleUnion m_my_union; - -}; -/*! - * @brief This class represents the structure UnionUnionUnionStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class UnionUnionUnionStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport UnionUnionUnionStruct() - { - } - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~UnionUnionUnionStruct() - { - } - - /*! - * @brief Copy constructor. - * @param x Reference to the object UnionUnionUnionStruct that will be copied. - */ - eProsima_user_DllExport UnionUnionUnionStruct( - const UnionUnionUnionStruct& x) - { - m_my_union = x.m_my_union; - - } - - /*! - * @brief Move constructor. - * @param x Reference to the object UnionUnionUnionStruct that will be copied. - */ - eProsima_user_DllExport UnionUnionUnionStruct( - UnionUnionUnionStruct&& x) noexcept - { - m_my_union = std::move(x.m_my_union); - } - - /*! - * @brief Copy assignment. - * @param x Reference to the object UnionUnionUnionStruct that will be copied. - */ - eProsima_user_DllExport UnionUnionUnionStruct& operator =( - const UnionUnionUnionStruct& x) - { - - m_my_union = x.m_my_union; - - return *this; - } - - /*! - * @brief Move assignment. - * @param x Reference to the object UnionUnionUnionStruct that will be copied. - */ - eProsima_user_DllExport UnionUnionUnionStruct& operator =( - UnionUnionUnionStruct&& x) noexcept - { - - m_my_union = std::move(x.m_my_union); - return *this; - } - - /*! - * @brief Comparison operator. - * @param x UnionUnionUnionStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const UnionUnionUnionStruct& x) const - { - return (m_my_union == x.m_my_union); - } - - /*! - * @brief Comparison operator. - * @param x UnionUnionUnionStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const UnionUnionUnionStruct& 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 - */ - eProsima_user_DllExport void my_union( - const UnionUnion& _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 - */ - eProsima_user_DllExport void my_union( - UnionUnion&& _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 - */ - eProsima_user_DllExport const UnionUnion& my_union() const - { - return m_my_union; - } - - /*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ - eProsima_user_DllExport UnionUnion& my_union() - { - return m_my_union; - } - - - -private: - - UnionUnion m_my_union; - -}; -/*! - * @brief This class represents the structure WCharUnionStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class WCharUnionStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport WCharUnionStruct() - { - } - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~WCharUnionStruct() - { - } - - /*! - * @brief Copy constructor. - * @param x Reference to the object WCharUnionStruct that will be copied. - */ - eProsima_user_DllExport WCharUnionStruct( - const WCharUnionStruct& x) - { - m_my_union = x.m_my_union; - - } - - /*! - * @brief Move constructor. - * @param x Reference to the object WCharUnionStruct that will be copied. - */ - eProsima_user_DllExport WCharUnionStruct( - WCharUnionStruct&& x) noexcept - { - m_my_union = std::move(x.m_my_union); - } - - /*! - * @brief Copy assignment. - * @param x Reference to the object WCharUnionStruct that will be copied. - */ - eProsima_user_DllExport WCharUnionStruct& operator =( - const WCharUnionStruct& x) - { - - m_my_union = x.m_my_union; - - return *this; - } - - /*! - * @brief Move assignment. - * @param x Reference to the object WCharUnionStruct that will be copied. - */ - eProsima_user_DllExport WCharUnionStruct& operator =( - WCharUnionStruct&& x) noexcept - { - - m_my_union = std::move(x.m_my_union); - return *this; - } - - /*! - * @brief Comparison operator. - * @param x WCharUnionStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const WCharUnionStruct& x) const - { - return (m_my_union == x.m_my_union); - } - - /*! - * @brief Comparison operator. - * @param x WCharUnionStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const WCharUnionStruct& 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 - */ - eProsima_user_DllExport void my_union( - const WCharUnion& _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 - */ - eProsima_user_DllExport void my_union( - WCharUnion&& _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 - */ - eProsima_user_DllExport const WCharUnion& my_union() const - { - return m_my_union; - } - - /*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ - eProsima_user_DllExport WCharUnion& my_union() - { - return m_my_union; - } - - - -private: - - WCharUnion m_my_union; - -}; - -#endif // _FAST_DDS_GENERATED_BASIC_HPP_ - - diff --git a/test/unittest/dynamic_types/idl/Basic.idl b/test/unittest/dynamic_types/idl/Basic.idl deleted file mode 100644 index a406b489590..00000000000 --- a/test/unittest/dynamic_types/idl/Basic.idl +++ /dev/null @@ -1,204 +0,0 @@ -enum MyEnum -{ - A, - B, - C -}; - -typedef MyEnum MyAliasEnum; -typedef MyAliasEnum MyAliasAliasEnum; - -struct EnumStruct -{ - MyEnum my_enum; -}; - -struct AliasStruct -{ - MyAliasEnum my_alias; -}; - -struct AliasAliasStruct -{ - MyAliasAliasEnum my_alias_alias; -}; - -struct BoolStruct -{ - boolean my_bool; -}; - -struct OctetStruct -{ - octet my_octet; -}; - -struct ShortStruct -{ - short my_int16; -}; - -struct LongStruct -{ - long my_int32; -}; - -struct LongLongStruct -{ - long long my_int64; -}; - -struct UShortStruct -{ - unsigned short my_uint16; -}; - -struct ULongStruct -{ - unsigned long my_uint32; -}; - -struct ULongLongStruct -{ - unsigned long long my_uint64; -}; - -struct FloatStruct -{ - float my_float32; -}; - -struct DoubleStruct -{ - double my_float64; -}; - -struct LongDoubleStruct -{ - long double my_float128; -}; - -struct CharStruct -{ - char my_char; -}; - -struct WCharStruct -{ - wchar my_wchar; -}; - -struct StringStruct -{ - string my_string; -}; - -struct WStringStruct -{ - wstring my_wstring; -}; - -struct LargeStringStruct -{ - string<41925> my_large_string; -}; - -struct LargeWStringStruct -{ - wstring<41925> my_large_wstring; -}; - -struct ArraytStruct -{ - long my_array[2][2][2]; -}; - -typedef long MyArray[2][2]; - -struct ArrayArrayStruct -{ - MyArray my_array_array[2][2]; -}; - -struct SequenceStruct -{ - sequence my_sequence; -}; - -struct SequenceSequenceStruct -{ - sequence, 3> my_sequence_sequence; -}; - -struct MapStruct -{ - map my_map; -}; - -struct MapMapStruct -{ - map , 2> my_map_map; -}; - -bitset MyBitset -{ - bitfield<2> a; - bitfield<8>; - bitfield<20> b; -}; - -struct BitsetStruct -{ - MyBitset a; -}; - -struct StructStruct -{ - long a; - long long b; -}; - -struct StructStructStruct -{ - StructStruct child_struct; - long long child_int64; -}; - -union SimpleUnion switch (long) -{ - case 0: - long first; - case 1: - long long second; -}; - -union UnionUnion switch (long) -{ - case 0: - long first; - case 1: - SimpleUnion second; -}; - -union WCharUnion switch (wchar) -{ - case 'A': - long first; - case 'B': - long long second; -}; - -struct SimpleUnionStruct -{ - SimpleUnion my_union; -}; - -struct UnionUnionUnionStruct -{ - UnionUnion my_union; -}; - -struct WCharUnionStruct -{ - WCharUnion my_union; -}; diff --git a/test/unittest/dynamic_types/idl/BasicCdrAux.hpp b/test/unittest/dynamic_types/idl/BasicCdrAux.hpp deleted file mode 100644 index d80e84febb0..00000000000 --- a/test/unittest/dynamic_types/idl/BasicCdrAux.hpp +++ /dev/null @@ -1,276 +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 BasicCdrAux.hpp - * This source file contains some definitions of CDR related functions. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_BASICCDRAUX_HPP_ -#define _FAST_DDS_GENERATED_BASICCDRAUX_HPP_ - -#include "Basic.hpp" - -constexpr uint32_t ArraytStruct_max_cdr_typesize {36UL}; -constexpr uint32_t ArraytStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t SimpleUnionStruct_max_cdr_typesize {24UL}; -constexpr uint32_t SimpleUnionStruct_max_key_cdr_typesize {0UL}; - - -constexpr uint32_t WCharUnionStruct_max_cdr_typesize {24UL}; -constexpr uint32_t WCharUnionStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t OctetStruct_max_cdr_typesize {5UL}; -constexpr uint32_t OctetStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t LongStruct_max_cdr_typesize {8UL}; -constexpr uint32_t LongStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t EnumStruct_max_cdr_typesize {8UL}; -constexpr uint32_t EnumStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t BitsetStruct_max_cdr_typesize {8UL}; -constexpr uint32_t BitsetStruct_max_key_cdr_typesize {0UL}; - - - -constexpr uint32_t DoubleStruct_max_cdr_typesize {16UL}; -constexpr uint32_t DoubleStruct_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 WCharStruct_max_cdr_typesize {6UL}; -constexpr uint32_t WCharStruct_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 ULongStruct_max_cdr_typesize {8UL}; -constexpr uint32_t ULongStruct_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 FloatStruct_max_cdr_typesize {8UL}; -constexpr uint32_t FloatStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t LongDoubleStruct_max_cdr_typesize {24UL}; -constexpr uint32_t LongDoubleStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t StructStructStruct_max_cdr_typesize {32UL}; -constexpr uint32_t StructStructStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t UnionUnionUnionStruct_max_cdr_typesize {32UL}; -constexpr uint32_t UnionUnionUnionStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t BoolStruct_max_cdr_typesize {5UL}; -constexpr uint32_t BoolStruct_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 AliasAliasStruct_max_cdr_typesize {8UL}; -constexpr uint32_t AliasAliasStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t ArrayArrayStruct_max_cdr_typesize {72UL}; -constexpr uint32_t ArrayArrayStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t ShortStruct_max_cdr_typesize {6UL}; -constexpr uint32_t ShortStruct_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 UShortStruct_max_cdr_typesize {6UL}; -constexpr uint32_t UShortStruct_max_key_cdr_typesize {0UL}; - - - -constexpr uint32_t ULongLongStruct_max_cdr_typesize {16UL}; -constexpr uint32_t ULongLongStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t AliasStruct_max_cdr_typesize {8UL}; -constexpr uint32_t AliasStruct_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 CharStruct_max_cdr_typesize {5UL}; -constexpr uint32_t CharStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t LongLongStruct_max_cdr_typesize {16UL}; -constexpr uint32_t LongLongStruct_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 StructStruct_max_cdr_typesize {16UL}; -constexpr uint32_t StructStruct_max_key_cdr_typesize {0UL}; - - - -namespace eprosima { -namespace fastcdr { - -class Cdr; -class CdrSizeCalculator; - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const EnumStruct& data); - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const AliasStruct& data); - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const AliasAliasStruct& data); - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const BoolStruct& data); - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const OctetStruct& data); - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const ShortStruct& data); - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const LongStruct& data); - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const LongLongStruct& data); - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const UShortStruct& data); - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const ULongStruct& data); - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const ULongLongStruct& data); - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const FloatStruct& data); - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const DoubleStruct& data); - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const LongDoubleStruct& data); - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const CharStruct& data); - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const WCharStruct& 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 WStringStruct& 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 LargeWStringStruct& data); - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const ArraytStruct& data); - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const ArrayArrayStruct& 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 SequenceSequenceStruct& 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 MapMapStruct& data); - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const BitsetStruct& data); - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const StructStruct& data); - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const StructStructStruct& 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 UnionUnionUnionStruct& data); - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const WCharUnionStruct& data); - - -} // namespace fastcdr -} // namespace eprosima - -#endif // _FAST_DDS_GENERATED_BASICCDRAUX_HPP_ - diff --git a/test/unittest/dynamic_types/idl/BasicCdrAux.ipp b/test/unittest/dynamic_types/idl/BasicCdrAux.ipp deleted file mode 100644 index 1eeb9fc985f..00000000000 --- a/test/unittest/dynamic_types/idl/BasicCdrAux.ipp +++ /dev/null @@ -1,2839 +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 BasicCdrAux.ipp - * This source file contains some declarations of CDR related functions. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_BASICCDRAUX_IPP_ -#define _FAST_DDS_GENERATED_BASICCDRAUX_IPP_ - -#include "BasicCdrAux.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 EnumStruct& 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 EnumStruct& 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, - EnumStruct& 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 EnumStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const AliasStruct& 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_alias(), 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 AliasStruct& 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_alias() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - AliasStruct& 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_alias(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const AliasStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const AliasAliasStruct& 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_alias_alias(), 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 AliasAliasStruct& 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_alias_alias() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - AliasAliasStruct& 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_alias_alias(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const AliasAliasStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const BoolStruct& 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.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const BoolStruct& 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() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - BoolStruct& 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; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const BoolStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const OctetStruct& 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_octet(), 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 OctetStruct& 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_octet() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - OctetStruct& 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_octet(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const OctetStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const ShortStruct& 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_int16(), 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 ShortStruct& 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_int16() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - ShortStruct& 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_int16(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const ShortStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const LongStruct& 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_int32(), 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 LongStruct& 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_int32() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - LongStruct& 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_int32(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const LongStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const LongLongStruct& 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_int64(), 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 LongLongStruct& 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_int64() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - LongLongStruct& 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_int64(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const LongLongStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const UShortStruct& 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_uint16(), 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 UShortStruct& 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_uint16() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - UShortStruct& 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_uint16(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const UShortStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const ULongStruct& 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_uint32(), 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 ULongStruct& 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_uint32() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - ULongStruct& 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_uint32(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const ULongStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const ULongLongStruct& 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_uint64(), 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 ULongLongStruct& 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_uint64() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - ULongLongStruct& 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_uint64(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const ULongLongStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const FloatStruct& 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_float32(), 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 FloatStruct& 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_float32() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - FloatStruct& 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_float32(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const FloatStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const DoubleStruct& 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_float64(), 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 DoubleStruct& 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_float64() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - DoubleStruct& 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_float64(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const DoubleStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const LongDoubleStruct& 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_float128(), 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 LongDoubleStruct& 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_float128() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - LongDoubleStruct& 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_float128(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const LongDoubleStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const CharStruct& 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_char(), 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 CharStruct& 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_char() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - CharStruct& 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_char(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const CharStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const WCharStruct& 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_wchar(), 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 WCharStruct& 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_wchar() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - WCharStruct& 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_wchar(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const WCharStruct& 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 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 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 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 ArraytStruct& 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 ArraytStruct& 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, - ArraytStruct& 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 ArraytStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const ArrayArrayStruct& 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_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 ArrayArrayStruct& 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_array() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - ArrayArrayStruct& 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_array(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const ArrayArrayStruct& 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 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 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 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 MyBitset& data, - size_t& current_alignment) -{ - return calculator.calculate_serialized_size(data.bitset(), current_alignment); -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const MyBitset& data) -{ - scdr << data.bitset(); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& dcdr, - MyBitset& data) -{ - std::bitset<30> bitset; - dcdr >> bitset; - data.bitset(bitset); -} - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const BitsetStruct& 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.a(), 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 BitsetStruct& 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.a() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - BitsetStruct& 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.a(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const BitsetStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const StructStruct& 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.a(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.b(), 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 StructStruct& 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.a() - << eprosima::fastcdr::MemberId(1) << data.b() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - StructStruct& 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.a(); - break; - - case 1: - dcdr >> data.b(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const StructStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const StructStructStruct& 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.child_struct(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.child_int64(), 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 StructStructStruct& 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.child_struct() - << eprosima::fastcdr::MemberId(1) << data.child_int64() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - StructStructStruct& 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.child_struct(); - break; - - case 1: - dcdr >> data.child_int64(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const StructStructStruct& 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 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 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 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, - 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 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 UnionUnion& 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 UnionUnion& 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, - UnionUnion& 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 WCharUnion& 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 WCharUnion& 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, - WCharUnion& 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 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 UnionUnionUnionStruct& 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 UnionUnionUnionStruct& 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, - UnionUnionUnionStruct& 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 UnionUnionUnionStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const WCharUnionStruct& 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 WCharUnionStruct& 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, - WCharUnionStruct& 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 WCharUnionStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - -} // namespace fastcdr -} // namespace eprosima - -#endif // _FAST_DDS_GENERATED_BASICCDRAUX_IPP_ - diff --git a/test/unittest/dynamic_types/idl/BasicPubSubTypes.cxx b/test/unittest/dynamic_types/idl/BasicPubSubTypes.cxx deleted file mode 100644 index ce2399792b3..00000000000 --- a/test/unittest/dynamic_types/idl/BasicPubSubTypes.cxx +++ /dev/null @@ -1,6217 +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 BasicPubSubTypes.cpp - * This header file contains the implementation of the serialization functions. - * - * This file was generated by the tool fastddsgen. - */ - -#include "BasicPubSubTypes.h" - -#include -#include - -#include "BasicCdrAux.hpp" -#include "BasicTypeObjectSupport.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; - -EnumStructPubSubType::EnumStructPubSubType() -{ - setName("EnumStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(EnumStruct::getMaxCdrSerializedSize()); -#else - EnumStruct_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 = EnumStruct_max_key_cdr_typesize > 16 ? EnumStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -EnumStructPubSubType::~EnumStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool EnumStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - EnumStruct* 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 EnumStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - EnumStruct* 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 EnumStructPubSubType::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* EnumStructPubSubType::createData() -{ - return reinterpret_cast(new EnumStruct()); -} - -void EnumStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool EnumStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - EnumStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - EnumStruct_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 || EnumStruct_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} - -void EnumStructPubSubType::register_type_object_representation() const -{ - register_Basic_type_objects(); -} - -AliasStructPubSubType::AliasStructPubSubType() -{ - setName("AliasStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(AliasStruct::getMaxCdrSerializedSize()); -#else - AliasStruct_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 = AliasStruct_max_key_cdr_typesize > 16 ? AliasStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -AliasStructPubSubType::~AliasStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool AliasStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - AliasStruct* 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 AliasStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - AliasStruct* 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 AliasStructPubSubType::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* AliasStructPubSubType::createData() -{ - return reinterpret_cast(new AliasStruct()); -} - -void AliasStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool AliasStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - AliasStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - AliasStruct_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 || AliasStruct_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} - -void AliasStructPubSubType::register_type_object_representation() const -{ - register_Basic_type_objects(); -} - -AliasAliasStructPubSubType::AliasAliasStructPubSubType() -{ - setName("AliasAliasStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(AliasAliasStruct::getMaxCdrSerializedSize()); -#else - AliasAliasStruct_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 = AliasAliasStruct_max_key_cdr_typesize > 16 ? AliasAliasStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -AliasAliasStructPubSubType::~AliasAliasStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool AliasAliasStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - AliasAliasStruct* 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 AliasAliasStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - AliasAliasStruct* 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 AliasAliasStructPubSubType::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* AliasAliasStructPubSubType::createData() -{ - return reinterpret_cast(new AliasAliasStruct()); -} - -void AliasAliasStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool AliasAliasStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - AliasAliasStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - AliasAliasStruct_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 || AliasAliasStruct_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} - -void AliasAliasStructPubSubType::register_type_object_representation() const -{ - register_Basic_type_objects(); -} - -BoolStructPubSubType::BoolStructPubSubType() -{ - setName("BoolStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(BoolStruct::getMaxCdrSerializedSize()); -#else - BoolStruct_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 = BoolStruct_max_key_cdr_typesize > 16 ? BoolStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -BoolStructPubSubType::~BoolStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool BoolStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - BoolStruct* 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 BoolStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - BoolStruct* 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 BoolStructPubSubType::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* BoolStructPubSubType::createData() -{ - return reinterpret_cast(new BoolStruct()); -} - -void BoolStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool BoolStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - BoolStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - BoolStruct_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 || BoolStruct_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} - -void BoolStructPubSubType::register_type_object_representation() const -{ - register_Basic_type_objects(); -} - -OctetStructPubSubType::OctetStructPubSubType() -{ - setName("OctetStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(OctetStruct::getMaxCdrSerializedSize()); -#else - OctetStruct_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 = OctetStruct_max_key_cdr_typesize > 16 ? OctetStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -OctetStructPubSubType::~OctetStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool OctetStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - OctetStruct* 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 OctetStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - OctetStruct* 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 OctetStructPubSubType::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* OctetStructPubSubType::createData() -{ - return reinterpret_cast(new OctetStruct()); -} - -void OctetStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool OctetStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - OctetStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - OctetStruct_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 || OctetStruct_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} - -void OctetStructPubSubType::register_type_object_representation() const -{ - register_Basic_type_objects(); -} - -ShortStructPubSubType::ShortStructPubSubType() -{ - setName("ShortStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(ShortStruct::getMaxCdrSerializedSize()); -#else - ShortStruct_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 = ShortStruct_max_key_cdr_typesize > 16 ? ShortStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -ShortStructPubSubType::~ShortStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool ShortStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - ShortStruct* 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 ShortStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - ShortStruct* 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 ShortStructPubSubType::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* ShortStructPubSubType::createData() -{ - return reinterpret_cast(new ShortStruct()); -} - -void ShortStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool ShortStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - ShortStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - ShortStruct_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 || ShortStruct_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} - -void ShortStructPubSubType::register_type_object_representation() const -{ - register_Basic_type_objects(); -} - -LongStructPubSubType::LongStructPubSubType() -{ - setName("LongStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(LongStruct::getMaxCdrSerializedSize()); -#else - LongStruct_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 = LongStruct_max_key_cdr_typesize > 16 ? LongStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -LongStructPubSubType::~LongStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool LongStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - LongStruct* 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 LongStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - LongStruct* 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 LongStructPubSubType::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* LongStructPubSubType::createData() -{ - return reinterpret_cast(new LongStruct()); -} - -void LongStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool LongStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - LongStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - LongStruct_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 || LongStruct_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} - -void LongStructPubSubType::register_type_object_representation() const -{ - register_Basic_type_objects(); -} - -LongLongStructPubSubType::LongLongStructPubSubType() -{ - setName("LongLongStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(LongLongStruct::getMaxCdrSerializedSize()); -#else - LongLongStruct_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 = LongLongStruct_max_key_cdr_typesize > 16 ? LongLongStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -LongLongStructPubSubType::~LongLongStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool LongLongStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - LongLongStruct* 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 LongLongStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - LongLongStruct* 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 LongLongStructPubSubType::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* LongLongStructPubSubType::createData() -{ - return reinterpret_cast(new LongLongStruct()); -} - -void LongLongStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool LongLongStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - LongLongStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - LongLongStruct_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 || LongLongStruct_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} - -void LongLongStructPubSubType::register_type_object_representation() const -{ - register_Basic_type_objects(); -} - -UShortStructPubSubType::UShortStructPubSubType() -{ - setName("UShortStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(UShortStruct::getMaxCdrSerializedSize()); -#else - UShortStruct_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 = UShortStruct_max_key_cdr_typesize > 16 ? UShortStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -UShortStructPubSubType::~UShortStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool UShortStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - UShortStruct* 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 UShortStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - UShortStruct* 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 UShortStructPubSubType::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* UShortStructPubSubType::createData() -{ - return reinterpret_cast(new UShortStruct()); -} - -void UShortStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool UShortStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - UShortStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - UShortStruct_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 || UShortStruct_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} - -void UShortStructPubSubType::register_type_object_representation() const -{ - register_Basic_type_objects(); -} - -ULongStructPubSubType::ULongStructPubSubType() -{ - setName("ULongStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(ULongStruct::getMaxCdrSerializedSize()); -#else - ULongStruct_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 = ULongStruct_max_key_cdr_typesize > 16 ? ULongStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -ULongStructPubSubType::~ULongStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool ULongStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - ULongStruct* 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 ULongStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - ULongStruct* 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 ULongStructPubSubType::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* ULongStructPubSubType::createData() -{ - return reinterpret_cast(new ULongStruct()); -} - -void ULongStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool ULongStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - ULongStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - ULongStruct_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 || ULongStruct_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} - -void ULongStructPubSubType::register_type_object_representation() const -{ - register_Basic_type_objects(); -} - -ULongLongStructPubSubType::ULongLongStructPubSubType() -{ - setName("ULongLongStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(ULongLongStruct::getMaxCdrSerializedSize()); -#else - ULongLongStruct_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 = ULongLongStruct_max_key_cdr_typesize > 16 ? ULongLongStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -ULongLongStructPubSubType::~ULongLongStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool ULongLongStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - ULongLongStruct* 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 ULongLongStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - ULongLongStruct* 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 ULongLongStructPubSubType::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* ULongLongStructPubSubType::createData() -{ - return reinterpret_cast(new ULongLongStruct()); -} - -void ULongLongStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool ULongLongStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - ULongLongStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - ULongLongStruct_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 || ULongLongStruct_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} - -void ULongLongStructPubSubType::register_type_object_representation() const -{ - register_Basic_type_objects(); -} - -FloatStructPubSubType::FloatStructPubSubType() -{ - setName("FloatStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(FloatStruct::getMaxCdrSerializedSize()); -#else - FloatStruct_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 = FloatStruct_max_key_cdr_typesize > 16 ? FloatStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -FloatStructPubSubType::~FloatStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool FloatStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - FloatStruct* 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 FloatStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - FloatStruct* 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 FloatStructPubSubType::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* FloatStructPubSubType::createData() -{ - return reinterpret_cast(new FloatStruct()); -} - -void FloatStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool FloatStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - FloatStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - FloatStruct_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 || FloatStruct_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} - -void FloatStructPubSubType::register_type_object_representation() const -{ - register_Basic_type_objects(); -} - -DoubleStructPubSubType::DoubleStructPubSubType() -{ - setName("DoubleStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(DoubleStruct::getMaxCdrSerializedSize()); -#else - DoubleStruct_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 = DoubleStruct_max_key_cdr_typesize > 16 ? DoubleStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -DoubleStructPubSubType::~DoubleStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool DoubleStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - DoubleStruct* 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 DoubleStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - DoubleStruct* 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 DoubleStructPubSubType::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* DoubleStructPubSubType::createData() -{ - return reinterpret_cast(new DoubleStruct()); -} - -void DoubleStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool DoubleStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - DoubleStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - DoubleStruct_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 || DoubleStruct_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} - -void DoubleStructPubSubType::register_type_object_representation() const -{ - register_Basic_type_objects(); -} - -LongDoubleStructPubSubType::LongDoubleStructPubSubType() -{ - setName("LongDoubleStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(LongDoubleStruct::getMaxCdrSerializedSize()); -#else - LongDoubleStruct_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 = LongDoubleStruct_max_key_cdr_typesize > 16 ? LongDoubleStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -LongDoubleStructPubSubType::~LongDoubleStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool LongDoubleStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - LongDoubleStruct* 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 LongDoubleStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - LongDoubleStruct* 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 LongDoubleStructPubSubType::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* LongDoubleStructPubSubType::createData() -{ - return reinterpret_cast(new LongDoubleStruct()); -} - -void LongDoubleStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool LongDoubleStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - LongDoubleStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - LongDoubleStruct_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 || LongDoubleStruct_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} - -void LongDoubleStructPubSubType::register_type_object_representation() const -{ - register_Basic_type_objects(); -} - -CharStructPubSubType::CharStructPubSubType() -{ - setName("CharStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(CharStruct::getMaxCdrSerializedSize()); -#else - CharStruct_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 = CharStruct_max_key_cdr_typesize > 16 ? CharStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -CharStructPubSubType::~CharStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool CharStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - CharStruct* 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 CharStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - CharStruct* 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 CharStructPubSubType::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* CharStructPubSubType::createData() -{ - return reinterpret_cast(new CharStruct()); -} - -void CharStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool CharStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - CharStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - CharStruct_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 || CharStruct_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} - -void CharStructPubSubType::register_type_object_representation() const -{ - register_Basic_type_objects(); -} - -WCharStructPubSubType::WCharStructPubSubType() -{ - setName("WCharStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(WCharStruct::getMaxCdrSerializedSize()); -#else - WCharStruct_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 = WCharStruct_max_key_cdr_typesize > 16 ? WCharStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -WCharStructPubSubType::~WCharStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool WCharStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - WCharStruct* 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 WCharStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - WCharStruct* 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 WCharStructPubSubType::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* WCharStructPubSubType::createData() -{ - return reinterpret_cast(new WCharStruct()); -} - -void WCharStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool WCharStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - WCharStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - WCharStruct_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 || WCharStruct_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} - -void WCharStructPubSubType::register_type_object_representation() const -{ - register_Basic_type_objects(); -} - -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; -} - -void StringStructPubSubType::register_type_object_representation() const -{ - register_Basic_type_objects(); -} - -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; -} - -void WStringStructPubSubType::register_type_object_representation() const -{ - register_Basic_type_objects(); -} - -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; -} - -void LargeStringStructPubSubType::register_type_object_representation() const -{ - register_Basic_type_objects(); -} - -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; -} - -void LargeWStringStructPubSubType::register_type_object_representation() const -{ - register_Basic_type_objects(); -} - -ArraytStructPubSubType::ArraytStructPubSubType() -{ - setName("ArraytStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(ArraytStruct::getMaxCdrSerializedSize()); -#else - ArraytStruct_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 = ArraytStruct_max_key_cdr_typesize > 16 ? ArraytStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -ArraytStructPubSubType::~ArraytStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool ArraytStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - ArraytStruct* 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 ArraytStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - ArraytStruct* 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 ArraytStructPubSubType::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* ArraytStructPubSubType::createData() -{ - return reinterpret_cast(new ArraytStruct()); -} - -void ArraytStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool ArraytStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - ArraytStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - ArraytStruct_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 || ArraytStruct_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} - -void ArraytStructPubSubType::register_type_object_representation() const -{ - register_Basic_type_objects(); -} - - -ArrayArrayStructPubSubType::ArrayArrayStructPubSubType() -{ - setName("ArrayArrayStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(ArrayArrayStruct::getMaxCdrSerializedSize()); -#else - ArrayArrayStruct_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 = ArrayArrayStruct_max_key_cdr_typesize > 16 ? ArrayArrayStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -ArrayArrayStructPubSubType::~ArrayArrayStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool ArrayArrayStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - ArrayArrayStruct* 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 ArrayArrayStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - ArrayArrayStruct* 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 ArrayArrayStructPubSubType::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* ArrayArrayStructPubSubType::createData() -{ - return reinterpret_cast(new ArrayArrayStruct()); -} - -void ArrayArrayStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool ArrayArrayStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - ArrayArrayStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - ArrayArrayStruct_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 || ArrayArrayStruct_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} - -void ArrayArrayStructPubSubType::register_type_object_representation() const -{ - register_Basic_type_objects(); -} - -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; -} - -void SequenceStructPubSubType::register_type_object_representation() const -{ - register_Basic_type_objects(); -} - -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; -} - -void SequenceSequenceStructPubSubType::register_type_object_representation() const -{ - register_Basic_type_objects(); -} - -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; -} - -void MapStructPubSubType::register_type_object_representation() const -{ - register_Basic_type_objects(); -} - -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; -} - -void MapMapStructPubSubType::register_type_object_representation() const -{ - register_Basic_type_objects(); -} - - -BitsetStructPubSubType::BitsetStructPubSubType() -{ - setName("BitsetStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(BitsetStruct::getMaxCdrSerializedSize()); -#else - BitsetStruct_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 = BitsetStruct_max_key_cdr_typesize > 16 ? BitsetStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -BitsetStructPubSubType::~BitsetStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool BitsetStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - BitsetStruct* 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 BitsetStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - BitsetStruct* 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 BitsetStructPubSubType::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* BitsetStructPubSubType::createData() -{ - return reinterpret_cast(new BitsetStruct()); -} - -void BitsetStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool BitsetStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - BitsetStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - BitsetStruct_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 || BitsetStruct_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} - -void BitsetStructPubSubType::register_type_object_representation() const -{ - register_Basic_type_objects(); -} - -StructStructPubSubType::StructStructPubSubType() -{ - setName("StructStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(StructStruct::getMaxCdrSerializedSize()); -#else - StructStruct_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 = StructStruct_max_key_cdr_typesize > 16 ? StructStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -StructStructPubSubType::~StructStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool StructStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - StructStruct* 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 StructStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - StructStruct* 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 StructStructPubSubType::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* StructStructPubSubType::createData() -{ - return reinterpret_cast(new StructStruct()); -} - -void StructStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool StructStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - StructStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - StructStruct_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 || StructStruct_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} - -void StructStructPubSubType::register_type_object_representation() const -{ - register_Basic_type_objects(); -} - -StructStructStructPubSubType::StructStructStructPubSubType() -{ - setName("StructStructStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(StructStructStruct::getMaxCdrSerializedSize()); -#else - StructStructStruct_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 = StructStructStruct_max_key_cdr_typesize > 16 ? StructStructStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -StructStructStructPubSubType::~StructStructStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool StructStructStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - StructStructStruct* 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 StructStructStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - StructStructStruct* 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 StructStructStructPubSubType::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* StructStructStructPubSubType::createData() -{ - return reinterpret_cast(new StructStructStruct()); -} - -void StructStructStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool StructStructStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - StructStructStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - StructStructStruct_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 || StructStructStruct_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} - -void StructStructStructPubSubType::register_type_object_representation() const -{ - register_Basic_type_objects(); -} - - - - -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; -} - -void SimpleUnionStructPubSubType::register_type_object_representation() const -{ - register_Basic_type_objects(); -} - -UnionUnionUnionStructPubSubType::UnionUnionUnionStructPubSubType() -{ - setName("UnionUnionUnionStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(UnionUnionUnionStruct::getMaxCdrSerializedSize()); -#else - UnionUnionUnionStruct_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 = UnionUnionUnionStruct_max_key_cdr_typesize > 16 ? UnionUnionUnionStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -UnionUnionUnionStructPubSubType::~UnionUnionUnionStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool UnionUnionUnionStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - UnionUnionUnionStruct* 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 UnionUnionUnionStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - UnionUnionUnionStruct* 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 UnionUnionUnionStructPubSubType::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* UnionUnionUnionStructPubSubType::createData() -{ - return reinterpret_cast(new UnionUnionUnionStruct()); -} - -void UnionUnionUnionStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool UnionUnionUnionStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - UnionUnionUnionStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - UnionUnionUnionStruct_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 || UnionUnionUnionStruct_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} - -void UnionUnionUnionStructPubSubType::register_type_object_representation() const -{ - register_Basic_type_objects(); -} - -WCharUnionStructPubSubType::WCharUnionStructPubSubType() -{ - setName("WCharUnionStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(WCharUnionStruct::getMaxCdrSerializedSize()); -#else - WCharUnionStruct_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 = WCharUnionStruct_max_key_cdr_typesize > 16 ? WCharUnionStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -WCharUnionStructPubSubType::~WCharUnionStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool WCharUnionStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - WCharUnionStruct* 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 WCharUnionStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - WCharUnionStruct* 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 WCharUnionStructPubSubType::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* WCharUnionStructPubSubType::createData() -{ - return reinterpret_cast(new WCharUnionStruct()); -} - -void WCharUnionStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool WCharUnionStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - WCharUnionStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - WCharUnionStruct_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 || WCharUnionStruct_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} - -void WCharUnionStructPubSubType::register_type_object_representation() const -{ - register_Basic_type_objects(); -} - - -// Include auxiliary functions like for serializing/deserializing. -#include "BasicCdrAux.ipp" diff --git a/test/unittest/dynamic_types/idl/BasicPubSubTypes.h b/test/unittest/dynamic_types/idl/BasicPubSubTypes.h deleted file mode 100644 index 57cb49b8b99..00000000000 --- a/test/unittest/dynamic_types/idl/BasicPubSubTypes.h +++ /dev/null @@ -1,2961 +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 BasicPubSubTypes.h - * This header file contains the declaration of the serialization functions. - * - * This file was generated by the tool fastddsgen. - */ - - -#ifndef _FAST_DDS_GENERATED_BASIC_PUBSUBTYPES_H_ -#define _FAST_DDS_GENERATED_BASIC_PUBSUBTYPES_H_ - -#include -#include -#include -#include -#include - -#include "Basic.hpp" - - -#if !defined(GEN_API_VER) || (GEN_API_VER != 2) -#error \ - Generated Basic is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. -#endif // GEN_API_VER - -typedef MyEnum MyAliasEnum; -typedef MyAliasEnum MyAliasAliasEnum; - -/*! - * @brief This class represents the TopicDataType of the type EnumStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class EnumStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef EnumStruct type; - - eProsima_user_DllExport EnumStructPubSubType(); - - eProsima_user_DllExport ~EnumStructPubSubType() 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 AliasStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class AliasStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef AliasStruct type; - - eProsima_user_DllExport AliasStructPubSubType(); - - eProsima_user_DllExport ~AliasStructPubSubType() 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 AliasAliasStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class AliasAliasStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef AliasAliasStruct type; - - eProsima_user_DllExport AliasAliasStructPubSubType(); - - eProsima_user_DllExport ~AliasAliasStructPubSubType() 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 BoolStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class BoolStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef BoolStruct type; - - eProsima_user_DllExport BoolStructPubSubType(); - - eProsima_user_DllExport ~BoolStructPubSubType() 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 OctetStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class OctetStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef OctetStruct type; - - eProsima_user_DllExport OctetStructPubSubType(); - - eProsima_user_DllExport ~OctetStructPubSubType() 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 ShortStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class ShortStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef ShortStruct type; - - eProsima_user_DllExport ShortStructPubSubType(); - - eProsima_user_DllExport ~ShortStructPubSubType() 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 LongStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class LongStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef LongStruct type; - - eProsima_user_DllExport LongStructPubSubType(); - - eProsima_user_DllExport ~LongStructPubSubType() 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 LongLongStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class LongLongStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef LongLongStruct type; - - eProsima_user_DllExport LongLongStructPubSubType(); - - eProsima_user_DllExport ~LongLongStructPubSubType() 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 UShortStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class UShortStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef UShortStruct type; - - eProsima_user_DllExport UShortStructPubSubType(); - - eProsima_user_DllExport ~UShortStructPubSubType() 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 ULongStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class ULongStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef ULongStruct type; - - eProsima_user_DllExport ULongStructPubSubType(); - - eProsima_user_DllExport ~ULongStructPubSubType() 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 ULongLongStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class ULongLongStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef ULongLongStruct type; - - eProsima_user_DllExport ULongLongStructPubSubType(); - - eProsima_user_DllExport ~ULongLongStructPubSubType() 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 FloatStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class FloatStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef FloatStruct type; - - eProsima_user_DllExport FloatStructPubSubType(); - - eProsima_user_DllExport ~FloatStructPubSubType() 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 DoubleStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class DoubleStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef DoubleStruct type; - - eProsima_user_DllExport DoubleStructPubSubType(); - - eProsima_user_DllExport ~DoubleStructPubSubType() 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 LongDoubleStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class LongDoubleStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef LongDoubleStruct type; - - eProsima_user_DllExport LongDoubleStructPubSubType(); - - eProsima_user_DllExport ~LongDoubleStructPubSubType() 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 CharStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class CharStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef CharStruct type; - - eProsima_user_DllExport CharStructPubSubType(); - - eProsima_user_DllExport ~CharStructPubSubType() 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 WCharStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class WCharStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef WCharStruct type; - - eProsima_user_DllExport WCharStructPubSubType(); - - eProsima_user_DllExport ~WCharStructPubSubType() 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 StringStruct defined by the user in the IDL file. - * @ingroup Basic - */ -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; - - //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 WStringStruct defined by the user in the IDL file. - * @ingroup Basic - */ -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; - - //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 LargeStringStruct defined by the user in the IDL file. - * @ingroup Basic - */ -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; - - //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 LargeWStringStruct defined by the user in the IDL file. - * @ingroup Basic - */ -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; - - //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 ArraytStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class ArraytStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef ArraytStruct type; - - eProsima_user_DllExport ArraytStructPubSubType(); - - eProsima_user_DllExport ~ArraytStructPubSubType() 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::array, 2> MyArray; - -/*! - * @brief This class represents the TopicDataType of the type ArrayArrayStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class ArrayArrayStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef ArrayArrayStruct type; - - eProsima_user_DllExport ArrayArrayStructPubSubType(); - - eProsima_user_DllExport ~ArrayArrayStructPubSubType() 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 SequenceStruct defined by the user in the IDL file. - * @ingroup Basic - */ -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; - - //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 SequenceSequenceStruct defined by the user in the IDL file. - * @ingroup Basic - */ -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; - - //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 MapStruct defined by the user in the IDL file. - * @ingroup Basic - */ -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; - - //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 MapMapStruct defined by the user in the IDL file. - * @ingroup Basic - */ -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; - - //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 BitsetStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class BitsetStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef BitsetStruct type; - - eProsima_user_DllExport BitsetStructPubSubType(); - - eProsima_user_DllExport ~BitsetStructPubSubType() 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 StructStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class StructStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef StructStruct type; - - eProsima_user_DllExport StructStructPubSubType(); - - eProsima_user_DllExport ~StructStructPubSubType() 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 StructStructStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class StructStructStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef StructStructStruct type; - - eProsima_user_DllExport StructStructStructPubSubType(); - - eProsima_user_DllExport ~StructStructStructPubSubType() 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 SimpleUnionStruct defined by the user in the IDL file. - * @ingroup Basic - */ -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; - - //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 UnionUnionUnionStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class UnionUnionUnionStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef UnionUnionUnionStruct type; - - eProsima_user_DllExport UnionUnionUnionStructPubSubType(); - - eProsima_user_DllExport ~UnionUnionUnionStructPubSubType() 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 WCharUnionStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class WCharUnionStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef WCharUnionStruct type; - - eProsima_user_DllExport WCharUnionStructPubSubType(); - - eProsima_user_DllExport ~WCharUnionStructPubSubType() 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; - -}; - -#endif // _FAST_DDS_GENERATED_BASIC_PUBSUBTYPES_H_ - diff --git a/test/unittest/dynamic_types/idl/BasicTypeObjectSupport.cxx b/test/unittest/dynamic_types/idl/BasicTypeObjectSupport.cxx deleted file mode 100644 index fece7f1b7be..00000000000 --- a/test/unittest/dynamic_types/idl/BasicTypeObjectSupport.cxx +++ /dev/null @@ -1,6725 +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 BasicTypeObjectSupport.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 "BasicTypeObjectSupport.hpp" - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "Basic.hpp" - - -using namespace eprosima::fastdds::dds::xtypes; - -void register_Basic_type_objects() -{ - static std::once_flag once_flag; - std::call_once(once_flag, []() - { - register_EnumStruct_type_identifier(); - - register_AliasStruct_type_identifier(); - - register_AliasAliasStruct_type_identifier(); - - register_BoolStruct_type_identifier(); - - register_OctetStruct_type_identifier(); - - register_ShortStruct_type_identifier(); - - register_LongStruct_type_identifier(); - - register_LongLongStruct_type_identifier(); - - register_UShortStruct_type_identifier(); - - register_ULongStruct_type_identifier(); - - register_ULongLongStruct_type_identifier(); - - register_FloatStruct_type_identifier(); - - register_DoubleStruct_type_identifier(); - - register_LongDoubleStruct_type_identifier(); - - register_CharStruct_type_identifier(); - - register_WCharStruct_type_identifier(); - - register_StringStruct_type_identifier(); - - register_WStringStruct_type_identifier(); - - register_LargeStringStruct_type_identifier(); - - register_LargeWStringStruct_type_identifier(); - - register_ArraytStruct_type_identifier(); - - register_ArrayArrayStruct_type_identifier(); - - register_SequenceStruct_type_identifier(); - - register_SequenceSequenceStruct_type_identifier(); - - register_MapStruct_type_identifier(); - - register_MapMapStruct_type_identifier(); - - register_BitsetStruct_type_identifier(); - - register_StructStruct_type_identifier(); - - register_StructStructStruct_type_identifier(); - - register_SimpleUnion_type_identifier(); - - register_UnionUnion_type_identifier(); - - register_WCharUnion_type_identifier(); - - register_SimpleUnionStruct_type_identifier(); - - register_UnionUnionUnionStruct_type_identifier(); - - register_WCharUnionStruct_type_identifier(); - - }); -} - -void register_EnumStruct_type_identifier() -{ - { - StructTypeFlag struct_flags_EnumStruct = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_EnumStruct; - TypeIdentifierPair type_ids_EnumStruct; - QualifiedTypeName type_name_EnumStruct = "EnumStruct"; - eprosima::fastcdr::optional type_ann_builtin_EnumStruct; - eprosima::fastcdr::optional ann_custom_EnumStruct; - CompleteTypeDetail detail_EnumStruct = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_EnumStruct, ann_custom_EnumStruct, type_name_EnumStruct.to_string()); - CompleteStructHeader header_EnumStruct; - header_EnumStruct = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_EnumStruct); - CompleteStructMemberSeq member_seq_EnumStruct; - { - return_code_EnumStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyEnum", type_ids_EnumStruct); - - if (return_code_EnumStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EnumTypeFlag enum_flags_MyEnum = 0; - BitBound bit_bound_MyEnum = 32; - CommonEnumeratedHeader common_MyEnum = TypeObjectUtils::build_common_enumerated_header(bit_bound_MyEnum); - QualifiedTypeName type_name_MyEnum = "MyEnum"; - eprosima::fastcdr::optional type_ann_builtin_MyEnum; - eprosima::fastcdr::optional ann_custom_MyEnum; - CompleteTypeDetail detail_MyEnum = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_MyEnum, ann_custom_MyEnum, type_name_MyEnum.to_string()); - CompleteEnumeratedHeader header_MyEnum = TypeObjectUtils::build_complete_enumerated_header(common_MyEnum, detail_MyEnum); - CompleteEnumeratedLiteralSeq literal_seq_MyEnum; - { - EnumeratedLiteralFlag flags_A = TypeObjectUtils::build_enumerated_literal_flag(false); - CommonEnumeratedLiteral common_A = TypeObjectUtils::build_common_enumerated_literal(0, flags_A); - eprosima::fastcdr::optional member_ann_builtin_A; - ann_custom_MyEnum.reset(); - MemberName name_A = "A"; - CompleteMemberDetail detail_A = TypeObjectUtils::build_complete_member_detail(name_A, member_ann_builtin_A, ann_custom_MyEnum); - CompleteEnumeratedLiteral literal_A = TypeObjectUtils::build_complete_enumerated_literal(common_A, detail_A); - TypeObjectUtils::add_complete_enumerated_literal(literal_seq_MyEnum, literal_A); - } - { - EnumeratedLiteralFlag flags_B = TypeObjectUtils::build_enumerated_literal_flag(false); - CommonEnumeratedLiteral common_B = TypeObjectUtils::build_common_enumerated_literal(1, flags_B); - eprosima::fastcdr::optional member_ann_builtin_B; - ann_custom_MyEnum.reset(); - MemberName name_B = "B"; - CompleteMemberDetail detail_B = TypeObjectUtils::build_complete_member_detail(name_B, member_ann_builtin_B, ann_custom_MyEnum); - CompleteEnumeratedLiteral literal_B = TypeObjectUtils::build_complete_enumerated_literal(common_B, detail_B); - TypeObjectUtils::add_complete_enumerated_literal(literal_seq_MyEnum, literal_B); - } - { - EnumeratedLiteralFlag flags_C = TypeObjectUtils::build_enumerated_literal_flag(false); - CommonEnumeratedLiteral common_C = TypeObjectUtils::build_common_enumerated_literal(2, flags_C); - eprosima::fastcdr::optional member_ann_builtin_C; - ann_custom_MyEnum.reset(); - MemberName name_C = "C"; - CompleteMemberDetail detail_C = TypeObjectUtils::build_complete_member_detail(name_C, member_ann_builtin_C, ann_custom_MyEnum); - CompleteEnumeratedLiteral literal_C = TypeObjectUtils::build_complete_enumerated_literal(common_C, detail_C); - TypeObjectUtils::add_complete_enumerated_literal(literal_seq_MyEnum, literal_C); - } - CompleteEnumeratedType enumerated_type_MyEnum = TypeObjectUtils::build_complete_enumerated_type(enum_flags_MyEnum, header_MyEnum, - literal_seq_MyEnum); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_enumerated_type_object(enumerated_type_MyEnum, type_name_MyEnum.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyEnum already registered in TypeObjectRegistry for a different type."); - } - return_code_EnumStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyEnum", type_ids_EnumStruct); - if (return_code_EnumStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyEnum: Given Enum TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_enum = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_enum; - MemberId member_id_my_enum = 0x00000000; - if (EK_COMPLETE == type_ids_EnumStruct.type_identifier1()._d() || TK_NONE == type_ids_EnumStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_EnumStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_EnumStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_EnumStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_EnumStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_EnumStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_EnumStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_EnumStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_EnumStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_EnumStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_EnumStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_EnumStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_EnumStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_EnumStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_EnumStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_enum = TypeObjectUtils::build_common_struct_member(member_id_my_enum, member_flags_my_enum, type_ids_EnumStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_EnumStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_EnumStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_EnumStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_EnumStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_EnumStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_EnumStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_EnumStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_EnumStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_EnumStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_EnumStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_EnumStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_EnumStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_EnumStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_EnumStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_EnumStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_enum = TypeObjectUtils::build_common_struct_member(member_id_my_enum, member_flags_my_enum, type_ids_EnumStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_enum member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_enum = "my_enum"; - eprosima::fastcdr::optional member_ann_builtin_my_enum; - ann_custom_EnumStruct.reset(); - CompleteMemberDetail detail_my_enum = TypeObjectUtils::build_complete_member_detail(name_my_enum, member_ann_builtin_my_enum, ann_custom_EnumStruct); - CompleteStructMember member_my_enum = TypeObjectUtils::build_complete_struct_member(common_my_enum, detail_my_enum); - TypeObjectUtils::add_complete_struct_member(member_seq_EnumStruct, member_my_enum); - } - CompleteStructType struct_type_EnumStruct = TypeObjectUtils::build_complete_struct_type(struct_flags_EnumStruct, header_EnumStruct, member_seq_EnumStruct); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_EnumStruct, type_name_EnumStruct.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "EnumStruct already registered in TypeObjectRegistry for a different type."); - } - return_code_EnumStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "EnumStruct", type_ids_EnumStruct); - if (return_code_EnumStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "EnumStruct: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } -} -void register_AliasStruct_type_identifier() -{ - { - StructTypeFlag struct_flags_AliasStruct = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_AliasStruct; - TypeIdentifierPair type_ids_AliasStruct; - QualifiedTypeName type_name_AliasStruct = "AliasStruct"; - eprosima::fastcdr::optional type_ann_builtin_AliasStruct; - eprosima::fastcdr::optional ann_custom_AliasStruct; - CompleteTypeDetail detail_AliasStruct = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_AliasStruct, ann_custom_AliasStruct, type_name_AliasStruct.to_string()); - CompleteStructHeader header_AliasStruct; - header_AliasStruct = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_AliasStruct); - CompleteStructMemberSeq member_seq_AliasStruct; - { - return_code_AliasStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyAliasEnum", type_ids_AliasStruct); - - if (return_code_AliasStruct != eprosima::fastdds::dds::RETCODE_OK) - { - AliasTypeFlag alias_flags_MyAliasEnum = 0; - QualifiedTypeName type_name_MyAliasEnum = "MyAliasEnum"; - eprosima::fastcdr::optional type_ann_builtin_MyAliasEnum; - eprosima::fastcdr::optional ann_custom_MyAliasEnum; - CompleteTypeDetail detail_MyAliasEnum = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_MyAliasEnum, ann_custom_MyAliasEnum, type_name_MyAliasEnum.to_string()); - CompleteAliasHeader header_MyAliasEnum = TypeObjectUtils::build_complete_alias_header(detail_MyAliasEnum); - AliasMemberFlag related_flags_MyAliasEnum = 0; - return_code_AliasStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyEnum", type_ids_AliasStruct); - - if (return_code_AliasStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EnumTypeFlag enum_flags_MyEnum = 0; - BitBound bit_bound_MyEnum = 32; - CommonEnumeratedHeader common_MyEnum = TypeObjectUtils::build_common_enumerated_header(bit_bound_MyEnum); - QualifiedTypeName type_name_MyEnum = "MyEnum"; - eprosima::fastcdr::optional type_ann_builtin_MyEnum; - eprosima::fastcdr::optional ann_custom_MyEnum; - CompleteTypeDetail detail_MyEnum = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_MyEnum, ann_custom_MyEnum, type_name_MyEnum.to_string()); - CompleteEnumeratedHeader header_MyEnum = TypeObjectUtils::build_complete_enumerated_header(common_MyEnum, detail_MyEnum); - CompleteEnumeratedLiteralSeq literal_seq_MyEnum; - { - EnumeratedLiteralFlag flags_A = TypeObjectUtils::build_enumerated_literal_flag(false); - CommonEnumeratedLiteral common_A = TypeObjectUtils::build_common_enumerated_literal(0, flags_A); - eprosima::fastcdr::optional member_ann_builtin_A; - ann_custom_MyEnum.reset(); - MemberName name_A = "A"; - CompleteMemberDetail detail_A = TypeObjectUtils::build_complete_member_detail(name_A, member_ann_builtin_A, ann_custom_MyEnum); - CompleteEnumeratedLiteral literal_A = TypeObjectUtils::build_complete_enumerated_literal(common_A, detail_A); - TypeObjectUtils::add_complete_enumerated_literal(literal_seq_MyEnum, literal_A); - } - { - EnumeratedLiteralFlag flags_B = TypeObjectUtils::build_enumerated_literal_flag(false); - CommonEnumeratedLiteral common_B = TypeObjectUtils::build_common_enumerated_literal(1, flags_B); - eprosima::fastcdr::optional member_ann_builtin_B; - ann_custom_MyEnum.reset(); - MemberName name_B = "B"; - CompleteMemberDetail detail_B = TypeObjectUtils::build_complete_member_detail(name_B, member_ann_builtin_B, ann_custom_MyEnum); - CompleteEnumeratedLiteral literal_B = TypeObjectUtils::build_complete_enumerated_literal(common_B, detail_B); - TypeObjectUtils::add_complete_enumerated_literal(literal_seq_MyEnum, literal_B); - } - { - EnumeratedLiteralFlag flags_C = TypeObjectUtils::build_enumerated_literal_flag(false); - CommonEnumeratedLiteral common_C = TypeObjectUtils::build_common_enumerated_literal(2, flags_C); - eprosima::fastcdr::optional member_ann_builtin_C; - ann_custom_MyEnum.reset(); - MemberName name_C = "C"; - CompleteMemberDetail detail_C = TypeObjectUtils::build_complete_member_detail(name_C, member_ann_builtin_C, ann_custom_MyEnum); - CompleteEnumeratedLiteral literal_C = TypeObjectUtils::build_complete_enumerated_literal(common_C, detail_C); - TypeObjectUtils::add_complete_enumerated_literal(literal_seq_MyEnum, literal_C); - } - CompleteEnumeratedType enumerated_type_MyEnum = TypeObjectUtils::build_complete_enumerated_type(enum_flags_MyEnum, header_MyEnum, - literal_seq_MyEnum); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_enumerated_type_object(enumerated_type_MyEnum, type_name_MyEnum.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyEnum already registered in TypeObjectRegistry for a different type."); - } - return_code_AliasStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyEnum", type_ids_AliasStruct); - if (return_code_AliasStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyEnum: Given Enum TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - CommonAliasBody common_MyAliasEnum; - if (EK_COMPLETE == type_ids_AliasStruct.type_identifier1()._d() || TK_NONE == type_ids_AliasStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_AliasStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_AliasStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_AliasStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_AliasStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_AliasStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_AliasStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_AliasStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_AliasStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_AliasStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_AliasStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_AliasStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_AliasStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_AliasStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_AliasStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_MyAliasEnum = TypeObjectUtils::build_common_alias_body(related_flags_MyAliasEnum, type_ids_AliasStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_AliasStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_AliasStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_AliasStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_AliasStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_AliasStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_AliasStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_AliasStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_AliasStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_AliasStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_AliasStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_AliasStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_AliasStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_AliasStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_AliasStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_AliasStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_MyAliasEnum = TypeObjectUtils::build_common_alias_body(related_flags_MyAliasEnum, type_ids_AliasStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyAliasEnum related TypeIdentifier inconsistent."); - return; - } - eprosima::fastcdr::optional member_ann_builtin_MyAliasEnum; - ann_custom_MyAliasEnum.reset(); - CompleteAliasBody body_MyAliasEnum = TypeObjectUtils::build_complete_alias_body(common_MyAliasEnum, member_ann_builtin_MyAliasEnum, ann_custom_MyAliasEnum); - CompleteAliasType alias_type_MyAliasEnum = TypeObjectUtils::build_complete_alias_type(alias_flags_MyAliasEnum, header_MyAliasEnum, body_MyAliasEnum); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_alias_type_object(alias_type_MyAliasEnum, type_name_MyAliasEnum.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyAliasEnum already registered in TypeObjectRegistry for a different type."); - } - return_code_AliasStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyAliasEnum", type_ids_AliasStruct); - if (return_code_AliasStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyAliasEnum: Given Alias TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_alias = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_alias; - MemberId member_id_my_alias = 0x00000000; - if (EK_COMPLETE == type_ids_AliasStruct.type_identifier1()._d() || TK_NONE == type_ids_AliasStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_AliasStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_AliasStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_AliasStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_AliasStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_AliasStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_AliasStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_AliasStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_AliasStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_AliasStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_AliasStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_AliasStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_AliasStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_AliasStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_AliasStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_alias = TypeObjectUtils::build_common_struct_member(member_id_my_alias, member_flags_my_alias, type_ids_AliasStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_AliasStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_AliasStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_AliasStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_AliasStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_AliasStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_AliasStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_AliasStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_AliasStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_AliasStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_AliasStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_AliasStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_AliasStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_AliasStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_AliasStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_AliasStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_alias = TypeObjectUtils::build_common_struct_member(member_id_my_alias, member_flags_my_alias, type_ids_AliasStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_alias member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_alias = "my_alias"; - eprosima::fastcdr::optional member_ann_builtin_my_alias; - ann_custom_AliasStruct.reset(); - CompleteMemberDetail detail_my_alias = TypeObjectUtils::build_complete_member_detail(name_my_alias, member_ann_builtin_my_alias, ann_custom_AliasStruct); - CompleteStructMember member_my_alias = TypeObjectUtils::build_complete_struct_member(common_my_alias, detail_my_alias); - TypeObjectUtils::add_complete_struct_member(member_seq_AliasStruct, member_my_alias); - } - CompleteStructType struct_type_AliasStruct = TypeObjectUtils::build_complete_struct_type(struct_flags_AliasStruct, header_AliasStruct, member_seq_AliasStruct); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_AliasStruct, type_name_AliasStruct.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "AliasStruct already registered in TypeObjectRegistry for a different type."); - } - return_code_AliasStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "AliasStruct", type_ids_AliasStruct); - if (return_code_AliasStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "AliasStruct: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } -} -void register_AliasAliasStruct_type_identifier() -{ - { - StructTypeFlag struct_flags_AliasAliasStruct = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_AliasAliasStruct; - TypeIdentifierPair type_ids_AliasAliasStruct; - QualifiedTypeName type_name_AliasAliasStruct = "AliasAliasStruct"; - eprosima::fastcdr::optional type_ann_builtin_AliasAliasStruct; - eprosima::fastcdr::optional ann_custom_AliasAliasStruct; - CompleteTypeDetail detail_AliasAliasStruct = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_AliasAliasStruct, ann_custom_AliasAliasStruct, type_name_AliasAliasStruct.to_string()); - CompleteStructHeader header_AliasAliasStruct; - header_AliasAliasStruct = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_AliasAliasStruct); - CompleteStructMemberSeq member_seq_AliasAliasStruct; - { - return_code_AliasAliasStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyAliasAliasEnum", type_ids_AliasAliasStruct); - - if (return_code_AliasAliasStruct != eprosima::fastdds::dds::RETCODE_OK) - { - AliasTypeFlag alias_flags_MyAliasAliasEnum = 0; - QualifiedTypeName type_name_MyAliasAliasEnum = "MyAliasAliasEnum"; - eprosima::fastcdr::optional type_ann_builtin_MyAliasAliasEnum; - eprosima::fastcdr::optional ann_custom_MyAliasAliasEnum; - CompleteTypeDetail detail_MyAliasAliasEnum = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_MyAliasAliasEnum, ann_custom_MyAliasAliasEnum, type_name_MyAliasAliasEnum.to_string()); - CompleteAliasHeader header_MyAliasAliasEnum = TypeObjectUtils::build_complete_alias_header(detail_MyAliasAliasEnum); - AliasMemberFlag related_flags_MyAliasAliasEnum = 0; - return_code_AliasAliasStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyAliasEnum", type_ids_AliasAliasStruct); - - if (return_code_AliasAliasStruct != eprosima::fastdds::dds::RETCODE_OK) - { - AliasTypeFlag alias_flags_MyAliasEnum = 0; - QualifiedTypeName type_name_MyAliasEnum = "MyAliasEnum"; - eprosima::fastcdr::optional type_ann_builtin_MyAliasEnum; - eprosima::fastcdr::optional ann_custom_MyAliasEnum; - CompleteTypeDetail detail_MyAliasEnum = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_MyAliasEnum, ann_custom_MyAliasEnum, type_name_MyAliasEnum.to_string()); - CompleteAliasHeader header_MyAliasEnum = TypeObjectUtils::build_complete_alias_header(detail_MyAliasEnum); - AliasMemberFlag related_flags_MyAliasEnum = 0; - return_code_AliasAliasStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyEnum", type_ids_AliasAliasStruct); - - if (return_code_AliasAliasStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EnumTypeFlag enum_flags_MyEnum = 0; - BitBound bit_bound_MyEnum = 32; - CommonEnumeratedHeader common_MyEnum = TypeObjectUtils::build_common_enumerated_header(bit_bound_MyEnum); - QualifiedTypeName type_name_MyEnum = "MyEnum"; - eprosima::fastcdr::optional type_ann_builtin_MyEnum; - eprosima::fastcdr::optional ann_custom_MyEnum; - CompleteTypeDetail detail_MyEnum = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_MyEnum, ann_custom_MyEnum, type_name_MyEnum.to_string()); - CompleteEnumeratedHeader header_MyEnum = TypeObjectUtils::build_complete_enumerated_header(common_MyEnum, detail_MyEnum); - CompleteEnumeratedLiteralSeq literal_seq_MyEnum; - { - EnumeratedLiteralFlag flags_A = TypeObjectUtils::build_enumerated_literal_flag(false); - CommonEnumeratedLiteral common_A = TypeObjectUtils::build_common_enumerated_literal(0, flags_A); - eprosima::fastcdr::optional member_ann_builtin_A; - ann_custom_MyEnum.reset(); - MemberName name_A = "A"; - CompleteMemberDetail detail_A = TypeObjectUtils::build_complete_member_detail(name_A, member_ann_builtin_A, ann_custom_MyEnum); - CompleteEnumeratedLiteral literal_A = TypeObjectUtils::build_complete_enumerated_literal(common_A, detail_A); - TypeObjectUtils::add_complete_enumerated_literal(literal_seq_MyEnum, literal_A); - } - { - EnumeratedLiteralFlag flags_B = TypeObjectUtils::build_enumerated_literal_flag(false); - CommonEnumeratedLiteral common_B = TypeObjectUtils::build_common_enumerated_literal(1, flags_B); - eprosima::fastcdr::optional member_ann_builtin_B; - ann_custom_MyEnum.reset(); - MemberName name_B = "B"; - CompleteMemberDetail detail_B = TypeObjectUtils::build_complete_member_detail(name_B, member_ann_builtin_B, ann_custom_MyEnum); - CompleteEnumeratedLiteral literal_B = TypeObjectUtils::build_complete_enumerated_literal(common_B, detail_B); - TypeObjectUtils::add_complete_enumerated_literal(literal_seq_MyEnum, literal_B); - } - { - EnumeratedLiteralFlag flags_C = TypeObjectUtils::build_enumerated_literal_flag(false); - CommonEnumeratedLiteral common_C = TypeObjectUtils::build_common_enumerated_literal(2, flags_C); - eprosima::fastcdr::optional member_ann_builtin_C; - ann_custom_MyEnum.reset(); - MemberName name_C = "C"; - CompleteMemberDetail detail_C = TypeObjectUtils::build_complete_member_detail(name_C, member_ann_builtin_C, ann_custom_MyEnum); - CompleteEnumeratedLiteral literal_C = TypeObjectUtils::build_complete_enumerated_literal(common_C, detail_C); - TypeObjectUtils::add_complete_enumerated_literal(literal_seq_MyEnum, literal_C); - } - CompleteEnumeratedType enumerated_type_MyEnum = TypeObjectUtils::build_complete_enumerated_type(enum_flags_MyEnum, header_MyEnum, - literal_seq_MyEnum); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_enumerated_type_object(enumerated_type_MyEnum, type_name_MyEnum.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyEnum already registered in TypeObjectRegistry for a different type."); - } - return_code_AliasAliasStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyEnum", type_ids_AliasAliasStruct); - if (return_code_AliasAliasStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyEnum: Given Enum TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - CommonAliasBody common_MyAliasEnum; - if (EK_COMPLETE == type_ids_AliasAliasStruct.type_identifier1()._d() || TK_NONE == type_ids_AliasAliasStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_AliasAliasStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_AliasAliasStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_AliasAliasStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_AliasAliasStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_AliasAliasStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_AliasAliasStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_AliasAliasStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_AliasAliasStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_AliasAliasStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_AliasAliasStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_AliasAliasStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_AliasAliasStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_AliasAliasStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_AliasAliasStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_MyAliasEnum = TypeObjectUtils::build_common_alias_body(related_flags_MyAliasEnum, type_ids_AliasAliasStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_AliasAliasStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_AliasAliasStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_AliasAliasStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_AliasAliasStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_AliasAliasStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_AliasAliasStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_AliasAliasStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_AliasAliasStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_AliasAliasStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_AliasAliasStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_AliasAliasStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_AliasAliasStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_AliasAliasStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_AliasAliasStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_AliasAliasStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_MyAliasEnum = TypeObjectUtils::build_common_alias_body(related_flags_MyAliasEnum, type_ids_AliasAliasStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyAliasEnum related TypeIdentifier inconsistent."); - return; - } - eprosima::fastcdr::optional member_ann_builtin_MyAliasEnum; - ann_custom_MyAliasEnum.reset(); - CompleteAliasBody body_MyAliasEnum = TypeObjectUtils::build_complete_alias_body(common_MyAliasEnum, member_ann_builtin_MyAliasEnum, ann_custom_MyAliasEnum); - CompleteAliasType alias_type_MyAliasEnum = TypeObjectUtils::build_complete_alias_type(alias_flags_MyAliasEnum, header_MyAliasEnum, body_MyAliasEnum); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_alias_type_object(alias_type_MyAliasEnum, type_name_MyAliasEnum.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyAliasEnum already registered in TypeObjectRegistry for a different type."); - } - return_code_AliasAliasStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyAliasEnum", type_ids_AliasAliasStruct); - if (return_code_AliasAliasStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyAliasEnum: Given Alias TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - CommonAliasBody common_MyAliasAliasEnum; - if (EK_COMPLETE == type_ids_AliasAliasStruct.type_identifier1()._d() || TK_NONE == type_ids_AliasAliasStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_AliasAliasStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_AliasAliasStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_AliasAliasStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_AliasAliasStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_AliasAliasStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_AliasAliasStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_AliasAliasStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_AliasAliasStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_AliasAliasStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_AliasAliasStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_AliasAliasStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_AliasAliasStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_AliasAliasStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_AliasAliasStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_MyAliasAliasEnum = TypeObjectUtils::build_common_alias_body(related_flags_MyAliasAliasEnum, type_ids_AliasAliasStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_AliasAliasStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_AliasAliasStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_AliasAliasStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_AliasAliasStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_AliasAliasStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_AliasAliasStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_AliasAliasStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_AliasAliasStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_AliasAliasStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_AliasAliasStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_AliasAliasStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_AliasAliasStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_AliasAliasStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_AliasAliasStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_AliasAliasStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_MyAliasAliasEnum = TypeObjectUtils::build_common_alias_body(related_flags_MyAliasAliasEnum, type_ids_AliasAliasStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyAliasAliasEnum related TypeIdentifier inconsistent."); - return; - } - eprosima::fastcdr::optional member_ann_builtin_MyAliasAliasEnum; - ann_custom_MyAliasAliasEnum.reset(); - CompleteAliasBody body_MyAliasAliasEnum = TypeObjectUtils::build_complete_alias_body(common_MyAliasAliasEnum, member_ann_builtin_MyAliasAliasEnum, ann_custom_MyAliasAliasEnum); - CompleteAliasType alias_type_MyAliasAliasEnum = TypeObjectUtils::build_complete_alias_type(alias_flags_MyAliasAliasEnum, header_MyAliasAliasEnum, body_MyAliasAliasEnum); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_alias_type_object(alias_type_MyAliasAliasEnum, type_name_MyAliasAliasEnum.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyAliasAliasEnum already registered in TypeObjectRegistry for a different type."); - } - return_code_AliasAliasStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyAliasAliasEnum", type_ids_AliasAliasStruct); - if (return_code_AliasAliasStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyAliasAliasEnum: Given Alias TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_alias_alias = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_alias_alias; - MemberId member_id_my_alias_alias = 0x00000000; - if (EK_COMPLETE == type_ids_AliasAliasStruct.type_identifier1()._d() || TK_NONE == type_ids_AliasAliasStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_AliasAliasStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_AliasAliasStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_AliasAliasStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_AliasAliasStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_AliasAliasStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_AliasAliasStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_AliasAliasStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_AliasAliasStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_AliasAliasStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_AliasAliasStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_AliasAliasStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_AliasAliasStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_AliasAliasStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_AliasAliasStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_alias_alias = TypeObjectUtils::build_common_struct_member(member_id_my_alias_alias, member_flags_my_alias_alias, type_ids_AliasAliasStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_AliasAliasStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_AliasAliasStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_AliasAliasStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_AliasAliasStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_AliasAliasStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_AliasAliasStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_AliasAliasStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_AliasAliasStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_AliasAliasStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_AliasAliasStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_AliasAliasStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_AliasAliasStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_AliasAliasStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_AliasAliasStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_AliasAliasStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_alias_alias = TypeObjectUtils::build_common_struct_member(member_id_my_alias_alias, member_flags_my_alias_alias, type_ids_AliasAliasStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_alias_alias member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_alias_alias = "my_alias_alias"; - eprosima::fastcdr::optional member_ann_builtin_my_alias_alias; - ann_custom_AliasAliasStruct.reset(); - CompleteMemberDetail detail_my_alias_alias = TypeObjectUtils::build_complete_member_detail(name_my_alias_alias, member_ann_builtin_my_alias_alias, ann_custom_AliasAliasStruct); - CompleteStructMember member_my_alias_alias = TypeObjectUtils::build_complete_struct_member(common_my_alias_alias, detail_my_alias_alias); - TypeObjectUtils::add_complete_struct_member(member_seq_AliasAliasStruct, member_my_alias_alias); - } - CompleteStructType struct_type_AliasAliasStruct = TypeObjectUtils::build_complete_struct_type(struct_flags_AliasAliasStruct, header_AliasAliasStruct, member_seq_AliasAliasStruct); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_AliasAliasStruct, type_name_AliasAliasStruct.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "AliasAliasStruct already registered in TypeObjectRegistry for a different type."); - } - return_code_AliasAliasStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "AliasAliasStruct", type_ids_AliasAliasStruct); - if (return_code_AliasAliasStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "AliasAliasStruct: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } -} -void register_BoolStruct_type_identifier() -{ - { - StructTypeFlag struct_flags_BoolStruct = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_BoolStruct; - TypeIdentifierPair type_ids_BoolStruct; - QualifiedTypeName type_name_BoolStruct = "BoolStruct"; - eprosima::fastcdr::optional type_ann_builtin_BoolStruct; - eprosima::fastcdr::optional ann_custom_BoolStruct; - CompleteTypeDetail detail_BoolStruct = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_BoolStruct, ann_custom_BoolStruct, type_name_BoolStruct.to_string()); - CompleteStructHeader header_BoolStruct; - header_BoolStruct = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_BoolStruct); - CompleteStructMemberSeq member_seq_BoolStruct; - { - return_code_BoolStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_bool", type_ids_BoolStruct); - - if (return_code_BoolStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_bool Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_bool = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_bool; - MemberId member_id_my_bool = 0x00000000; - if (EK_COMPLETE == type_ids_BoolStruct.type_identifier1()._d() || TK_NONE == type_ids_BoolStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BoolStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BoolStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BoolStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BoolStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BoolStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BoolStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BoolStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BoolStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BoolStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BoolStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BoolStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BoolStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BoolStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BoolStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_bool = TypeObjectUtils::build_common_struct_member(member_id_my_bool, member_flags_my_bool, type_ids_BoolStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BoolStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BoolStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BoolStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BoolStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BoolStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BoolStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BoolStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BoolStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BoolStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BoolStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BoolStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BoolStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BoolStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BoolStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BoolStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_bool = TypeObjectUtils::build_common_struct_member(member_id_my_bool, member_flags_my_bool, type_ids_BoolStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_bool member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_bool = "my_bool"; - eprosima::fastcdr::optional member_ann_builtin_my_bool; - ann_custom_BoolStruct.reset(); - CompleteMemberDetail detail_my_bool = TypeObjectUtils::build_complete_member_detail(name_my_bool, member_ann_builtin_my_bool, ann_custom_BoolStruct); - CompleteStructMember member_my_bool = TypeObjectUtils::build_complete_struct_member(common_my_bool, detail_my_bool); - TypeObjectUtils::add_complete_struct_member(member_seq_BoolStruct, member_my_bool); - } - CompleteStructType struct_type_BoolStruct = TypeObjectUtils::build_complete_struct_type(struct_flags_BoolStruct, header_BoolStruct, member_seq_BoolStruct); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_BoolStruct, type_name_BoolStruct.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "BoolStruct already registered in TypeObjectRegistry for a different type."); - } - return_code_BoolStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "BoolStruct", type_ids_BoolStruct); - if (return_code_BoolStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "BoolStruct: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } -} -void register_OctetStruct_type_identifier() -{ - { - StructTypeFlag struct_flags_OctetStruct = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_OctetStruct; - TypeIdentifierPair type_ids_OctetStruct; - QualifiedTypeName type_name_OctetStruct = "OctetStruct"; - eprosima::fastcdr::optional type_ann_builtin_OctetStruct; - eprosima::fastcdr::optional ann_custom_OctetStruct; - CompleteTypeDetail detail_OctetStruct = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_OctetStruct, ann_custom_OctetStruct, type_name_OctetStruct.to_string()); - CompleteStructHeader header_OctetStruct; - header_OctetStruct = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_OctetStruct); - CompleteStructMemberSeq member_seq_OctetStruct; - { - return_code_OctetStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_byte", type_ids_OctetStruct); - - if (return_code_OctetStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_octet Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_octet = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_octet; - MemberId member_id_my_octet = 0x00000000; - if (EK_COMPLETE == type_ids_OctetStruct.type_identifier1()._d() || TK_NONE == type_ids_OctetStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_OctetStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_OctetStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_OctetStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_OctetStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_OctetStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_OctetStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_OctetStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_OctetStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_OctetStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_OctetStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_OctetStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_OctetStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_OctetStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_OctetStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_octet = TypeObjectUtils::build_common_struct_member(member_id_my_octet, member_flags_my_octet, type_ids_OctetStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_OctetStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_OctetStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_OctetStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_OctetStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_OctetStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_OctetStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_OctetStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_OctetStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_OctetStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_OctetStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_OctetStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_OctetStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_OctetStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_OctetStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_OctetStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_octet = TypeObjectUtils::build_common_struct_member(member_id_my_octet, member_flags_my_octet, type_ids_OctetStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_octet member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_octet = "my_octet"; - eprosima::fastcdr::optional member_ann_builtin_my_octet; - ann_custom_OctetStruct.reset(); - CompleteMemberDetail detail_my_octet = TypeObjectUtils::build_complete_member_detail(name_my_octet, member_ann_builtin_my_octet, ann_custom_OctetStruct); - CompleteStructMember member_my_octet = TypeObjectUtils::build_complete_struct_member(common_my_octet, detail_my_octet); - TypeObjectUtils::add_complete_struct_member(member_seq_OctetStruct, member_my_octet); - } - CompleteStructType struct_type_OctetStruct = TypeObjectUtils::build_complete_struct_type(struct_flags_OctetStruct, header_OctetStruct, member_seq_OctetStruct); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_OctetStruct, type_name_OctetStruct.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "OctetStruct already registered in TypeObjectRegistry for a different type."); - } - return_code_OctetStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "OctetStruct", type_ids_OctetStruct); - if (return_code_OctetStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "OctetStruct: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } -} -void register_ShortStruct_type_identifier() -{ - { - StructTypeFlag struct_flags_ShortStruct = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_ShortStruct; - TypeIdentifierPair type_ids_ShortStruct; - QualifiedTypeName type_name_ShortStruct = "ShortStruct"; - eprosima::fastcdr::optional type_ann_builtin_ShortStruct; - eprosima::fastcdr::optional ann_custom_ShortStruct; - CompleteTypeDetail detail_ShortStruct = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_ShortStruct, ann_custom_ShortStruct, type_name_ShortStruct.to_string()); - CompleteStructHeader header_ShortStruct; - header_ShortStruct = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_ShortStruct); - CompleteStructMemberSeq member_seq_ShortStruct; - { - return_code_ShortStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int16_t", type_ids_ShortStruct); - - if (return_code_ShortStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_int16 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_int16 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_int16; - MemberId member_id_my_int16 = 0x00000000; - if (EK_COMPLETE == type_ids_ShortStruct.type_identifier1()._d() || TK_NONE == type_ids_ShortStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ShortStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ShortStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ShortStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ShortStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ShortStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ShortStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ShortStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ShortStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ShortStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ShortStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ShortStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ShortStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ShortStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ShortStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_int16 = TypeObjectUtils::build_common_struct_member(member_id_my_int16, member_flags_my_int16, type_ids_ShortStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ShortStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ShortStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ShortStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ShortStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ShortStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ShortStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ShortStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ShortStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ShortStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ShortStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ShortStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ShortStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ShortStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ShortStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ShortStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_int16 = TypeObjectUtils::build_common_struct_member(member_id_my_int16, member_flags_my_int16, type_ids_ShortStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_int16 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_int16 = "my_int16"; - eprosima::fastcdr::optional member_ann_builtin_my_int16; - ann_custom_ShortStruct.reset(); - CompleteMemberDetail detail_my_int16 = TypeObjectUtils::build_complete_member_detail(name_my_int16, member_ann_builtin_my_int16, ann_custom_ShortStruct); - CompleteStructMember member_my_int16 = TypeObjectUtils::build_complete_struct_member(common_my_int16, detail_my_int16); - TypeObjectUtils::add_complete_struct_member(member_seq_ShortStruct, member_my_int16); - } - CompleteStructType struct_type_ShortStruct = TypeObjectUtils::build_complete_struct_type(struct_flags_ShortStruct, header_ShortStruct, member_seq_ShortStruct); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_ShortStruct, type_name_ShortStruct.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "ShortStruct already registered in TypeObjectRegistry for a different type."); - } - return_code_ShortStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "ShortStruct", type_ids_ShortStruct); - if (return_code_ShortStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "ShortStruct: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } -} -void register_LongStruct_type_identifier() -{ - { - StructTypeFlag struct_flags_LongStruct = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_LongStruct; - TypeIdentifierPair type_ids_LongStruct; - QualifiedTypeName type_name_LongStruct = "LongStruct"; - eprosima::fastcdr::optional type_ann_builtin_LongStruct; - eprosima::fastcdr::optional ann_custom_LongStruct; - CompleteTypeDetail detail_LongStruct = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_LongStruct, ann_custom_LongStruct, type_name_LongStruct.to_string()); - CompleteStructHeader header_LongStruct; - header_LongStruct = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_LongStruct); - CompleteStructMemberSeq member_seq_LongStruct; - { - return_code_LongStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_LongStruct); - - if (return_code_LongStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_int32 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_int32 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_int32; - MemberId member_id_my_int32 = 0x00000000; - if (EK_COMPLETE == type_ids_LongStruct.type_identifier1()._d() || TK_NONE == type_ids_LongStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_LongStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_LongStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_LongStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_LongStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_LongStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_LongStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_LongStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_LongStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_LongStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_LongStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_LongStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_LongStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_LongStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_LongStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_int32 = TypeObjectUtils::build_common_struct_member(member_id_my_int32, member_flags_my_int32, type_ids_LongStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_LongStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_LongStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_LongStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_LongStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_LongStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_LongStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_LongStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_LongStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_LongStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_LongStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_LongStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_LongStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_LongStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_LongStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_LongStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_int32 = TypeObjectUtils::build_common_struct_member(member_id_my_int32, member_flags_my_int32, type_ids_LongStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_int32 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_int32 = "my_int32"; - eprosima::fastcdr::optional member_ann_builtin_my_int32; - ann_custom_LongStruct.reset(); - CompleteMemberDetail detail_my_int32 = TypeObjectUtils::build_complete_member_detail(name_my_int32, member_ann_builtin_my_int32, ann_custom_LongStruct); - CompleteStructMember member_my_int32 = TypeObjectUtils::build_complete_struct_member(common_my_int32, detail_my_int32); - TypeObjectUtils::add_complete_struct_member(member_seq_LongStruct, member_my_int32); - } - CompleteStructType struct_type_LongStruct = TypeObjectUtils::build_complete_struct_type(struct_flags_LongStruct, header_LongStruct, member_seq_LongStruct); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_LongStruct, type_name_LongStruct.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "LongStruct already registered in TypeObjectRegistry for a different type."); - } - return_code_LongStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "LongStruct", type_ids_LongStruct); - if (return_code_LongStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "LongStruct: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } -} -void register_LongLongStruct_type_identifier() -{ - { - StructTypeFlag struct_flags_LongLongStruct = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_LongLongStruct; - TypeIdentifierPair type_ids_LongLongStruct; - QualifiedTypeName type_name_LongLongStruct = "LongLongStruct"; - eprosima::fastcdr::optional type_ann_builtin_LongLongStruct; - eprosima::fastcdr::optional ann_custom_LongLongStruct; - CompleteTypeDetail detail_LongLongStruct = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_LongLongStruct, ann_custom_LongLongStruct, type_name_LongLongStruct.to_string()); - CompleteStructHeader header_LongLongStruct; - header_LongLongStruct = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_LongLongStruct); - CompleteStructMemberSeq member_seq_LongLongStruct; - { - return_code_LongLongStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int64_t", type_ids_LongLongStruct); - - if (return_code_LongLongStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_int64 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_int64 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_int64; - MemberId member_id_my_int64 = 0x00000000; - if (EK_COMPLETE == type_ids_LongLongStruct.type_identifier1()._d() || TK_NONE == type_ids_LongLongStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_LongLongStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_LongLongStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_LongLongStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_LongLongStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_LongLongStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_LongLongStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_LongLongStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_LongLongStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_LongLongStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_LongLongStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_LongLongStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_LongLongStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_LongLongStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_LongLongStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_int64 = TypeObjectUtils::build_common_struct_member(member_id_my_int64, member_flags_my_int64, type_ids_LongLongStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_LongLongStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_LongLongStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_LongLongStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_LongLongStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_LongLongStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_LongLongStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_LongLongStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_LongLongStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_LongLongStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_LongLongStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_LongLongStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_LongLongStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_LongLongStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_LongLongStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_LongLongStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_int64 = TypeObjectUtils::build_common_struct_member(member_id_my_int64, member_flags_my_int64, type_ids_LongLongStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_int64 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_int64 = "my_int64"; - eprosima::fastcdr::optional member_ann_builtin_my_int64; - ann_custom_LongLongStruct.reset(); - CompleteMemberDetail detail_my_int64 = TypeObjectUtils::build_complete_member_detail(name_my_int64, member_ann_builtin_my_int64, ann_custom_LongLongStruct); - CompleteStructMember member_my_int64 = TypeObjectUtils::build_complete_struct_member(common_my_int64, detail_my_int64); - TypeObjectUtils::add_complete_struct_member(member_seq_LongLongStruct, member_my_int64); - } - CompleteStructType struct_type_LongLongStruct = TypeObjectUtils::build_complete_struct_type(struct_flags_LongLongStruct, header_LongLongStruct, member_seq_LongLongStruct); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_LongLongStruct, type_name_LongLongStruct.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "LongLongStruct already registered in TypeObjectRegistry for a different type."); - } - return_code_LongLongStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "LongLongStruct", type_ids_LongLongStruct); - if (return_code_LongLongStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "LongLongStruct: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } -} -void register_UShortStruct_type_identifier() -{ - { - StructTypeFlag struct_flags_UShortStruct = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_UShortStruct; - TypeIdentifierPair type_ids_UShortStruct; - QualifiedTypeName type_name_UShortStruct = "UShortStruct"; - eprosima::fastcdr::optional type_ann_builtin_UShortStruct; - eprosima::fastcdr::optional ann_custom_UShortStruct; - CompleteTypeDetail detail_UShortStruct = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_UShortStruct, ann_custom_UShortStruct, type_name_UShortStruct.to_string()); - CompleteStructHeader header_UShortStruct; - header_UShortStruct = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_UShortStruct); - CompleteStructMemberSeq member_seq_UShortStruct; - { - return_code_UShortStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_uint16_t", type_ids_UShortStruct); - - if (return_code_UShortStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_uint16 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_uint16 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_uint16; - MemberId member_id_my_uint16 = 0x00000000; - if (EK_COMPLETE == type_ids_UShortStruct.type_identifier1()._d() || TK_NONE == type_ids_UShortStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_UShortStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_UShortStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_UShortStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_UShortStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_UShortStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_UShortStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_UShortStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_UShortStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_UShortStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_UShortStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_UShortStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_UShortStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_UShortStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_UShortStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_uint16 = TypeObjectUtils::build_common_struct_member(member_id_my_uint16, member_flags_my_uint16, type_ids_UShortStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_UShortStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_UShortStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_UShortStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_UShortStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_UShortStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_UShortStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_UShortStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_UShortStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_UShortStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_UShortStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_UShortStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_UShortStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_UShortStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_UShortStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_UShortStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_uint16 = TypeObjectUtils::build_common_struct_member(member_id_my_uint16, member_flags_my_uint16, type_ids_UShortStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_uint16 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_uint16 = "my_uint16"; - eprosima::fastcdr::optional member_ann_builtin_my_uint16; - ann_custom_UShortStruct.reset(); - CompleteMemberDetail detail_my_uint16 = TypeObjectUtils::build_complete_member_detail(name_my_uint16, member_ann_builtin_my_uint16, ann_custom_UShortStruct); - CompleteStructMember member_my_uint16 = TypeObjectUtils::build_complete_struct_member(common_my_uint16, detail_my_uint16); - TypeObjectUtils::add_complete_struct_member(member_seq_UShortStruct, member_my_uint16); - } - CompleteStructType struct_type_UShortStruct = TypeObjectUtils::build_complete_struct_type(struct_flags_UShortStruct, header_UShortStruct, member_seq_UShortStruct); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_UShortStruct, type_name_UShortStruct.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "UShortStruct already registered in TypeObjectRegistry for a different type."); - } - return_code_UShortStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "UShortStruct", type_ids_UShortStruct); - if (return_code_UShortStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "UShortStruct: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } -} -void register_ULongStruct_type_identifier() -{ - { - StructTypeFlag struct_flags_ULongStruct = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_ULongStruct; - TypeIdentifierPair type_ids_ULongStruct; - QualifiedTypeName type_name_ULongStruct = "ULongStruct"; - eprosima::fastcdr::optional type_ann_builtin_ULongStruct; - eprosima::fastcdr::optional ann_custom_ULongStruct; - CompleteTypeDetail detail_ULongStruct = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_ULongStruct, ann_custom_ULongStruct, type_name_ULongStruct.to_string()); - CompleteStructHeader header_ULongStruct; - header_ULongStruct = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_ULongStruct); - CompleteStructMemberSeq member_seq_ULongStruct; - { - return_code_ULongStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_uint32_t", type_ids_ULongStruct); - - if (return_code_ULongStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_uint32 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_uint32 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_uint32; - MemberId member_id_my_uint32 = 0x00000000; - if (EK_COMPLETE == type_ids_ULongStruct.type_identifier1()._d() || TK_NONE == type_ids_ULongStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ULongStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ULongStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ULongStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ULongStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ULongStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ULongStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ULongStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ULongStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ULongStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ULongStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ULongStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ULongStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ULongStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ULongStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_uint32 = TypeObjectUtils::build_common_struct_member(member_id_my_uint32, member_flags_my_uint32, type_ids_ULongStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ULongStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ULongStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ULongStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ULongStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ULongStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ULongStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ULongStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ULongStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ULongStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ULongStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ULongStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ULongStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ULongStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ULongStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ULongStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_uint32 = TypeObjectUtils::build_common_struct_member(member_id_my_uint32, member_flags_my_uint32, type_ids_ULongStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_uint32 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_uint32 = "my_uint32"; - eprosima::fastcdr::optional member_ann_builtin_my_uint32; - ann_custom_ULongStruct.reset(); - CompleteMemberDetail detail_my_uint32 = TypeObjectUtils::build_complete_member_detail(name_my_uint32, member_ann_builtin_my_uint32, ann_custom_ULongStruct); - CompleteStructMember member_my_uint32 = TypeObjectUtils::build_complete_struct_member(common_my_uint32, detail_my_uint32); - TypeObjectUtils::add_complete_struct_member(member_seq_ULongStruct, member_my_uint32); - } - CompleteStructType struct_type_ULongStruct = TypeObjectUtils::build_complete_struct_type(struct_flags_ULongStruct, header_ULongStruct, member_seq_ULongStruct); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_ULongStruct, type_name_ULongStruct.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "ULongStruct already registered in TypeObjectRegistry for a different type."); - } - return_code_ULongStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "ULongStruct", type_ids_ULongStruct); - if (return_code_ULongStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "ULongStruct: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } -} -void register_ULongLongStruct_type_identifier() -{ - { - StructTypeFlag struct_flags_ULongLongStruct = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_ULongLongStruct; - TypeIdentifierPair type_ids_ULongLongStruct; - QualifiedTypeName type_name_ULongLongStruct = "ULongLongStruct"; - eprosima::fastcdr::optional type_ann_builtin_ULongLongStruct; - eprosima::fastcdr::optional ann_custom_ULongLongStruct; - CompleteTypeDetail detail_ULongLongStruct = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_ULongLongStruct, ann_custom_ULongLongStruct, type_name_ULongLongStruct.to_string()); - CompleteStructHeader header_ULongLongStruct; - header_ULongLongStruct = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_ULongLongStruct); - CompleteStructMemberSeq member_seq_ULongLongStruct; - { - return_code_ULongLongStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_uint64_t", type_ids_ULongLongStruct); - - if (return_code_ULongLongStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_uint64 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_uint64 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_uint64; - MemberId member_id_my_uint64 = 0x00000000; - if (EK_COMPLETE == type_ids_ULongLongStruct.type_identifier1()._d() || TK_NONE == type_ids_ULongLongStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ULongLongStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ULongLongStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ULongLongStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ULongLongStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ULongLongStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ULongLongStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ULongLongStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ULongLongStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ULongLongStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ULongLongStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ULongLongStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ULongLongStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ULongLongStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ULongLongStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_uint64 = TypeObjectUtils::build_common_struct_member(member_id_my_uint64, member_flags_my_uint64, type_ids_ULongLongStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ULongLongStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ULongLongStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ULongLongStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ULongLongStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ULongLongStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ULongLongStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ULongLongStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ULongLongStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ULongLongStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ULongLongStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ULongLongStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ULongLongStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ULongLongStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ULongLongStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ULongLongStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_uint64 = TypeObjectUtils::build_common_struct_member(member_id_my_uint64, member_flags_my_uint64, type_ids_ULongLongStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_uint64 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_uint64 = "my_uint64"; - eprosima::fastcdr::optional member_ann_builtin_my_uint64; - ann_custom_ULongLongStruct.reset(); - CompleteMemberDetail detail_my_uint64 = TypeObjectUtils::build_complete_member_detail(name_my_uint64, member_ann_builtin_my_uint64, ann_custom_ULongLongStruct); - CompleteStructMember member_my_uint64 = TypeObjectUtils::build_complete_struct_member(common_my_uint64, detail_my_uint64); - TypeObjectUtils::add_complete_struct_member(member_seq_ULongLongStruct, member_my_uint64); - } - CompleteStructType struct_type_ULongLongStruct = TypeObjectUtils::build_complete_struct_type(struct_flags_ULongLongStruct, header_ULongLongStruct, member_seq_ULongLongStruct); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_ULongLongStruct, type_name_ULongLongStruct.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "ULongLongStruct already registered in TypeObjectRegistry for a different type."); - } - return_code_ULongLongStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "ULongLongStruct", type_ids_ULongLongStruct); - if (return_code_ULongLongStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "ULongLongStruct: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } -} -void register_FloatStruct_type_identifier() -{ - { - StructTypeFlag struct_flags_FloatStruct = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_FloatStruct; - TypeIdentifierPair type_ids_FloatStruct; - QualifiedTypeName type_name_FloatStruct = "FloatStruct"; - eprosima::fastcdr::optional type_ann_builtin_FloatStruct; - eprosima::fastcdr::optional ann_custom_FloatStruct; - CompleteTypeDetail detail_FloatStruct = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_FloatStruct, ann_custom_FloatStruct, type_name_FloatStruct.to_string()); - CompleteStructHeader header_FloatStruct; - header_FloatStruct = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_FloatStruct); - CompleteStructMemberSeq member_seq_FloatStruct; - { - return_code_FloatStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_float", type_ids_FloatStruct); - - if (return_code_FloatStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_float32 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_float32 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_float32; - MemberId member_id_my_float32 = 0x00000000; - if (EK_COMPLETE == type_ids_FloatStruct.type_identifier1()._d() || TK_NONE == type_ids_FloatStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_FloatStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_FloatStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_FloatStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_FloatStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_FloatStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_FloatStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_FloatStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_FloatStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_FloatStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_FloatStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_FloatStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_FloatStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_FloatStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_FloatStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_float32 = TypeObjectUtils::build_common_struct_member(member_id_my_float32, member_flags_my_float32, type_ids_FloatStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_FloatStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_FloatStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_FloatStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_FloatStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_FloatStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_FloatStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_FloatStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_FloatStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_FloatStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_FloatStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_FloatStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_FloatStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_FloatStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_FloatStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_FloatStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_float32 = TypeObjectUtils::build_common_struct_member(member_id_my_float32, member_flags_my_float32, type_ids_FloatStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_float32 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_float32 = "my_float32"; - eprosima::fastcdr::optional member_ann_builtin_my_float32; - ann_custom_FloatStruct.reset(); - CompleteMemberDetail detail_my_float32 = TypeObjectUtils::build_complete_member_detail(name_my_float32, member_ann_builtin_my_float32, ann_custom_FloatStruct); - CompleteStructMember member_my_float32 = TypeObjectUtils::build_complete_struct_member(common_my_float32, detail_my_float32); - TypeObjectUtils::add_complete_struct_member(member_seq_FloatStruct, member_my_float32); - } - CompleteStructType struct_type_FloatStruct = TypeObjectUtils::build_complete_struct_type(struct_flags_FloatStruct, header_FloatStruct, member_seq_FloatStruct); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_FloatStruct, type_name_FloatStruct.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "FloatStruct already registered in TypeObjectRegistry for a different type."); - } - return_code_FloatStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "FloatStruct", type_ids_FloatStruct); - if (return_code_FloatStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "FloatStruct: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } -} -void register_DoubleStruct_type_identifier() -{ - { - StructTypeFlag struct_flags_DoubleStruct = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_DoubleStruct; - TypeIdentifierPair type_ids_DoubleStruct; - QualifiedTypeName type_name_DoubleStruct = "DoubleStruct"; - eprosima::fastcdr::optional type_ann_builtin_DoubleStruct; - eprosima::fastcdr::optional ann_custom_DoubleStruct; - CompleteTypeDetail detail_DoubleStruct = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_DoubleStruct, ann_custom_DoubleStruct, type_name_DoubleStruct.to_string()); - CompleteStructHeader header_DoubleStruct; - header_DoubleStruct = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_DoubleStruct); - CompleteStructMemberSeq member_seq_DoubleStruct; - { - return_code_DoubleStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_double", type_ids_DoubleStruct); - - if (return_code_DoubleStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_float64 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_float64 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_float64; - MemberId member_id_my_float64 = 0x00000000; - if (EK_COMPLETE == type_ids_DoubleStruct.type_identifier1()._d() || TK_NONE == type_ids_DoubleStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_DoubleStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_DoubleStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_DoubleStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_DoubleStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_DoubleStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_DoubleStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_DoubleStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_DoubleStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_DoubleStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_DoubleStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_DoubleStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_DoubleStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_DoubleStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_DoubleStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_float64 = TypeObjectUtils::build_common_struct_member(member_id_my_float64, member_flags_my_float64, type_ids_DoubleStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_DoubleStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_DoubleStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_DoubleStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_DoubleStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_DoubleStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_DoubleStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_DoubleStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_DoubleStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_DoubleStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_DoubleStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_DoubleStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_DoubleStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_DoubleStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_DoubleStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_DoubleStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_float64 = TypeObjectUtils::build_common_struct_member(member_id_my_float64, member_flags_my_float64, type_ids_DoubleStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_float64 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_float64 = "my_float64"; - eprosima::fastcdr::optional member_ann_builtin_my_float64; - ann_custom_DoubleStruct.reset(); - CompleteMemberDetail detail_my_float64 = TypeObjectUtils::build_complete_member_detail(name_my_float64, member_ann_builtin_my_float64, ann_custom_DoubleStruct); - CompleteStructMember member_my_float64 = TypeObjectUtils::build_complete_struct_member(common_my_float64, detail_my_float64); - TypeObjectUtils::add_complete_struct_member(member_seq_DoubleStruct, member_my_float64); - } - CompleteStructType struct_type_DoubleStruct = TypeObjectUtils::build_complete_struct_type(struct_flags_DoubleStruct, header_DoubleStruct, member_seq_DoubleStruct); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_DoubleStruct, type_name_DoubleStruct.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "DoubleStruct already registered in TypeObjectRegistry for a different type."); - } - return_code_DoubleStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "DoubleStruct", type_ids_DoubleStruct); - if (return_code_DoubleStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "DoubleStruct: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } -} -void register_LongDoubleStruct_type_identifier() -{ - { - StructTypeFlag struct_flags_LongDoubleStruct = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_LongDoubleStruct; - TypeIdentifierPair type_ids_LongDoubleStruct; - QualifiedTypeName type_name_LongDoubleStruct = "LongDoubleStruct"; - eprosima::fastcdr::optional type_ann_builtin_LongDoubleStruct; - eprosima::fastcdr::optional ann_custom_LongDoubleStruct; - CompleteTypeDetail detail_LongDoubleStruct = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_LongDoubleStruct, ann_custom_LongDoubleStruct, type_name_LongDoubleStruct.to_string()); - CompleteStructHeader header_LongDoubleStruct; - header_LongDoubleStruct = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_LongDoubleStruct); - CompleteStructMemberSeq member_seq_LongDoubleStruct; - { - return_code_LongDoubleStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_longdouble", type_ids_LongDoubleStruct); - - if (return_code_LongDoubleStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_float128 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_float128 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_float128; - MemberId member_id_my_float128 = 0x00000000; - if (EK_COMPLETE == type_ids_LongDoubleStruct.type_identifier1()._d() || TK_NONE == type_ids_LongDoubleStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_LongDoubleStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_LongDoubleStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_LongDoubleStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_LongDoubleStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_LongDoubleStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_LongDoubleStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_LongDoubleStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_LongDoubleStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_LongDoubleStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_LongDoubleStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_LongDoubleStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_LongDoubleStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_LongDoubleStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_LongDoubleStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_float128 = TypeObjectUtils::build_common_struct_member(member_id_my_float128, member_flags_my_float128, type_ids_LongDoubleStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_LongDoubleStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_LongDoubleStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_LongDoubleStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_LongDoubleStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_LongDoubleStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_LongDoubleStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_LongDoubleStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_LongDoubleStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_LongDoubleStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_LongDoubleStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_LongDoubleStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_LongDoubleStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_LongDoubleStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_LongDoubleStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_LongDoubleStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_float128 = TypeObjectUtils::build_common_struct_member(member_id_my_float128, member_flags_my_float128, type_ids_LongDoubleStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_float128 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_float128 = "my_float128"; - eprosima::fastcdr::optional member_ann_builtin_my_float128; - ann_custom_LongDoubleStruct.reset(); - CompleteMemberDetail detail_my_float128 = TypeObjectUtils::build_complete_member_detail(name_my_float128, member_ann_builtin_my_float128, ann_custom_LongDoubleStruct); - CompleteStructMember member_my_float128 = TypeObjectUtils::build_complete_struct_member(common_my_float128, detail_my_float128); - TypeObjectUtils::add_complete_struct_member(member_seq_LongDoubleStruct, member_my_float128); - } - CompleteStructType struct_type_LongDoubleStruct = TypeObjectUtils::build_complete_struct_type(struct_flags_LongDoubleStruct, header_LongDoubleStruct, member_seq_LongDoubleStruct); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_LongDoubleStruct, type_name_LongDoubleStruct.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "LongDoubleStruct already registered in TypeObjectRegistry for a different type."); - } - return_code_LongDoubleStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "LongDoubleStruct", type_ids_LongDoubleStruct); - if (return_code_LongDoubleStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "LongDoubleStruct: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } -} -void register_CharStruct_type_identifier() -{ - { - StructTypeFlag struct_flags_CharStruct = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_CharStruct; - TypeIdentifierPair type_ids_CharStruct; - QualifiedTypeName type_name_CharStruct = "CharStruct"; - eprosima::fastcdr::optional type_ann_builtin_CharStruct; - eprosima::fastcdr::optional ann_custom_CharStruct; - CompleteTypeDetail detail_CharStruct = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_CharStruct, ann_custom_CharStruct, type_name_CharStruct.to_string()); - CompleteStructHeader header_CharStruct; - header_CharStruct = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_CharStruct); - CompleteStructMemberSeq member_seq_CharStruct; - { - return_code_CharStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_char", type_ids_CharStruct); - - if (return_code_CharStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_char Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_char = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_char; - MemberId member_id_my_char = 0x00000000; - if (EK_COMPLETE == type_ids_CharStruct.type_identifier1()._d() || TK_NONE == type_ids_CharStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_CharStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_CharStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_CharStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_CharStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_CharStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_CharStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_CharStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_CharStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_CharStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_CharStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_CharStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_CharStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_CharStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_CharStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_char = TypeObjectUtils::build_common_struct_member(member_id_my_char, member_flags_my_char, type_ids_CharStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_CharStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_CharStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_CharStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_CharStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_CharStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_CharStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_CharStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_CharStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_CharStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_CharStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_CharStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_CharStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_CharStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_CharStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_CharStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_char = TypeObjectUtils::build_common_struct_member(member_id_my_char, member_flags_my_char, type_ids_CharStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_char member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_char = "my_char"; - eprosima::fastcdr::optional member_ann_builtin_my_char; - ann_custom_CharStruct.reset(); - CompleteMemberDetail detail_my_char = TypeObjectUtils::build_complete_member_detail(name_my_char, member_ann_builtin_my_char, ann_custom_CharStruct); - CompleteStructMember member_my_char = TypeObjectUtils::build_complete_struct_member(common_my_char, detail_my_char); - TypeObjectUtils::add_complete_struct_member(member_seq_CharStruct, member_my_char); - } - CompleteStructType struct_type_CharStruct = TypeObjectUtils::build_complete_struct_type(struct_flags_CharStruct, header_CharStruct, member_seq_CharStruct); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_CharStruct, type_name_CharStruct.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "CharStruct already registered in TypeObjectRegistry for a different type."); - } - return_code_CharStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "CharStruct", type_ids_CharStruct); - if (return_code_CharStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "CharStruct: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } -} -void register_WCharStruct_type_identifier() -{ - { - StructTypeFlag struct_flags_WCharStruct = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_WCharStruct; - TypeIdentifierPair type_ids_WCharStruct; - QualifiedTypeName type_name_WCharStruct = "WCharStruct"; - eprosima::fastcdr::optional type_ann_builtin_WCharStruct; - eprosima::fastcdr::optional ann_custom_WCharStruct; - CompleteTypeDetail detail_WCharStruct = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_WCharStruct, ann_custom_WCharStruct, type_name_WCharStruct.to_string()); - CompleteStructHeader header_WCharStruct; - header_WCharStruct = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_WCharStruct); - CompleteStructMemberSeq member_seq_WCharStruct; - { - return_code_WCharStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_wchar_t", type_ids_WCharStruct); - - if (return_code_WCharStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_wchar Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_wchar = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_wchar; - MemberId member_id_my_wchar = 0x00000000; - if (EK_COMPLETE == type_ids_WCharStruct.type_identifier1()._d() || TK_NONE == type_ids_WCharStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_WCharStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_WCharStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_WCharStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_WCharStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_WCharStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_WCharStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_WCharStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_WCharStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_WCharStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_WCharStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_WCharStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_WCharStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_WCharStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_WCharStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_wchar = TypeObjectUtils::build_common_struct_member(member_id_my_wchar, member_flags_my_wchar, type_ids_WCharStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_WCharStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_WCharStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_WCharStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_WCharStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_WCharStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_WCharStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_WCharStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_WCharStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_WCharStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_WCharStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_WCharStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_WCharStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_WCharStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_WCharStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_WCharStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_wchar = TypeObjectUtils::build_common_struct_member(member_id_my_wchar, member_flags_my_wchar, type_ids_WCharStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_wchar member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_wchar = "my_wchar"; - eprosima::fastcdr::optional member_ann_builtin_my_wchar; - ann_custom_WCharStruct.reset(); - CompleteMemberDetail detail_my_wchar = TypeObjectUtils::build_complete_member_detail(name_my_wchar, member_ann_builtin_my_wchar, ann_custom_WCharStruct); - CompleteStructMember member_my_wchar = TypeObjectUtils::build_complete_struct_member(common_my_wchar, detail_my_wchar); - TypeObjectUtils::add_complete_struct_member(member_seq_WCharStruct, member_my_wchar); - } - CompleteStructType struct_type_WCharStruct = TypeObjectUtils::build_complete_struct_type(struct_flags_WCharStruct, header_WCharStruct, member_seq_WCharStruct); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_WCharStruct, type_name_WCharStruct.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "WCharStruct already registered in TypeObjectRegistry for a different type."); - } - return_code_WCharStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "WCharStruct", type_ids_WCharStruct); - if (return_code_WCharStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "WCharStruct: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } -} -void register_StringStruct_type_identifier() -{ - { - StructTypeFlag struct_flags_StringStruct = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_StringStruct; - TypeIdentifierPair type_ids_StringStruct; - QualifiedTypeName type_name_StringStruct = "StringStruct"; - eprosima::fastcdr::optional type_ann_builtin_StringStruct; - eprosima::fastcdr::optional ann_custom_StringStruct; - CompleteTypeDetail detail_StringStruct = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_StringStruct, ann_custom_StringStruct, type_name_StringStruct.to_string()); - CompleteStructHeader header_StringStruct; - header_StringStruct = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_StringStruct); - CompleteStructMemberSeq member_seq_StringStruct; - { - return_code_StringStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_string_unbounded", type_ids_StringStruct); - - if (return_code_StringStruct != 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_StringStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_string_unbounded", type_ids_StringStruct); - if (return_code_StringStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_string_unbounded: Given String TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_string = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_string; - MemberId member_id_my_string = 0x00000000; - if (EK_COMPLETE == type_ids_StringStruct.type_identifier1()._d() || TK_NONE == type_ids_StringStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_StringStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_StringStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_StringStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_StringStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_StringStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_StringStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_StringStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_StringStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_StringStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_StringStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_StringStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_StringStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_StringStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_StringStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_string = TypeObjectUtils::build_common_struct_member(member_id_my_string, member_flags_my_string, type_ids_StringStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_StringStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_StringStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_StringStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_StringStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_StringStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_StringStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_StringStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_StringStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_StringStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_StringStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_StringStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_StringStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_StringStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_StringStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_StringStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_string = TypeObjectUtils::build_common_struct_member(member_id_my_string, member_flags_my_string, type_ids_StringStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_string member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_string = "my_string"; - eprosima::fastcdr::optional member_ann_builtin_my_string; - ann_custom_StringStruct.reset(); - CompleteMemberDetail detail_my_string = TypeObjectUtils::build_complete_member_detail(name_my_string, member_ann_builtin_my_string, ann_custom_StringStruct); - CompleteStructMember member_my_string = TypeObjectUtils::build_complete_struct_member(common_my_string, detail_my_string); - TypeObjectUtils::add_complete_struct_member(member_seq_StringStruct, member_my_string); - } - CompleteStructType struct_type_StringStruct = TypeObjectUtils::build_complete_struct_type(struct_flags_StringStruct, header_StringStruct, member_seq_StringStruct); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_StringStruct, type_name_StringStruct.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "StringStruct already registered in TypeObjectRegistry for a different type."); - } - return_code_StringStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "StringStruct", type_ids_StringStruct); - if (return_code_StringStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "StringStruct: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } -} -void register_WStringStruct_type_identifier() -{ - { - StructTypeFlag struct_flags_WStringStruct = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_WStringStruct; - TypeIdentifierPair type_ids_WStringStruct; - QualifiedTypeName type_name_WStringStruct = "WStringStruct"; - eprosima::fastcdr::optional type_ann_builtin_WStringStruct; - eprosima::fastcdr::optional ann_custom_WStringStruct; - CompleteTypeDetail detail_WStringStruct = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_WStringStruct, ann_custom_WStringStruct, type_name_WStringStruct.to_string()); - CompleteStructHeader header_WStringStruct; - header_WStringStruct = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_WStringStruct); - CompleteStructMemberSeq member_seq_WStringStruct; - { - return_code_WStringStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_wstring_unbounded", type_ids_WStringStruct); - - if (return_code_WStringStruct != eprosima::fastdds::dds::RETCODE_OK) - { - std::string type_id_kind_anonymous_wstring_unbounded("TI_STRING16_SMALL"); - if (type_id_kind_anonymous_wstring_unbounded == "TI_STRING16_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_wstring_unbounded", true)) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_wstring_unbounded already registered in TypeObjectRegistry for a different type."); - } - } - else if (type_id_kind_anonymous_wstring_unbounded == "TI_STRING16_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_wstring_unbounded", true)) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_wstring_unbounded already registered in TypeObjectRegistry for a different type."); - } - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_wstring_unbounded: Unknown WString kind."); - return; - } - return_code_WStringStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_wstring_unbounded", type_ids_WStringStruct); - if (return_code_WStringStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_wstring_unbounded: Given WString TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_wstring = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_wstring; - MemberId member_id_my_wstring = 0x00000000; - if (EK_COMPLETE == type_ids_WStringStruct.type_identifier1()._d() || TK_NONE == type_ids_WStringStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_WStringStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_WStringStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_WStringStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_WStringStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_WStringStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_WStringStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_WStringStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_WStringStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_WStringStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_WStringStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_WStringStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_WStringStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_WStringStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_WStringStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_wstring = TypeObjectUtils::build_common_struct_member(member_id_my_wstring, member_flags_my_wstring, type_ids_WStringStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_WStringStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_WStringStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_WStringStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_WStringStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_WStringStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_WStringStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_WStringStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_WStringStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_WStringStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_WStringStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_WStringStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_WStringStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_WStringStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_WStringStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_WStringStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_wstring = TypeObjectUtils::build_common_struct_member(member_id_my_wstring, member_flags_my_wstring, type_ids_WStringStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_wstring member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_wstring = "my_wstring"; - eprosima::fastcdr::optional member_ann_builtin_my_wstring; - ann_custom_WStringStruct.reset(); - CompleteMemberDetail detail_my_wstring = TypeObjectUtils::build_complete_member_detail(name_my_wstring, member_ann_builtin_my_wstring, ann_custom_WStringStruct); - CompleteStructMember member_my_wstring = TypeObjectUtils::build_complete_struct_member(common_my_wstring, detail_my_wstring); - TypeObjectUtils::add_complete_struct_member(member_seq_WStringStruct, member_my_wstring); - } - CompleteStructType struct_type_WStringStruct = TypeObjectUtils::build_complete_struct_type(struct_flags_WStringStruct, header_WStringStruct, member_seq_WStringStruct); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_WStringStruct, type_name_WStringStruct.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "WStringStruct already registered in TypeObjectRegistry for a different type."); - } - return_code_WStringStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "WStringStruct", type_ids_WStringStruct); - if (return_code_WStringStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "WStringStruct: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } -} -void register_LargeStringStruct_type_identifier() -{ - { - StructTypeFlag struct_flags_LargeStringStruct = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_LargeStringStruct; - TypeIdentifierPair type_ids_LargeStringStruct; - QualifiedTypeName type_name_LargeStringStruct = "LargeStringStruct"; - eprosima::fastcdr::optional type_ann_builtin_LargeStringStruct; - eprosima::fastcdr::optional ann_custom_LargeStringStruct; - CompleteTypeDetail detail_LargeStringStruct = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_LargeStringStruct, ann_custom_LargeStringStruct, type_name_LargeStringStruct.to_string()); - CompleteStructHeader header_LargeStringStruct; - header_LargeStringStruct = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_LargeStringStruct); - CompleteStructMemberSeq member_seq_LargeStringStruct; - { - return_code_LargeStringStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_string_41925", type_ids_LargeStringStruct); - - if (return_code_LargeStringStruct != eprosima::fastdds::dds::RETCODE_OK) - { - std::string type_id_kind_anonymous_string_41925("TI_STRING8_LARGE"); - if (type_id_kind_anonymous_string_41925 == "TI_STRING8_SMALL") - { - SBound bound = static_cast(41925); - 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_41925")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_string_41925 already registered in TypeObjectRegistry for a different type."); - } - } - else if (type_id_kind_anonymous_string_41925 == "TI_STRING8_LARGE") - { - LBound bound = 41925; - 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_41925")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_string_41925 already registered in TypeObjectRegistry for a different type."); - } - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_string_41925: Unknown String kind."); - return; - } - return_code_LargeStringStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_string_41925", type_ids_LargeStringStruct); - if (return_code_LargeStringStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_string_41925: Given String TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_large_string = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_large_string; - MemberId member_id_my_large_string = 0x00000000; - if (EK_COMPLETE == type_ids_LargeStringStruct.type_identifier1()._d() || TK_NONE == type_ids_LargeStringStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_LargeStringStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_LargeStringStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_LargeStringStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_LargeStringStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_LargeStringStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_LargeStringStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_LargeStringStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_LargeStringStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_LargeStringStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_LargeStringStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_LargeStringStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_LargeStringStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_LargeStringStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_LargeStringStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_large_string = TypeObjectUtils::build_common_struct_member(member_id_my_large_string, member_flags_my_large_string, type_ids_LargeStringStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_LargeStringStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_LargeStringStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_LargeStringStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_LargeStringStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_LargeStringStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_LargeStringStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_LargeStringStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_LargeStringStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_LargeStringStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_LargeStringStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_LargeStringStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_LargeStringStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_LargeStringStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_LargeStringStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_LargeStringStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_large_string = TypeObjectUtils::build_common_struct_member(member_id_my_large_string, member_flags_my_large_string, type_ids_LargeStringStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_large_string member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_large_string = "my_large_string"; - eprosima::fastcdr::optional member_ann_builtin_my_large_string; - ann_custom_LargeStringStruct.reset(); - CompleteMemberDetail detail_my_large_string = TypeObjectUtils::build_complete_member_detail(name_my_large_string, member_ann_builtin_my_large_string, ann_custom_LargeStringStruct); - CompleteStructMember member_my_large_string = TypeObjectUtils::build_complete_struct_member(common_my_large_string, detail_my_large_string); - TypeObjectUtils::add_complete_struct_member(member_seq_LargeStringStruct, member_my_large_string); - } - CompleteStructType struct_type_LargeStringStruct = TypeObjectUtils::build_complete_struct_type(struct_flags_LargeStringStruct, header_LargeStringStruct, member_seq_LargeStringStruct); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_LargeStringStruct, type_name_LargeStringStruct.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "LargeStringStruct already registered in TypeObjectRegistry for a different type."); - } - return_code_LargeStringStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "LargeStringStruct", type_ids_LargeStringStruct); - if (return_code_LargeStringStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "LargeStringStruct: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } -} -void register_LargeWStringStruct_type_identifier() -{ - { - StructTypeFlag struct_flags_LargeWStringStruct = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_LargeWStringStruct; - TypeIdentifierPair type_ids_LargeWStringStruct; - QualifiedTypeName type_name_LargeWStringStruct = "LargeWStringStruct"; - eprosima::fastcdr::optional type_ann_builtin_LargeWStringStruct; - eprosima::fastcdr::optional ann_custom_LargeWStringStruct; - CompleteTypeDetail detail_LargeWStringStruct = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_LargeWStringStruct, ann_custom_LargeWStringStruct, type_name_LargeWStringStruct.to_string()); - CompleteStructHeader header_LargeWStringStruct; - header_LargeWStringStruct = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_LargeWStringStruct); - CompleteStructMemberSeq member_seq_LargeWStringStruct; - { - return_code_LargeWStringStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_wstring_41925", type_ids_LargeWStringStruct); - - if (return_code_LargeWStringStruct != eprosima::fastdds::dds::RETCODE_OK) - { - std::string type_id_kind_anonymous_wstring_41925("TI_STRING16_LARGE"); - if (type_id_kind_anonymous_wstring_41925 == "TI_STRING16_SMALL") - { - SBound bound = static_cast(41925); - 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_wstring_41925", true)) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_wstring_41925 already registered in TypeObjectRegistry for a different type."); - } - } - else if (type_id_kind_anonymous_wstring_41925 == "TI_STRING16_LARGE") - { - LBound bound = 41925; - 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_wstring_41925", true)) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_wstring_41925 already registered in TypeObjectRegistry for a different type."); - } - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_wstring_41925: Unknown WString kind."); - return; - } - return_code_LargeWStringStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_wstring_41925", type_ids_LargeWStringStruct); - if (return_code_LargeWStringStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_wstring_41925: Given WString TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_large_wstring = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_large_wstring; - MemberId member_id_my_large_wstring = 0x00000000; - if (EK_COMPLETE == type_ids_LargeWStringStruct.type_identifier1()._d() || TK_NONE == type_ids_LargeWStringStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_LargeWStringStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_LargeWStringStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_LargeWStringStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_LargeWStringStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_LargeWStringStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_LargeWStringStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_LargeWStringStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_LargeWStringStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_LargeWStringStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_LargeWStringStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_LargeWStringStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_LargeWStringStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_LargeWStringStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_LargeWStringStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_large_wstring = TypeObjectUtils::build_common_struct_member(member_id_my_large_wstring, member_flags_my_large_wstring, type_ids_LargeWStringStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_LargeWStringStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_LargeWStringStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_LargeWStringStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_LargeWStringStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_LargeWStringStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_LargeWStringStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_LargeWStringStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_LargeWStringStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_LargeWStringStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_LargeWStringStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_LargeWStringStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_LargeWStringStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_LargeWStringStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_LargeWStringStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_LargeWStringStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_large_wstring = TypeObjectUtils::build_common_struct_member(member_id_my_large_wstring, member_flags_my_large_wstring, type_ids_LargeWStringStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_large_wstring member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_large_wstring = "my_large_wstring"; - eprosima::fastcdr::optional member_ann_builtin_my_large_wstring; - ann_custom_LargeWStringStruct.reset(); - CompleteMemberDetail detail_my_large_wstring = TypeObjectUtils::build_complete_member_detail(name_my_large_wstring, member_ann_builtin_my_large_wstring, ann_custom_LargeWStringStruct); - CompleteStructMember member_my_large_wstring = TypeObjectUtils::build_complete_struct_member(common_my_large_wstring, detail_my_large_wstring); - TypeObjectUtils::add_complete_struct_member(member_seq_LargeWStringStruct, member_my_large_wstring); - } - CompleteStructType struct_type_LargeWStringStruct = TypeObjectUtils::build_complete_struct_type(struct_flags_LargeWStringStruct, header_LargeWStringStruct, member_seq_LargeWStringStruct); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_LargeWStringStruct, type_name_LargeWStringStruct.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "LargeWStringStruct already registered in TypeObjectRegistry for a different type."); - } - return_code_LargeWStringStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "LargeWStringStruct", type_ids_LargeWStringStruct); - if (return_code_LargeWStringStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "LargeWStringStruct: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } -} -void register_ArraytStruct_type_identifier() -{ - { - StructTypeFlag struct_flags_ArraytStruct = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_ArraytStruct; - TypeIdentifierPair type_ids_ArraytStruct; - QualifiedTypeName type_name_ArraytStruct = "ArraytStruct"; - eprosima::fastcdr::optional type_ann_builtin_ArraytStruct; - eprosima::fastcdr::optional ann_custom_ArraytStruct; - CompleteTypeDetail detail_ArraytStruct = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_ArraytStruct, ann_custom_ArraytStruct, type_name_ArraytStruct.to_string()); - CompleteStructHeader header_ArraytStruct; - header_ArraytStruct = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_ArraytStruct); - CompleteStructMemberSeq member_seq_ArraytStruct; - { - return_code_ArraytStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_array_int32_t_2_2_2", type_ids_ArraytStruct); - - if (return_code_ArraytStruct != eprosima::fastdds::dds::RETCODE_OK) - { - return_code_ArraytStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_ArraytStruct); - - if (return_code_ArraytStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Array element TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - TypeIdentifier* element_identifier_anonymous_array_int32_t_2_2_2 {nullptr}; - if (EK_COMPLETE == type_ids_ArraytStruct.type_identifier1()._d() || TK_NONE == type_ids_ArraytStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ArraytStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ArraytStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ArraytStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ArraytStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ArraytStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ArraytStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ArraytStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ArraytStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ArraytStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ArraytStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ArraytStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ArraytStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ArraytStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ArraytStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_array_int32_t_2_2_2 = new TypeIdentifier(type_ids_ArraytStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ArraytStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ArraytStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ArraytStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ArraytStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ArraytStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ArraytStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ArraytStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ArraytStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ArraytStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ArraytStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ArraytStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ArraytStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ArraytStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ArraytStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ArraytStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_array_int32_t_2_2_2 = new TypeIdentifier(type_ids_ArraytStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Array element TypeIdentifier inconsistent."); - return; - } - EquivalenceKind equiv_kind_anonymous_array_int32_t_2_2_2 = EK_COMPLETE; - if (TK_NONE == type_ids_ArraytStruct.type_identifier2()._d()) - { - equiv_kind_anonymous_array_int32_t_2_2_2 = EK_BOTH; - } - CollectionElementFlag element_flags_anonymous_array_int32_t_2_2_2 = 0; - PlainCollectionHeader header_anonymous_array_int32_t_2_2_2 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_int32_t_2_2_2, element_flags_anonymous_array_int32_t_2_2_2); - std::string type_id_kind_anonymous_array_int32_t_2_2_2("TI_PLAIN_ARRAY_SMALL"); - if (type_id_kind_anonymous_array_int32_t_2_2_2 == "TI_PLAIN_ARRAY_SMALL") - { - SBoundSeq array_bound_seq; - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(2)); - - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(2)); - - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(2)); - - PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_int32_t_2_2_2, array_bound_seq, - eprosima::fastcdr::external(element_identifier_anonymous_array_int32_t_2_2_2)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_int32_t_2_2_2")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_int32_t_2_2_2 already registered in TypeObjectRegistry for a different type."); - } - } - else - { - LBoundSeq array_bound_seq; - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(2)); - - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(2)); - - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(2)); - - PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_int32_t_2_2_2, array_bound_seq, - eprosima::fastcdr::external(element_identifier_anonymous_array_int32_t_2_2_2)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_int32_t_2_2_2")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_int32_t_2_2_2 already registered in TypeObjectRegistry for a different type."); - } - } - return_code_ArraytStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_array_int32_t_2_2_2", type_ids_ArraytStruct); - if (return_code_ArraytStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_int32_t_2_2_2: Given Array TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_array = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_array; - MemberId member_id_my_array = 0x00000000; - if (EK_COMPLETE == type_ids_ArraytStruct.type_identifier1()._d() || TK_NONE == type_ids_ArraytStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ArraytStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ArraytStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ArraytStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ArraytStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ArraytStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ArraytStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ArraytStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ArraytStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ArraytStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ArraytStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ArraytStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ArraytStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ArraytStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ArraytStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_array = TypeObjectUtils::build_common_struct_member(member_id_my_array, member_flags_my_array, type_ids_ArraytStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ArraytStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ArraytStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ArraytStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ArraytStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ArraytStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ArraytStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ArraytStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ArraytStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ArraytStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ArraytStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ArraytStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ArraytStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ArraytStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ArraytStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ArraytStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_array = TypeObjectUtils::build_common_struct_member(member_id_my_array, member_flags_my_array, type_ids_ArraytStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_array member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_array = "my_array"; - eprosima::fastcdr::optional member_ann_builtin_my_array; - ann_custom_ArraytStruct.reset(); - CompleteMemberDetail detail_my_array = TypeObjectUtils::build_complete_member_detail(name_my_array, member_ann_builtin_my_array, ann_custom_ArraytStruct); - CompleteStructMember member_my_array = TypeObjectUtils::build_complete_struct_member(common_my_array, detail_my_array); - TypeObjectUtils::add_complete_struct_member(member_seq_ArraytStruct, member_my_array); - } - CompleteStructType struct_type_ArraytStruct = TypeObjectUtils::build_complete_struct_type(struct_flags_ArraytStruct, header_ArraytStruct, member_seq_ArraytStruct); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_ArraytStruct, type_name_ArraytStruct.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "ArraytStruct already registered in TypeObjectRegistry for a different type."); - } - return_code_ArraytStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "ArraytStruct", type_ids_ArraytStruct); - if (return_code_ArraytStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "ArraytStruct: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } -} -void register_ArrayArrayStruct_type_identifier() -{ - { - StructTypeFlag struct_flags_ArrayArrayStruct = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_ArrayArrayStruct; - TypeIdentifierPair type_ids_ArrayArrayStruct; - QualifiedTypeName type_name_ArrayArrayStruct = "ArrayArrayStruct"; - eprosima::fastcdr::optional type_ann_builtin_ArrayArrayStruct; - eprosima::fastcdr::optional ann_custom_ArrayArrayStruct; - CompleteTypeDetail detail_ArrayArrayStruct = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_ArrayArrayStruct, ann_custom_ArrayArrayStruct, type_name_ArrayArrayStruct.to_string()); - CompleteStructHeader header_ArrayArrayStruct; - header_ArrayArrayStruct = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_ArrayArrayStruct); - CompleteStructMemberSeq member_seq_ArrayArrayStruct; - { - return_code_ArrayArrayStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_array_anonymous_array_int32_t_2_2_2_2", type_ids_ArrayArrayStruct); - - if (return_code_ArrayArrayStruct != eprosima::fastdds::dds::RETCODE_OK) - { - return_code_ArrayArrayStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyArray", type_ids_ArrayArrayStruct); - - if (return_code_ArrayArrayStruct != eprosima::fastdds::dds::RETCODE_OK) - { - AliasTypeFlag alias_flags_MyArray = 0; - QualifiedTypeName type_name_MyArray = "MyArray"; - eprosima::fastcdr::optional type_ann_builtin_MyArray; - eprosima::fastcdr::optional ann_custom_MyArray; - CompleteTypeDetail detail_MyArray = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_MyArray, ann_custom_MyArray, type_name_MyArray.to_string()); - CompleteAliasHeader header_MyArray = TypeObjectUtils::build_complete_alias_header(detail_MyArray); - AliasMemberFlag related_flags_MyArray = 0; - return_code_ArrayArrayStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_array_int32_t_2_2", type_ids_ArrayArrayStruct); - - if (return_code_ArrayArrayStruct != eprosima::fastdds::dds::RETCODE_OK) - { - return_code_ArrayArrayStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_ArrayArrayStruct); - - if (return_code_ArrayArrayStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Array element TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - TypeIdentifier* element_identifier_anonymous_array_int32_t_2_2 {nullptr}; - if (EK_COMPLETE == type_ids_ArrayArrayStruct.type_identifier1()._d() || TK_NONE == type_ids_ArrayArrayStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ArrayArrayStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ArrayArrayStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ArrayArrayStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ArrayArrayStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ArrayArrayStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ArrayArrayStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ArrayArrayStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ArrayArrayStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ArrayArrayStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ArrayArrayStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ArrayArrayStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ArrayArrayStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ArrayArrayStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ArrayArrayStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_array_int32_t_2_2 = new TypeIdentifier(type_ids_ArrayArrayStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ArrayArrayStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ArrayArrayStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ArrayArrayStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ArrayArrayStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ArrayArrayStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ArrayArrayStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ArrayArrayStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ArrayArrayStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ArrayArrayStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ArrayArrayStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ArrayArrayStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ArrayArrayStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ArrayArrayStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ArrayArrayStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ArrayArrayStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_array_int32_t_2_2 = new TypeIdentifier(type_ids_ArrayArrayStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Array element TypeIdentifier inconsistent."); - return; - } - EquivalenceKind equiv_kind_anonymous_array_int32_t_2_2 = EK_COMPLETE; - if (TK_NONE == type_ids_ArrayArrayStruct.type_identifier2()._d()) - { - equiv_kind_anonymous_array_int32_t_2_2 = EK_BOTH; - } - CollectionElementFlag element_flags_anonymous_array_int32_t_2_2 = 0; - PlainCollectionHeader header_anonymous_array_int32_t_2_2 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_int32_t_2_2, element_flags_anonymous_array_int32_t_2_2); - std::string type_id_kind_anonymous_array_int32_t_2_2("TI_PLAIN_ARRAY_SMALL"); - if (type_id_kind_anonymous_array_int32_t_2_2 == "TI_PLAIN_ARRAY_SMALL") - { - SBoundSeq array_bound_seq; - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(2)); - - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(2)); - - PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_int32_t_2_2, array_bound_seq, - eprosima::fastcdr::external(element_identifier_anonymous_array_int32_t_2_2)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_int32_t_2_2")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_int32_t_2_2 already registered in TypeObjectRegistry for a different type."); - } - } - else - { - LBoundSeq array_bound_seq; - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(2)); - - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(2)); - - PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_int32_t_2_2, array_bound_seq, - eprosima::fastcdr::external(element_identifier_anonymous_array_int32_t_2_2)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_int32_t_2_2")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_int32_t_2_2 already registered in TypeObjectRegistry for a different type."); - } - } - return_code_ArrayArrayStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_array_int32_t_2_2", type_ids_ArrayArrayStruct); - if (return_code_ArrayArrayStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_int32_t_2_2: Given Array TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - CommonAliasBody common_MyArray; - if (EK_COMPLETE == type_ids_ArrayArrayStruct.type_identifier1()._d() || TK_NONE == type_ids_ArrayArrayStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ArrayArrayStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ArrayArrayStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ArrayArrayStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ArrayArrayStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ArrayArrayStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ArrayArrayStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ArrayArrayStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ArrayArrayStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ArrayArrayStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ArrayArrayStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ArrayArrayStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ArrayArrayStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ArrayArrayStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ArrayArrayStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_MyArray = TypeObjectUtils::build_common_alias_body(related_flags_MyArray, type_ids_ArrayArrayStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ArrayArrayStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ArrayArrayStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ArrayArrayStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ArrayArrayStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ArrayArrayStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ArrayArrayStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ArrayArrayStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ArrayArrayStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ArrayArrayStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ArrayArrayStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ArrayArrayStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ArrayArrayStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ArrayArrayStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ArrayArrayStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ArrayArrayStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_MyArray = TypeObjectUtils::build_common_alias_body(related_flags_MyArray, type_ids_ArrayArrayStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyArray related TypeIdentifier inconsistent."); - return; - } - eprosima::fastcdr::optional member_ann_builtin_MyArray; - ann_custom_MyArray.reset(); - CompleteAliasBody body_MyArray = TypeObjectUtils::build_complete_alias_body(common_MyArray, member_ann_builtin_MyArray, ann_custom_MyArray); - CompleteAliasType alias_type_MyArray = TypeObjectUtils::build_complete_alias_type(alias_flags_MyArray, header_MyArray, body_MyArray); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_alias_type_object(alias_type_MyArray, type_name_MyArray.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyArray already registered in TypeObjectRegistry for a different type."); - } - return_code_ArrayArrayStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyArray", type_ids_ArrayArrayStruct); - if (return_code_ArrayArrayStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyArray: Given Alias TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - TypeIdentifier* element_identifier_anonymous_array_anonymous_array_int32_t_2_2_2_2 {nullptr}; - if (EK_COMPLETE == type_ids_ArrayArrayStruct.type_identifier1()._d() || TK_NONE == type_ids_ArrayArrayStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ArrayArrayStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ArrayArrayStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ArrayArrayStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ArrayArrayStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ArrayArrayStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ArrayArrayStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ArrayArrayStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ArrayArrayStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ArrayArrayStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ArrayArrayStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ArrayArrayStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ArrayArrayStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ArrayArrayStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ArrayArrayStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_array_anonymous_array_int32_t_2_2_2_2 = new TypeIdentifier(type_ids_ArrayArrayStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ArrayArrayStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ArrayArrayStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ArrayArrayStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ArrayArrayStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ArrayArrayStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ArrayArrayStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ArrayArrayStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ArrayArrayStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ArrayArrayStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ArrayArrayStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ArrayArrayStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ArrayArrayStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ArrayArrayStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ArrayArrayStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ArrayArrayStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_array_anonymous_array_int32_t_2_2_2_2 = new TypeIdentifier(type_ids_ArrayArrayStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Array element TypeIdentifier inconsistent."); - return; - } - EquivalenceKind equiv_kind_anonymous_array_anonymous_array_int32_t_2_2_2_2 = EK_COMPLETE; - if (TK_NONE == type_ids_ArrayArrayStruct.type_identifier2()._d()) - { - equiv_kind_anonymous_array_anonymous_array_int32_t_2_2_2_2 = EK_BOTH; - } - CollectionElementFlag element_flags_anonymous_array_anonymous_array_int32_t_2_2_2_2 = 0; - PlainCollectionHeader header_anonymous_array_anonymous_array_int32_t_2_2_2_2 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_anonymous_array_int32_t_2_2_2_2, element_flags_anonymous_array_anonymous_array_int32_t_2_2_2_2); - std::string type_id_kind_anonymous_array_anonymous_array_int32_t_2_2_2_2("TI_PLAIN_ARRAY_SMALL"); - if (type_id_kind_anonymous_array_anonymous_array_int32_t_2_2_2_2 == "TI_PLAIN_ARRAY_SMALL") - { - SBoundSeq array_bound_seq; - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(2)); - - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(2)); - - PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_anonymous_array_int32_t_2_2_2_2, array_bound_seq, - eprosima::fastcdr::external(element_identifier_anonymous_array_anonymous_array_int32_t_2_2_2_2)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_anonymous_array_int32_t_2_2_2_2")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_anonymous_array_int32_t_2_2_2_2 already registered in TypeObjectRegistry for a different type."); - } - } - else - { - LBoundSeq array_bound_seq; - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(2)); - - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(2)); - - PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_anonymous_array_int32_t_2_2_2_2, array_bound_seq, - eprosima::fastcdr::external(element_identifier_anonymous_array_anonymous_array_int32_t_2_2_2_2)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_anonymous_array_int32_t_2_2_2_2")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_anonymous_array_int32_t_2_2_2_2 already registered in TypeObjectRegistry for a different type."); - } - } - return_code_ArrayArrayStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_array_anonymous_array_int32_t_2_2_2_2", type_ids_ArrayArrayStruct); - if (return_code_ArrayArrayStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_anonymous_array_int32_t_2_2_2_2: Given Array TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_array_array = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_array_array; - MemberId member_id_my_array_array = 0x00000000; - if (EK_COMPLETE == type_ids_ArrayArrayStruct.type_identifier1()._d() || TK_NONE == type_ids_ArrayArrayStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ArrayArrayStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ArrayArrayStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ArrayArrayStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ArrayArrayStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ArrayArrayStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ArrayArrayStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ArrayArrayStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ArrayArrayStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ArrayArrayStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ArrayArrayStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ArrayArrayStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ArrayArrayStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ArrayArrayStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ArrayArrayStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_array_array = TypeObjectUtils::build_common_struct_member(member_id_my_array_array, member_flags_my_array_array, type_ids_ArrayArrayStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ArrayArrayStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ArrayArrayStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ArrayArrayStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ArrayArrayStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ArrayArrayStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ArrayArrayStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ArrayArrayStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ArrayArrayStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ArrayArrayStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ArrayArrayStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ArrayArrayStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ArrayArrayStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ArrayArrayStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ArrayArrayStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ArrayArrayStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_array_array = TypeObjectUtils::build_common_struct_member(member_id_my_array_array, member_flags_my_array_array, type_ids_ArrayArrayStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_array_array member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_array_array = "my_array_array"; - eprosima::fastcdr::optional member_ann_builtin_my_array_array; - ann_custom_ArrayArrayStruct.reset(); - CompleteMemberDetail detail_my_array_array = TypeObjectUtils::build_complete_member_detail(name_my_array_array, member_ann_builtin_my_array_array, ann_custom_ArrayArrayStruct); - CompleteStructMember member_my_array_array = TypeObjectUtils::build_complete_struct_member(common_my_array_array, detail_my_array_array); - TypeObjectUtils::add_complete_struct_member(member_seq_ArrayArrayStruct, member_my_array_array); - } - CompleteStructType struct_type_ArrayArrayStruct = TypeObjectUtils::build_complete_struct_type(struct_flags_ArrayArrayStruct, header_ArrayArrayStruct, member_seq_ArrayArrayStruct); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_ArrayArrayStruct, type_name_ArrayArrayStruct.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "ArrayArrayStruct already registered in TypeObjectRegistry for a different type."); - } - return_code_ArrayArrayStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "ArrayArrayStruct", type_ids_ArrayArrayStruct); - if (return_code_ArrayArrayStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "ArrayArrayStruct: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } -} -void register_SequenceStruct_type_identifier() -{ - { - StructTypeFlag struct_flags_SequenceStruct = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_SequenceStruct; - TypeIdentifierPair type_ids_SequenceStruct; - QualifiedTypeName type_name_SequenceStruct = "SequenceStruct"; - eprosima::fastcdr::optional type_ann_builtin_SequenceStruct; - eprosima::fastcdr::optional ann_custom_SequenceStruct; - CompleteTypeDetail detail_SequenceStruct = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_SequenceStruct, ann_custom_SequenceStruct, type_name_SequenceStruct.to_string()); - CompleteStructHeader header_SequenceStruct; - header_SequenceStruct = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_SequenceStruct); - CompleteStructMemberSeq member_seq_SequenceStruct; - { - return_code_SequenceStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_sequence_int32_t_2", type_ids_SequenceStruct); - - if (return_code_SequenceStruct != eprosima::fastdds::dds::RETCODE_OK) - { - return_code_SequenceStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_SequenceStruct); - - if (return_code_SequenceStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Sequence element TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - TypeIdentifier* element_identifier_anonymous_sequence_int32_t_2 {nullptr}; - if (EK_COMPLETE == type_ids_SequenceStruct.type_identifier1()._d() || TK_NONE == type_ids_SequenceStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SequenceStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_SequenceStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SequenceStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_SequenceStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SequenceStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_SequenceStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SequenceStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_SequenceStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SequenceStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SequenceStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SequenceStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SequenceStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SequenceStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SequenceStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_sequence_int32_t_2 = new TypeIdentifier(type_ids_SequenceStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_SequenceStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SequenceStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_SequenceStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SequenceStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_SequenceStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SequenceStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_SequenceStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SequenceStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_SequenceStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SequenceStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SequenceStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SequenceStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SequenceStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SequenceStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SequenceStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_sequence_int32_t_2 = new TypeIdentifier(type_ids_SequenceStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Sequence element TypeIdentifier inconsistent."); - return; - } - EquivalenceKind equiv_kind_anonymous_sequence_int32_t_2 = EK_COMPLETE; - if (TK_NONE == type_ids_SequenceStruct.type_identifier2()._d()) - { - equiv_kind_anonymous_sequence_int32_t_2 = EK_BOTH; - } - CollectionElementFlag element_flags_anonymous_sequence_int32_t_2 = 0; - PlainCollectionHeader header_anonymous_sequence_int32_t_2 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_sequence_int32_t_2, element_flags_anonymous_sequence_int32_t_2); - std::string type_id_kind_anonymous_sequence_int32_t_2("TI_PLAIN_SEQUENCE_SMALL"); - if (type_id_kind_anonymous_sequence_int32_t_2 == "TI_PLAIN_SEQUENCE_SMALL") - { - SBound bound = static_cast(2); - PlainSequenceSElemDefn seq_sdefn = TypeObjectUtils::build_plain_sequence_s_elem_defn(header_anonymous_sequence_int32_t_2, bound, - eprosima::fastcdr::external(element_identifier_anonymous_sequence_int32_t_2)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_s_sequence_type_identifier(seq_sdefn, "anonymous_sequence_int32_t_2")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_sequence_int32_t_2 already registered in TypeObjectRegistry for a different type."); - } - } - else - { - LBound bound = 2; - PlainSequenceLElemDefn seq_ldefn = TypeObjectUtils::build_plain_sequence_l_elem_defn(header_anonymous_sequence_int32_t_2, bound, - eprosima::fastcdr::external(element_identifier_anonymous_sequence_int32_t_2)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_l_sequence_type_identifier(seq_ldefn, "anonymous_sequence_int32_t_2")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_sequence_int32_t_2 already registered in TypeObjectRegistry for a different type."); - } - } - return_code_SequenceStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_sequence_int32_t_2", type_ids_SequenceStruct); - if (return_code_SequenceStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_sequence_int32_t_2: Given Sequence TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_sequence = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_sequence; - MemberId member_id_my_sequence = 0x00000000; - if (EK_COMPLETE == type_ids_SequenceStruct.type_identifier1()._d() || TK_NONE == type_ids_SequenceStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SequenceStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_SequenceStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SequenceStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_SequenceStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SequenceStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_SequenceStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SequenceStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_SequenceStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SequenceStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SequenceStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SequenceStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SequenceStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SequenceStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SequenceStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_sequence = TypeObjectUtils::build_common_struct_member(member_id_my_sequence, member_flags_my_sequence, type_ids_SequenceStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_SequenceStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SequenceStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_SequenceStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SequenceStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_SequenceStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SequenceStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_SequenceStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SequenceStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_SequenceStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SequenceStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SequenceStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SequenceStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SequenceStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SequenceStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SequenceStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_sequence = TypeObjectUtils::build_common_struct_member(member_id_my_sequence, member_flags_my_sequence, type_ids_SequenceStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_sequence member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_sequence = "my_sequence"; - eprosima::fastcdr::optional member_ann_builtin_my_sequence; - ann_custom_SequenceStruct.reset(); - CompleteMemberDetail detail_my_sequence = TypeObjectUtils::build_complete_member_detail(name_my_sequence, member_ann_builtin_my_sequence, ann_custom_SequenceStruct); - CompleteStructMember member_my_sequence = TypeObjectUtils::build_complete_struct_member(common_my_sequence, detail_my_sequence); - TypeObjectUtils::add_complete_struct_member(member_seq_SequenceStruct, member_my_sequence); - } - CompleteStructType struct_type_SequenceStruct = TypeObjectUtils::build_complete_struct_type(struct_flags_SequenceStruct, header_SequenceStruct, member_seq_SequenceStruct); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_SequenceStruct, type_name_SequenceStruct.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "SequenceStruct already registered in TypeObjectRegistry for a different type."); - } - return_code_SequenceStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "SequenceStruct", type_ids_SequenceStruct); - if (return_code_SequenceStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "SequenceStruct: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } -} -void register_SequenceSequenceStruct_type_identifier() -{ - { - StructTypeFlag struct_flags_SequenceSequenceStruct = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_SequenceSequenceStruct; - TypeIdentifierPair type_ids_SequenceSequenceStruct; - QualifiedTypeName type_name_SequenceSequenceStruct = "SequenceSequenceStruct"; - eprosima::fastcdr::optional type_ann_builtin_SequenceSequenceStruct; - eprosima::fastcdr::optional ann_custom_SequenceSequenceStruct; - CompleteTypeDetail detail_SequenceSequenceStruct = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_SequenceSequenceStruct, ann_custom_SequenceSequenceStruct, type_name_SequenceSequenceStruct.to_string()); - CompleteStructHeader header_SequenceSequenceStruct; - header_SequenceSequenceStruct = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_SequenceSequenceStruct); - CompleteStructMemberSeq member_seq_SequenceSequenceStruct; - { - return_code_SequenceSequenceStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_sequence_anonymous_sequence_int32_t_2_3", type_ids_SequenceSequenceStruct); - - if (return_code_SequenceSequenceStruct != eprosima::fastdds::dds::RETCODE_OK) - { - return_code_SequenceSequenceStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_sequence_int32_t_2", type_ids_SequenceSequenceStruct); - - if (return_code_SequenceSequenceStruct != eprosima::fastdds::dds::RETCODE_OK) - { - return_code_SequenceSequenceStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_SequenceSequenceStruct); - - if (return_code_SequenceSequenceStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Sequence element TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - TypeIdentifier* element_identifier_anonymous_sequence_int32_t_2 {nullptr}; - if (EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier1()._d() || TK_NONE == type_ids_SequenceSequenceStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SequenceSequenceStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SequenceSequenceStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SequenceSequenceStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SequenceSequenceStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SequenceSequenceStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SequenceSequenceStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_sequence_int32_t_2 = new TypeIdentifier(type_ids_SequenceSequenceStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SequenceSequenceStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SequenceSequenceStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SequenceSequenceStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SequenceSequenceStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SequenceSequenceStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SequenceSequenceStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_sequence_int32_t_2 = new TypeIdentifier(type_ids_SequenceSequenceStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Sequence element TypeIdentifier inconsistent."); - return; - } - EquivalenceKind equiv_kind_anonymous_sequence_int32_t_2 = EK_COMPLETE; - if (TK_NONE == type_ids_SequenceSequenceStruct.type_identifier2()._d()) - { - equiv_kind_anonymous_sequence_int32_t_2 = EK_BOTH; - } - CollectionElementFlag element_flags_anonymous_sequence_int32_t_2 = 0; - PlainCollectionHeader header_anonymous_sequence_int32_t_2 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_sequence_int32_t_2, element_flags_anonymous_sequence_int32_t_2); - std::string type_id_kind_anonymous_sequence_int32_t_2("TI_PLAIN_SEQUENCE_SMALL"); - if (type_id_kind_anonymous_sequence_int32_t_2 == "TI_PLAIN_SEQUENCE_SMALL") - { - SBound bound = static_cast(2); - PlainSequenceSElemDefn seq_sdefn = TypeObjectUtils::build_plain_sequence_s_elem_defn(header_anonymous_sequence_int32_t_2, bound, - eprosima::fastcdr::external(element_identifier_anonymous_sequence_int32_t_2)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_s_sequence_type_identifier(seq_sdefn, "anonymous_sequence_int32_t_2")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_sequence_int32_t_2 already registered in TypeObjectRegistry for a different type."); - } - } - else - { - LBound bound = 2; - PlainSequenceLElemDefn seq_ldefn = TypeObjectUtils::build_plain_sequence_l_elem_defn(header_anonymous_sequence_int32_t_2, bound, - eprosima::fastcdr::external(element_identifier_anonymous_sequence_int32_t_2)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_l_sequence_type_identifier(seq_ldefn, "anonymous_sequence_int32_t_2")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_sequence_int32_t_2 already registered in TypeObjectRegistry for a different type."); - } - } - return_code_SequenceSequenceStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_sequence_int32_t_2", type_ids_SequenceSequenceStruct); - if (return_code_SequenceSequenceStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_sequence_int32_t_2: Given Sequence TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - TypeIdentifier* element_identifier_anonymous_sequence_anonymous_sequence_int32_t_2_3 {nullptr}; - if (EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier1()._d() || TK_NONE == type_ids_SequenceSequenceStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SequenceSequenceStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SequenceSequenceStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SequenceSequenceStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SequenceSequenceStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SequenceSequenceStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SequenceSequenceStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_sequence_anonymous_sequence_int32_t_2_3 = new TypeIdentifier(type_ids_SequenceSequenceStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SequenceSequenceStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SequenceSequenceStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SequenceSequenceStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SequenceSequenceStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SequenceSequenceStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SequenceSequenceStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_sequence_anonymous_sequence_int32_t_2_3 = new TypeIdentifier(type_ids_SequenceSequenceStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Sequence element TypeIdentifier inconsistent."); - return; - } - EquivalenceKind equiv_kind_anonymous_sequence_anonymous_sequence_int32_t_2_3 = EK_COMPLETE; - if (TK_NONE == type_ids_SequenceSequenceStruct.type_identifier2()._d()) - { - equiv_kind_anonymous_sequence_anonymous_sequence_int32_t_2_3 = EK_BOTH; - } - CollectionElementFlag element_flags_anonymous_sequence_anonymous_sequence_int32_t_2_3 = 0; - PlainCollectionHeader header_anonymous_sequence_anonymous_sequence_int32_t_2_3 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_sequence_anonymous_sequence_int32_t_2_3, element_flags_anonymous_sequence_anonymous_sequence_int32_t_2_3); - std::string type_id_kind_anonymous_sequence_anonymous_sequence_int32_t_2_3("TI_PLAIN_SEQUENCE_SMALL"); - if (type_id_kind_anonymous_sequence_anonymous_sequence_int32_t_2_3 == "TI_PLAIN_SEQUENCE_SMALL") - { - SBound bound = static_cast(3); - PlainSequenceSElemDefn seq_sdefn = TypeObjectUtils::build_plain_sequence_s_elem_defn(header_anonymous_sequence_anonymous_sequence_int32_t_2_3, bound, - eprosima::fastcdr::external(element_identifier_anonymous_sequence_anonymous_sequence_int32_t_2_3)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_s_sequence_type_identifier(seq_sdefn, "anonymous_sequence_anonymous_sequence_int32_t_2_3")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_sequence_anonymous_sequence_int32_t_2_3 already registered in TypeObjectRegistry for a different type."); - } - } - else - { - LBound bound = 3; - PlainSequenceLElemDefn seq_ldefn = TypeObjectUtils::build_plain_sequence_l_elem_defn(header_anonymous_sequence_anonymous_sequence_int32_t_2_3, bound, - eprosima::fastcdr::external(element_identifier_anonymous_sequence_anonymous_sequence_int32_t_2_3)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_l_sequence_type_identifier(seq_ldefn, "anonymous_sequence_anonymous_sequence_int32_t_2_3")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_sequence_anonymous_sequence_int32_t_2_3 already registered in TypeObjectRegistry for a different type."); - } - } - return_code_SequenceSequenceStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_sequence_anonymous_sequence_int32_t_2_3", type_ids_SequenceSequenceStruct); - if (return_code_SequenceSequenceStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_sequence_anonymous_sequence_int32_t_2_3: Given Sequence TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_sequence_sequence = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_sequence_sequence; - MemberId member_id_my_sequence_sequence = 0x00000000; - if (EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier1()._d() || TK_NONE == type_ids_SequenceSequenceStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SequenceSequenceStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SequenceSequenceStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SequenceSequenceStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SequenceSequenceStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SequenceSequenceStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SequenceSequenceStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_sequence_sequence = TypeObjectUtils::build_common_struct_member(member_id_my_sequence_sequence, member_flags_my_sequence_sequence, type_ids_SequenceSequenceStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SequenceSequenceStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SequenceSequenceStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SequenceSequenceStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SequenceSequenceStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SequenceSequenceStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SequenceSequenceStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_sequence_sequence = TypeObjectUtils::build_common_struct_member(member_id_my_sequence_sequence, member_flags_my_sequence_sequence, type_ids_SequenceSequenceStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_sequence_sequence member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_sequence_sequence = "my_sequence_sequence"; - eprosima::fastcdr::optional member_ann_builtin_my_sequence_sequence; - ann_custom_SequenceSequenceStruct.reset(); - CompleteMemberDetail detail_my_sequence_sequence = TypeObjectUtils::build_complete_member_detail(name_my_sequence_sequence, member_ann_builtin_my_sequence_sequence, ann_custom_SequenceSequenceStruct); - CompleteStructMember member_my_sequence_sequence = TypeObjectUtils::build_complete_struct_member(common_my_sequence_sequence, detail_my_sequence_sequence); - TypeObjectUtils::add_complete_struct_member(member_seq_SequenceSequenceStruct, member_my_sequence_sequence); - } - CompleteStructType struct_type_SequenceSequenceStruct = TypeObjectUtils::build_complete_struct_type(struct_flags_SequenceSequenceStruct, header_SequenceSequenceStruct, member_seq_SequenceSequenceStruct); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_SequenceSequenceStruct, type_name_SequenceSequenceStruct.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "SequenceSequenceStruct already registered in TypeObjectRegistry for a different type."); - } - return_code_SequenceSequenceStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "SequenceSequenceStruct", type_ids_SequenceSequenceStruct); - if (return_code_SequenceSequenceStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "SequenceSequenceStruct: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } -} -void register_MapStruct_type_identifier() -{ - { - StructTypeFlag struct_flags_MapStruct = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_MapStruct; - TypeIdentifierPair type_ids_MapStruct; - QualifiedTypeName type_name_MapStruct = "MapStruct"; - eprosima::fastcdr::optional type_ann_builtin_MapStruct; - eprosima::fastcdr::optional ann_custom_MapStruct; - CompleteTypeDetail detail_MapStruct = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_MapStruct, ann_custom_MapStruct, type_name_MapStruct.to_string()); - CompleteStructHeader header_MapStruct; - header_MapStruct = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_MapStruct); - CompleteStructMemberSeq member_seq_MapStruct; - { - return_code_MapStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_map_int32_t_int32_t_2", type_ids_MapStruct); - - if (return_code_MapStruct != eprosima::fastdds::dds::RETCODE_OK) - { - return_code_MapStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_MapStruct); - - if (return_code_MapStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Map element TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - TypeIdentifier* element_identifier_anonymous_map_int32_t_int32_t_2 {nullptr}; - if (EK_COMPLETE == type_ids_MapStruct.type_identifier1()._d() || TK_NONE == type_ids_MapStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_MapStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_MapStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_MapStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_MapStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_MapStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_MapStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_MapStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_MapStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_map_int32_t_int32_t_2 = new TypeIdentifier(type_ids_MapStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_MapStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_MapStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_MapStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_MapStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_MapStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_MapStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_MapStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_MapStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_MapStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_map_int32_t_int32_t_2 = new TypeIdentifier(type_ids_MapStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_int32_t_2 inconsistent element TypeIdentifier."); - return; - } - return_code_MapStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_MapStruct); - - if (return_code_MapStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Map key TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - TypeIdentifier* key_identifier_anonymous_map_int32_t_int32_t_2 {nullptr}; - if (EK_COMPLETE == type_ids_MapStruct.type_identifier1()._d() || TK_NONE == type_ids_MapStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_MapStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_MapStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_MapStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_MapStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_MapStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_MapStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_MapStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_MapStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - key_identifier_anonymous_map_int32_t_int32_t_2 = new TypeIdentifier(type_ids_MapStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_MapStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_MapStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_MapStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_MapStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_MapStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_MapStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_MapStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_MapStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_MapStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - key_identifier_anonymous_map_int32_t_int32_t_2 = new TypeIdentifier(type_ids_MapStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_int32_t_2 inconsistent key TypeIdentifier."); - return; - } - EquivalenceKind equiv_kind_anonymous_map_int32_t_int32_t_2 = EK_BOTH; - if ((EK_COMPLETE == key_identifier_anonymous_map_int32_t_int32_t_2->_d() || EK_COMPLETE == element_identifier_anonymous_map_int32_t_int32_t_2->_d()) || - (TI_PLAIN_SEQUENCE_SMALL == element_identifier_anonymous_map_int32_t_int32_t_2->_d() && EK_COMPLETE == element_identifier_anonymous_map_int32_t_int32_t_2->seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == element_identifier_anonymous_map_int32_t_int32_t_2->_d() && EK_COMPLETE == element_identifier_anonymous_map_int32_t_int32_t_2->seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == element_identifier_anonymous_map_int32_t_int32_t_2->_d() && EK_COMPLETE == element_identifier_anonymous_map_int32_t_int32_t_2->array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == element_identifier_anonymous_map_int32_t_int32_t_2->_d() && EK_COMPLETE == element_identifier_anonymous_map_int32_t_int32_t_2->array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == element_identifier_anonymous_map_int32_t_int32_t_2->_d() && (EK_COMPLETE == element_identifier_anonymous_map_int32_t_int32_t_2->map_sdefn().key_identifier()->_d() || EK_COMPLETE == element_identifier_anonymous_map_int32_t_int32_t_2->map_sdefn().header().equiv_kind())) || - (TI_PLAIN_MAP_LARGE == element_identifier_anonymous_map_int32_t_int32_t_2->_d() && (EK_COMPLETE == element_identifier_anonymous_map_int32_t_int32_t_2->map_ldefn().key_identifier()->_d() || EK_COMPLETE == element_identifier_anonymous_map_int32_t_int32_t_2->map_ldefn().header().equiv_kind()))) - { - equiv_kind_anonymous_map_int32_t_int32_t_2 = EK_COMPLETE; - } - CollectionElementFlag element_flags_anonymous_map_int32_t_int32_t_2 = 0; - CollectionElementFlag key_flags_anonymous_map_int32_t_int32_t_2 = 0; - PlainCollectionHeader header_anonymous_map_int32_t_int32_t_2 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_map_int32_t_int32_t_2, element_flags_anonymous_map_int32_t_int32_t_2); - std::string type_id_kind_anonymous_map_int32_t_int32_t_2("TI_PLAIN_MAP_SMALL"); - if (type_id_kind_anonymous_map_int32_t_int32_t_2 == "TI_PLAIN_MAP_SMALL") - { - SBound bound = static_cast(2); - PlainMapSTypeDefn map_sdefn = TypeObjectUtils::build_plain_map_s_type_defn(header_anonymous_map_int32_t_int32_t_2, bound, - eprosima::fastcdr::external(element_identifier_anonymous_map_int32_t_int32_t_2), key_flags_anonymous_map_int32_t_int32_t_2, - eprosima::fastcdr::external(key_identifier_anonymous_map_int32_t_int32_t_2)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_s_map_type_identifier(map_sdefn, "anonymous_map_int32_t_int32_t_2")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_int32_t_2 already registered in TypeObjectRegistry for a different type."); - } - } - else - { - LBound bound = 2; - PlainMapLTypeDefn map_ldefn = TypeObjectUtils::build_plain_map_l_type_defn(header_anonymous_map_int32_t_int32_t_2, bound, - eprosima::fastcdr::external(element_identifier_anonymous_map_int32_t_int32_t_2), key_flags_anonymous_map_int32_t_int32_t_2, - eprosima::fastcdr::external(key_identifier_anonymous_map_int32_t_int32_t_2)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_l_map_type_identifier(map_ldefn, "anonymous_map_int32_t_int32_t_2")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_int32_t_2 already registered in TypeObjectRegistry for a different type."); - } - } - return_code_MapStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_map_int32_t_int32_t_2", type_ids_MapStruct); - if (return_code_MapStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_int32_t_2: Given Map TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_map = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_map; - MemberId member_id_my_map = 0x00000000; - if (EK_COMPLETE == type_ids_MapStruct.type_identifier1()._d() || TK_NONE == type_ids_MapStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_MapStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_MapStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_MapStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_MapStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_MapStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_MapStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_MapStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_MapStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_map = TypeObjectUtils::build_common_struct_member(member_id_my_map, member_flags_my_map, type_ids_MapStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_MapStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_MapStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_MapStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_MapStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_MapStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_MapStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_MapStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_MapStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_MapStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_map = TypeObjectUtils::build_common_struct_member(member_id_my_map, member_flags_my_map, type_ids_MapStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_map member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_map = "my_map"; - eprosima::fastcdr::optional member_ann_builtin_my_map; - ann_custom_MapStruct.reset(); - CompleteMemberDetail detail_my_map = TypeObjectUtils::build_complete_member_detail(name_my_map, member_ann_builtin_my_map, ann_custom_MapStruct); - CompleteStructMember member_my_map = TypeObjectUtils::build_complete_struct_member(common_my_map, detail_my_map); - TypeObjectUtils::add_complete_struct_member(member_seq_MapStruct, member_my_map); - } - CompleteStructType struct_type_MapStruct = TypeObjectUtils::build_complete_struct_type(struct_flags_MapStruct, header_MapStruct, member_seq_MapStruct); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_MapStruct, type_name_MapStruct.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MapStruct already registered in TypeObjectRegistry for a different type."); - } - return_code_MapStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MapStruct", type_ids_MapStruct); - if (return_code_MapStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MapStruct: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } -} -void register_MapMapStruct_type_identifier() -{ - { - StructTypeFlag struct_flags_MapMapStruct = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_MapMapStruct; - TypeIdentifierPair type_ids_MapMapStruct; - QualifiedTypeName type_name_MapMapStruct = "MapMapStruct"; - eprosima::fastcdr::optional type_ann_builtin_MapMapStruct; - eprosima::fastcdr::optional ann_custom_MapMapStruct; - CompleteTypeDetail detail_MapMapStruct = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_MapMapStruct, ann_custom_MapMapStruct, type_name_MapMapStruct.to_string()); - CompleteStructHeader header_MapMapStruct; - header_MapMapStruct = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_MapMapStruct); - CompleteStructMemberSeq member_seq_MapMapStruct; - { - return_code_MapMapStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_map_int32_t_anonymous_map_int32_t_int32_t_2_2", type_ids_MapMapStruct); - - if (return_code_MapMapStruct != eprosima::fastdds::dds::RETCODE_OK) - { - return_code_MapMapStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_map_int32_t_int32_t_2", type_ids_MapMapStruct); - - if (return_code_MapMapStruct != eprosima::fastdds::dds::RETCODE_OK) - { - return_code_MapMapStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_MapMapStruct); - - if (return_code_MapMapStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Map element TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - TypeIdentifier* element_identifier_anonymous_map_int32_t_int32_t_2 {nullptr}; - if (EK_COMPLETE == type_ids_MapMapStruct.type_identifier1()._d() || TK_NONE == type_ids_MapMapStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_MapMapStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapMapStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_MapMapStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapMapStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_MapMapStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapMapStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_MapMapStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapMapStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_MapMapStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_MapMapStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapMapStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_MapMapStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_MapMapStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapMapStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_map_int32_t_int32_t_2 = new TypeIdentifier(type_ids_MapMapStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_MapMapStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_MapMapStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapMapStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_MapMapStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapMapStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_MapMapStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapMapStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_MapMapStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapMapStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_MapMapStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_MapMapStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapMapStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_MapMapStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_MapMapStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapMapStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_map_int32_t_int32_t_2 = new TypeIdentifier(type_ids_MapMapStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_int32_t_2 inconsistent element TypeIdentifier."); - return; - } - return_code_MapMapStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_MapMapStruct); - - if (return_code_MapMapStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Map key TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - TypeIdentifier* key_identifier_anonymous_map_int32_t_int32_t_2 {nullptr}; - if (EK_COMPLETE == type_ids_MapMapStruct.type_identifier1()._d() || TK_NONE == type_ids_MapMapStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_MapMapStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapMapStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_MapMapStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapMapStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_MapMapStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapMapStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_MapMapStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapMapStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_MapMapStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_MapMapStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapMapStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_MapMapStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_MapMapStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapMapStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - key_identifier_anonymous_map_int32_t_int32_t_2 = new TypeIdentifier(type_ids_MapMapStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_MapMapStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_MapMapStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapMapStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_MapMapStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapMapStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_MapMapStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapMapStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_MapMapStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapMapStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_MapMapStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_MapMapStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapMapStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_MapMapStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_MapMapStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapMapStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - key_identifier_anonymous_map_int32_t_int32_t_2 = new TypeIdentifier(type_ids_MapMapStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_int32_t_2 inconsistent key TypeIdentifier."); - return; - } - EquivalenceKind equiv_kind_anonymous_map_int32_t_int32_t_2 = EK_BOTH; - if ((EK_COMPLETE == key_identifier_anonymous_map_int32_t_int32_t_2->_d() || EK_COMPLETE == element_identifier_anonymous_map_int32_t_int32_t_2->_d()) || - (TI_PLAIN_SEQUENCE_SMALL == element_identifier_anonymous_map_int32_t_int32_t_2->_d() && EK_COMPLETE == element_identifier_anonymous_map_int32_t_int32_t_2->seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == element_identifier_anonymous_map_int32_t_int32_t_2->_d() && EK_COMPLETE == element_identifier_anonymous_map_int32_t_int32_t_2->seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == element_identifier_anonymous_map_int32_t_int32_t_2->_d() && EK_COMPLETE == element_identifier_anonymous_map_int32_t_int32_t_2->array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == element_identifier_anonymous_map_int32_t_int32_t_2->_d() && EK_COMPLETE == element_identifier_anonymous_map_int32_t_int32_t_2->array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == element_identifier_anonymous_map_int32_t_int32_t_2->_d() && (EK_COMPLETE == element_identifier_anonymous_map_int32_t_int32_t_2->map_sdefn().key_identifier()->_d() || EK_COMPLETE == element_identifier_anonymous_map_int32_t_int32_t_2->map_sdefn().header().equiv_kind())) || - (TI_PLAIN_MAP_LARGE == element_identifier_anonymous_map_int32_t_int32_t_2->_d() && (EK_COMPLETE == element_identifier_anonymous_map_int32_t_int32_t_2->map_ldefn().key_identifier()->_d() || EK_COMPLETE == element_identifier_anonymous_map_int32_t_int32_t_2->map_ldefn().header().equiv_kind()))) - { - equiv_kind_anonymous_map_int32_t_int32_t_2 = EK_COMPLETE; - } - CollectionElementFlag element_flags_anonymous_map_int32_t_int32_t_2 = 0; - CollectionElementFlag key_flags_anonymous_map_int32_t_int32_t_2 = 0; - PlainCollectionHeader header_anonymous_map_int32_t_int32_t_2 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_map_int32_t_int32_t_2, element_flags_anonymous_map_int32_t_int32_t_2); - std::string type_id_kind_anonymous_map_int32_t_int32_t_2("TI_PLAIN_MAP_SMALL"); - if (type_id_kind_anonymous_map_int32_t_int32_t_2 == "TI_PLAIN_MAP_SMALL") - { - SBound bound = static_cast(2); - PlainMapSTypeDefn map_sdefn = TypeObjectUtils::build_plain_map_s_type_defn(header_anonymous_map_int32_t_int32_t_2, bound, - eprosima::fastcdr::external(element_identifier_anonymous_map_int32_t_int32_t_2), key_flags_anonymous_map_int32_t_int32_t_2, - eprosima::fastcdr::external(key_identifier_anonymous_map_int32_t_int32_t_2)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_s_map_type_identifier(map_sdefn, "anonymous_map_int32_t_int32_t_2")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_int32_t_2 already registered in TypeObjectRegistry for a different type."); - } - } - else - { - LBound bound = 2; - PlainMapLTypeDefn map_ldefn = TypeObjectUtils::build_plain_map_l_type_defn(header_anonymous_map_int32_t_int32_t_2, bound, - eprosima::fastcdr::external(element_identifier_anonymous_map_int32_t_int32_t_2), key_flags_anonymous_map_int32_t_int32_t_2, - eprosima::fastcdr::external(key_identifier_anonymous_map_int32_t_int32_t_2)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_l_map_type_identifier(map_ldefn, "anonymous_map_int32_t_int32_t_2")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_int32_t_2 already registered in TypeObjectRegistry for a different type."); - } - } - return_code_MapMapStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_map_int32_t_int32_t_2", type_ids_MapMapStruct); - if (return_code_MapMapStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_int32_t_2: Given Map TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - TypeIdentifier* element_identifier_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_2_2 {nullptr}; - if (EK_COMPLETE == type_ids_MapMapStruct.type_identifier1()._d() || TK_NONE == type_ids_MapMapStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_MapMapStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapMapStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_MapMapStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapMapStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_MapMapStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapMapStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_MapMapStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapMapStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_MapMapStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_MapMapStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapMapStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_MapMapStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_MapMapStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapMapStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_2_2 = new TypeIdentifier(type_ids_MapMapStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_MapMapStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_MapMapStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapMapStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_MapMapStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapMapStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_MapMapStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapMapStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_MapMapStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapMapStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_MapMapStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_MapMapStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapMapStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_MapMapStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_MapMapStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapMapStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_2_2 = new TypeIdentifier(type_ids_MapMapStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_anonymous_map_int32_t_int32_t_2_2 inconsistent element TypeIdentifier."); - return; - } - return_code_MapMapStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_MapMapStruct); - - if (return_code_MapMapStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Map key TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - TypeIdentifier* key_identifier_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_2_2 {nullptr}; - if (EK_COMPLETE == type_ids_MapMapStruct.type_identifier1()._d() || TK_NONE == type_ids_MapMapStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_MapMapStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapMapStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_MapMapStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapMapStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_MapMapStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapMapStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_MapMapStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapMapStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_MapMapStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_MapMapStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapMapStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_MapMapStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_MapMapStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapMapStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - key_identifier_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_2_2 = new TypeIdentifier(type_ids_MapMapStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_MapMapStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_MapMapStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapMapStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_MapMapStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapMapStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_MapMapStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapMapStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_MapMapStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapMapStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_MapMapStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_MapMapStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapMapStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_MapMapStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_MapMapStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapMapStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - key_identifier_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_2_2 = new TypeIdentifier(type_ids_MapMapStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_anonymous_map_int32_t_int32_t_2_2 inconsistent key TypeIdentifier."); - return; - } - EquivalenceKind equiv_kind_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_2_2 = EK_BOTH; - if ((EK_COMPLETE == key_identifier_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_2_2->_d() || EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_2_2->_d()) || - (TI_PLAIN_SEQUENCE_SMALL == element_identifier_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_2_2->_d() && EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_2_2->seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == element_identifier_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_2_2->_d() && EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_2_2->seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == element_identifier_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_2_2->_d() && EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_2_2->array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == element_identifier_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_2_2->_d() && EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_2_2->array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == element_identifier_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_2_2->_d() && (EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_2_2->map_sdefn().key_identifier()->_d() || EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_2_2->map_sdefn().header().equiv_kind())) || - (TI_PLAIN_MAP_LARGE == element_identifier_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_2_2->_d() && (EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_2_2->map_ldefn().key_identifier()->_d() || EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_2_2->map_ldefn().header().equiv_kind()))) - { - equiv_kind_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_2_2 = EK_COMPLETE; - } - CollectionElementFlag element_flags_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_2_2 = 0; - CollectionElementFlag key_flags_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_2_2 = 0; - PlainCollectionHeader header_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_2_2 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_2_2, element_flags_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_2_2); - std::string type_id_kind_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_2_2("TI_PLAIN_MAP_SMALL"); - if (type_id_kind_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_2_2 == "TI_PLAIN_MAP_SMALL") - { - SBound bound = static_cast(2); - PlainMapSTypeDefn map_sdefn = TypeObjectUtils::build_plain_map_s_type_defn(header_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_2_2, bound, - eprosima::fastcdr::external(element_identifier_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_2_2), key_flags_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_2_2, - eprosima::fastcdr::external(key_identifier_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_2_2)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_s_map_type_identifier(map_sdefn, "anonymous_map_int32_t_anonymous_map_int32_t_int32_t_2_2")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_anonymous_map_int32_t_int32_t_2_2 already registered in TypeObjectRegistry for a different type."); - } - } - else - { - LBound bound = 2; - PlainMapLTypeDefn map_ldefn = TypeObjectUtils::build_plain_map_l_type_defn(header_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_2_2, bound, - eprosima::fastcdr::external(element_identifier_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_2_2), key_flags_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_2_2, - eprosima::fastcdr::external(key_identifier_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_2_2)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_l_map_type_identifier(map_ldefn, "anonymous_map_int32_t_anonymous_map_int32_t_int32_t_2_2")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_anonymous_map_int32_t_int32_t_2_2 already registered in TypeObjectRegistry for a different type."); - } - } - return_code_MapMapStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_map_int32_t_anonymous_map_int32_t_int32_t_2_2", type_ids_MapMapStruct); - if (return_code_MapMapStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_anonymous_map_int32_t_int32_t_2_2: Given Map TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_map_map = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_map_map; - MemberId member_id_my_map_map = 0x00000000; - if (EK_COMPLETE == type_ids_MapMapStruct.type_identifier1()._d() || TK_NONE == type_ids_MapMapStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_MapMapStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapMapStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_MapMapStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapMapStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_MapMapStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapMapStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_MapMapStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapMapStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_MapMapStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_MapMapStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapMapStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_MapMapStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_MapMapStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapMapStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_map_map = TypeObjectUtils::build_common_struct_member(member_id_my_map_map, member_flags_my_map_map, type_ids_MapMapStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_MapMapStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_MapMapStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapMapStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_MapMapStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapMapStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_MapMapStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapMapStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_MapMapStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapMapStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_MapMapStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_MapMapStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapMapStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_MapMapStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_MapMapStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapMapStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_map_map = TypeObjectUtils::build_common_struct_member(member_id_my_map_map, member_flags_my_map_map, type_ids_MapMapStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_map_map member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_map_map = "my_map_map"; - eprosima::fastcdr::optional member_ann_builtin_my_map_map; - ann_custom_MapMapStruct.reset(); - CompleteMemberDetail detail_my_map_map = TypeObjectUtils::build_complete_member_detail(name_my_map_map, member_ann_builtin_my_map_map, ann_custom_MapMapStruct); - CompleteStructMember member_my_map_map = TypeObjectUtils::build_complete_struct_member(common_my_map_map, detail_my_map_map); - TypeObjectUtils::add_complete_struct_member(member_seq_MapMapStruct, member_my_map_map); - } - CompleteStructType struct_type_MapMapStruct = TypeObjectUtils::build_complete_struct_type(struct_flags_MapMapStruct, header_MapMapStruct, member_seq_MapMapStruct); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_MapMapStruct, type_name_MapMapStruct.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MapMapStruct already registered in TypeObjectRegistry for a different type."); - } - return_code_MapMapStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MapMapStruct", type_ids_MapMapStruct); - if (return_code_MapMapStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MapMapStruct: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } -} -void register_BitsetStruct_type_identifier() -{ - { - StructTypeFlag struct_flags_BitsetStruct = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_BitsetStruct; - TypeIdentifierPair type_ids_BitsetStruct; - QualifiedTypeName type_name_BitsetStruct = "BitsetStruct"; - eprosima::fastcdr::optional type_ann_builtin_BitsetStruct; - eprosima::fastcdr::optional ann_custom_BitsetStruct; - CompleteTypeDetail detail_BitsetStruct = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_BitsetStruct, ann_custom_BitsetStruct, type_name_BitsetStruct.to_string()); - CompleteStructHeader header_BitsetStruct; - header_BitsetStruct = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_BitsetStruct); - CompleteStructMemberSeq member_seq_BitsetStruct; - { - return_code_BitsetStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyBitset", type_ids_BitsetStruct); - - if (return_code_BitsetStruct != eprosima::fastdds::dds::RETCODE_OK) - { - BitsetTypeFlag bitset_flags_MyBitset = 0; - QualifiedTypeName type_name_MyBitset = "MyBitset"; - eprosima::fastcdr::optional type_ann_builtin_MyBitset; - eprosima::fastcdr::optional ann_custom_MyBitset; - CompleteTypeDetail detail_MyBitset = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_MyBitset, ann_custom_MyBitset, type_name_MyBitset.to_string()); - CompleteBitsetHeader header_MyBitset = TypeObjectUtils::build_complete_bitset_header(detail_MyBitset); - CompleteBitfieldSeq field_seq_MyBitset; - { - uint16_t position_a = 0; - BitsetMemberFlag flags_a = 0; - uint8_t bitcount_a = 2; - TypeKind holder_type_a = TK_BYTE; - CommonBitfield common_a = TypeObjectUtils::build_common_bitfield(position_a, flags_a, bitcount_a, holder_type_a); - eprosima::fastcdr::optional member_ann_builtin_a; - ann_custom_MyBitset.reset(); - MemberName name_a = "a"; - CompleteMemberDetail detail_a = TypeObjectUtils::build_complete_member_detail(name_a, member_ann_builtin_a, ann_custom_MyBitset); - CompleteBitfield bitfield_a = TypeObjectUtils::build_complete_bitfield(common_a, detail_a); - TypeObjectUtils::add_complete_bitfield(field_seq_MyBitset, bitfield_a); - } - { - uint16_t position_b = 10; - BitsetMemberFlag flags_b = 0; - uint8_t bitcount_b = 20; - TypeKind holder_type_b = TK_UINT32; - CommonBitfield common_b = TypeObjectUtils::build_common_bitfield(position_b, flags_b, bitcount_b, holder_type_b); - eprosima::fastcdr::optional member_ann_builtin_b; - ann_custom_MyBitset.reset(); - MemberName name_b = "b"; - CompleteMemberDetail detail_b = TypeObjectUtils::build_complete_member_detail(name_b, member_ann_builtin_b, ann_custom_MyBitset); - CompleteBitfield bitfield_b = TypeObjectUtils::build_complete_bitfield(common_b, detail_b); - TypeObjectUtils::add_complete_bitfield(field_seq_MyBitset, bitfield_b); - } - CompleteBitsetType bitset_type_MyBitset = TypeObjectUtils::build_complete_bitset_type(bitset_flags_MyBitset, header_MyBitset, field_seq_MyBitset); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_bitset_type_object(bitset_type_MyBitset, type_name_MyBitset.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyBitset already registered in TypeObjectRegistry for a different type."); - } - return_code_BitsetStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyBitset", type_ids_BitsetStruct); - if (return_code_BitsetStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyBitset: Given Bitset TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_a = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_a; - MemberId member_id_a = 0x00000000; - if (EK_COMPLETE == type_ids_BitsetStruct.type_identifier1()._d() || TK_NONE == type_ids_BitsetStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BitsetStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BitsetStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BitsetStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BitsetStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BitsetStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BitsetStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BitsetStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BitsetStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BitsetStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BitsetStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BitsetStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BitsetStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BitsetStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BitsetStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_a = TypeObjectUtils::build_common_struct_member(member_id_a, member_flags_a, type_ids_BitsetStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BitsetStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BitsetStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BitsetStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BitsetStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BitsetStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BitsetStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BitsetStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BitsetStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BitsetStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BitsetStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BitsetStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BitsetStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BitsetStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BitsetStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BitsetStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_a = TypeObjectUtils::build_common_struct_member(member_id_a, member_flags_a, type_ids_BitsetStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure a member TypeIdentifier inconsistent."); - return; - } - MemberName name_a = "a"; - eprosima::fastcdr::optional member_ann_builtin_a; - ann_custom_BitsetStruct.reset(); - CompleteMemberDetail detail_a = TypeObjectUtils::build_complete_member_detail(name_a, member_ann_builtin_a, ann_custom_BitsetStruct); - CompleteStructMember member_a = TypeObjectUtils::build_complete_struct_member(common_a, detail_a); - TypeObjectUtils::add_complete_struct_member(member_seq_BitsetStruct, member_a); - } - CompleteStructType struct_type_BitsetStruct = TypeObjectUtils::build_complete_struct_type(struct_flags_BitsetStruct, header_BitsetStruct, member_seq_BitsetStruct); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_BitsetStruct, type_name_BitsetStruct.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "BitsetStruct already registered in TypeObjectRegistry for a different type."); - } - return_code_BitsetStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "BitsetStruct", type_ids_BitsetStruct); - if (return_code_BitsetStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "BitsetStruct: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } -} -void register_StructStruct_type_identifier() -{ - { - StructTypeFlag struct_flags_StructStruct = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_StructStruct; - TypeIdentifierPair type_ids_StructStruct; - QualifiedTypeName type_name_StructStruct = "StructStruct"; - eprosima::fastcdr::optional type_ann_builtin_StructStruct; - eprosima::fastcdr::optional ann_custom_StructStruct; - CompleteTypeDetail detail_StructStruct = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_StructStruct, ann_custom_StructStruct, type_name_StructStruct.to_string()); - CompleteStructHeader header_StructStruct; - header_StructStruct = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_StructStruct); - CompleteStructMemberSeq member_seq_StructStruct; - { - return_code_StructStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_StructStruct); - - if (return_code_StructStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "a Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_a = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_a; - MemberId member_id_a = 0x00000000; - if (EK_COMPLETE == type_ids_StructStruct.type_identifier1()._d() || TK_NONE == type_ids_StructStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_StructStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_StructStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_StructStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_StructStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_StructStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_StructStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_StructStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_StructStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_StructStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_StructStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_StructStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_StructStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_a = TypeObjectUtils::build_common_struct_member(member_id_a, member_flags_a, type_ids_StructStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_StructStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_StructStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_StructStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_StructStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_StructStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_StructStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_StructStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_StructStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_StructStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_StructStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_StructStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_StructStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_StructStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_a = TypeObjectUtils::build_common_struct_member(member_id_a, member_flags_a, type_ids_StructStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure a member TypeIdentifier inconsistent."); - return; - } - MemberName name_a = "a"; - eprosima::fastcdr::optional member_ann_builtin_a; - ann_custom_StructStruct.reset(); - CompleteMemberDetail detail_a = TypeObjectUtils::build_complete_member_detail(name_a, member_ann_builtin_a, ann_custom_StructStruct); - CompleteStructMember member_a = TypeObjectUtils::build_complete_struct_member(common_a, detail_a); - TypeObjectUtils::add_complete_struct_member(member_seq_StructStruct, member_a); - } - { - return_code_StructStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int64_t", type_ids_StructStruct); - - if (return_code_StructStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "b Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_b = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_b; - MemberId member_id_b = 0x00000001; - if (EK_COMPLETE == type_ids_StructStruct.type_identifier1()._d() || TK_NONE == type_ids_StructStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_StructStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_StructStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_StructStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_StructStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_StructStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_StructStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_StructStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_StructStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_StructStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_StructStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_StructStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_StructStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_b = TypeObjectUtils::build_common_struct_member(member_id_b, member_flags_b, type_ids_StructStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_StructStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_StructStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_StructStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_StructStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_StructStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_StructStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_StructStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_StructStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_StructStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_StructStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_StructStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_StructStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_StructStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_b = TypeObjectUtils::build_common_struct_member(member_id_b, member_flags_b, type_ids_StructStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure b member TypeIdentifier inconsistent."); - return; - } - MemberName name_b = "b"; - eprosima::fastcdr::optional member_ann_builtin_b; - ann_custom_StructStruct.reset(); - CompleteMemberDetail detail_b = TypeObjectUtils::build_complete_member_detail(name_b, member_ann_builtin_b, ann_custom_StructStruct); - CompleteStructMember member_b = TypeObjectUtils::build_complete_struct_member(common_b, detail_b); - TypeObjectUtils::add_complete_struct_member(member_seq_StructStruct, member_b); - } - CompleteStructType struct_type_StructStruct = TypeObjectUtils::build_complete_struct_type(struct_flags_StructStruct, header_StructStruct, member_seq_StructStruct); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_StructStruct, type_name_StructStruct.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "StructStruct already registered in TypeObjectRegistry for a different type."); - } - return_code_StructStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "StructStruct", type_ids_StructStruct); - if (return_code_StructStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "StructStruct: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } -} -void register_StructStructStruct_type_identifier() -{ - { - StructTypeFlag struct_flags_StructStructStruct = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_StructStructStruct; - TypeIdentifierPair type_ids_StructStructStruct; - QualifiedTypeName type_name_StructStructStruct = "StructStructStruct"; - eprosima::fastcdr::optional type_ann_builtin_StructStructStruct; - eprosima::fastcdr::optional ann_custom_StructStructStruct; - CompleteTypeDetail detail_StructStructStruct = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_StructStructStruct, ann_custom_StructStructStruct, type_name_StructStructStruct.to_string()); - CompleteStructHeader header_StructStructStruct; - header_StructStructStruct = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_StructStructStruct); - CompleteStructMemberSeq member_seq_StructStructStruct; - { - return_code_StructStructStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "StructStruct", type_ids_StructStructStruct); - - if (return_code_StructStructStruct != eprosima::fastdds::dds::RETCODE_OK) - { - { - StructTypeFlag struct_flags_StructStruct = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_StructStruct; - TypeIdentifierPair type_ids_StructStruct; - QualifiedTypeName type_name_StructStruct = "StructStruct"; - eprosima::fastcdr::optional type_ann_builtin_StructStruct; - eprosima::fastcdr::optional ann_custom_StructStruct; - CompleteTypeDetail detail_StructStruct = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_StructStruct, ann_custom_StructStruct, type_name_StructStruct.to_string()); - CompleteStructHeader header_StructStruct; - header_StructStruct = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_StructStruct); - CompleteStructMemberSeq member_seq_StructStruct; - { - return_code_StructStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_StructStruct); - - if (return_code_StructStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "a Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_a = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_a; - MemberId member_id_a = 0x00000000; - if (EK_COMPLETE == type_ids_StructStruct.type_identifier1()._d() || TK_NONE == type_ids_StructStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_StructStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_StructStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_StructStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_StructStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_StructStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_StructStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_StructStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_StructStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_StructStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_StructStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_StructStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_StructStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_a = TypeObjectUtils::build_common_struct_member(member_id_a, member_flags_a, type_ids_StructStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_StructStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_StructStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_StructStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_StructStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_StructStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_StructStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_StructStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_StructStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_StructStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_StructStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_StructStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_StructStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_StructStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_a = TypeObjectUtils::build_common_struct_member(member_id_a, member_flags_a, type_ids_StructStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure a member TypeIdentifier inconsistent."); - return; - } - MemberName name_a = "a"; - eprosima::fastcdr::optional member_ann_builtin_a; - ann_custom_StructStruct.reset(); - CompleteMemberDetail detail_a = TypeObjectUtils::build_complete_member_detail(name_a, member_ann_builtin_a, ann_custom_StructStruct); - CompleteStructMember member_a = TypeObjectUtils::build_complete_struct_member(common_a, detail_a); - TypeObjectUtils::add_complete_struct_member(member_seq_StructStruct, member_a); - } - { - return_code_StructStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int64_t", type_ids_StructStruct); - - if (return_code_StructStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "b Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_b = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_b; - MemberId member_id_b = 0x00000001; - if (EK_COMPLETE == type_ids_StructStruct.type_identifier1()._d() || TK_NONE == type_ids_StructStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_StructStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_StructStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_StructStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_StructStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_StructStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_StructStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_StructStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_StructStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_StructStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_StructStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_StructStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_StructStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_b = TypeObjectUtils::build_common_struct_member(member_id_b, member_flags_b, type_ids_StructStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_StructStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_StructStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_StructStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_StructStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_StructStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_StructStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_StructStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_StructStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_StructStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_StructStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_StructStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_StructStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_StructStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_b = TypeObjectUtils::build_common_struct_member(member_id_b, member_flags_b, type_ids_StructStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure b member TypeIdentifier inconsistent."); - return; - } - MemberName name_b = "b"; - eprosima::fastcdr::optional member_ann_builtin_b; - ann_custom_StructStruct.reset(); - CompleteMemberDetail detail_b = TypeObjectUtils::build_complete_member_detail(name_b, member_ann_builtin_b, ann_custom_StructStruct); - CompleteStructMember member_b = TypeObjectUtils::build_complete_struct_member(common_b, detail_b); - TypeObjectUtils::add_complete_struct_member(member_seq_StructStruct, member_b); - } - CompleteStructType struct_type_StructStruct = TypeObjectUtils::build_complete_struct_type(struct_flags_StructStruct, header_StructStruct, member_seq_StructStruct); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_StructStruct, type_name_StructStruct.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "StructStruct already registered in TypeObjectRegistry for a different type."); - } - return_code_StructStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "StructStruct", type_ids_StructStruct); - if (return_code_StructStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "StructStruct: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - } - StructMemberFlag member_flags_child_struct = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_child_struct; - MemberId member_id_child_struct = 0x00000000; - if (EK_COMPLETE == type_ids_StructStructStruct.type_identifier1()._d() || TK_NONE == type_ids_StructStructStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructStructStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_StructStructStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructStructStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_StructStructStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_StructStructStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_StructStructStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_StructStructStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_StructStructStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_StructStructStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_StructStructStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_StructStructStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_StructStructStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_StructStructStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_StructStructStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_child_struct = TypeObjectUtils::build_common_struct_member(member_id_child_struct, member_flags_child_struct, type_ids_StructStructStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_StructStructStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructStructStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_StructStructStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructStructStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_StructStructStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_StructStructStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_StructStructStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_StructStructStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_StructStructStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_StructStructStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_StructStructStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_StructStructStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_StructStructStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_StructStructStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_StructStructStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_child_struct = TypeObjectUtils::build_common_struct_member(member_id_child_struct, member_flags_child_struct, type_ids_StructStructStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure child_struct member TypeIdentifier inconsistent."); - return; - } - MemberName name_child_struct = "child_struct"; - eprosima::fastcdr::optional member_ann_builtin_child_struct; - ann_custom_StructStructStruct.reset(); - CompleteMemberDetail detail_child_struct = TypeObjectUtils::build_complete_member_detail(name_child_struct, member_ann_builtin_child_struct, ann_custom_StructStructStruct); - CompleteStructMember member_child_struct = TypeObjectUtils::build_complete_struct_member(common_child_struct, detail_child_struct); - TypeObjectUtils::add_complete_struct_member(member_seq_StructStructStruct, member_child_struct); - } - { - return_code_StructStructStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int64_t", type_ids_StructStructStruct); - - if (return_code_StructStructStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "child_int64 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_child_int64 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_child_int64; - MemberId member_id_child_int64 = 0x00000001; - if (EK_COMPLETE == type_ids_StructStructStruct.type_identifier1()._d() || TK_NONE == type_ids_StructStructStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructStructStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_StructStructStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructStructStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_StructStructStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_StructStructStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_StructStructStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_StructStructStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_StructStructStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_StructStructStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_StructStructStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_StructStructStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_StructStructStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_StructStructStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_StructStructStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_child_int64 = TypeObjectUtils::build_common_struct_member(member_id_child_int64, member_flags_child_int64, type_ids_StructStructStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_StructStructStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructStructStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_StructStructStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructStructStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_StructStructStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_StructStructStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_StructStructStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_StructStructStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_StructStructStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_StructStructStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_StructStructStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_StructStructStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_StructStructStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_StructStructStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_StructStructStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_child_int64 = TypeObjectUtils::build_common_struct_member(member_id_child_int64, member_flags_child_int64, type_ids_StructStructStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure child_int64 member TypeIdentifier inconsistent."); - return; - } - MemberName name_child_int64 = "child_int64"; - eprosima::fastcdr::optional member_ann_builtin_child_int64; - ann_custom_StructStructStruct.reset(); - CompleteMemberDetail detail_child_int64 = TypeObjectUtils::build_complete_member_detail(name_child_int64, member_ann_builtin_child_int64, ann_custom_StructStructStruct); - CompleteStructMember member_child_int64 = TypeObjectUtils::build_complete_struct_member(common_child_int64, detail_child_int64); - TypeObjectUtils::add_complete_struct_member(member_seq_StructStructStruct, member_child_int64); - } - CompleteStructType struct_type_StructStructStruct = TypeObjectUtils::build_complete_struct_type(struct_flags_StructStructStruct, header_StructStructStruct, member_seq_StructStructStruct); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_StructStructStruct, type_name_StructStructStruct.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "StructStructStruct already registered in TypeObjectRegistry for a different type."); - } - return_code_StructStructStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "StructStructStruct", type_ids_StructStructStruct); - if (return_code_StructStructStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "StructStructStruct: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } -} -void register_SimpleUnion_type_identifier() -{ - { - ReturnCode_t return_code_SimpleUnion; - TypeIdentifierPair type_ids_SimpleUnion; - UnionTypeFlag union_flags_SimpleUnion = TypeObjectUtils::build_union_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - QualifiedTypeName type_name_SimpleUnion = "SimpleUnion"; - eprosima::fastcdr::optional type_ann_builtin_SimpleUnion; - eprosima::fastcdr::optional ann_custom_SimpleUnion; - CompleteTypeDetail detail_SimpleUnion = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_SimpleUnion, ann_custom_SimpleUnion, type_name_SimpleUnion.to_string()); - CompleteUnionHeader header_SimpleUnion = TypeObjectUtils::build_complete_union_header(detail_SimpleUnion); - UnionDiscriminatorFlag member_flags_SimpleUnion = TypeObjectUtils::build_union_discriminator_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false); - return_code_SimpleUnion = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_SimpleUnion); - - if (return_code_SimpleUnion != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Union discriminator TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - CommonDiscriminatorMember common_SimpleUnion; - if (EK_COMPLETE == type_ids_SimpleUnion.type_identifier1()._d() || TK_NONE == type_ids_SimpleUnion.type_identifier2()._d()) - { - common_SimpleUnion = TypeObjectUtils::build_common_discriminator_member(member_flags_SimpleUnion, type_ids_SimpleUnion.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_SimpleUnion.type_identifier2()._d()) - { - common_SimpleUnion = TypeObjectUtils::build_common_discriminator_member(member_flags_SimpleUnion, type_ids_SimpleUnion.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "SimpleUnion discriminator TypeIdentifier inconsistent."); - return; - } - type_ann_builtin_SimpleUnion.reset(); - ann_custom_SimpleUnion.reset(); - CompleteDiscriminatorMember discriminator_SimpleUnion = TypeObjectUtils::build_complete_discriminator_member(common_SimpleUnion, - type_ann_builtin_SimpleUnion, ann_custom_SimpleUnion); - CompleteUnionMemberSeq member_seq_SimpleUnion; - { - return_code_SimpleUnion = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_SimpleUnion); - - if (return_code_SimpleUnion != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "first Union member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - UnionMemberFlag member_flags_first = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false); - UnionCaseLabelSeq label_seq_first; - TypeObjectUtils::add_union_case_label(label_seq_first, static_cast(0)); - CommonUnionMember common_first; - MemberId member_id_first = 0x00000001; - if (EK_COMPLETE == type_ids_SimpleUnion.type_identifier1()._d() || TK_NONE == type_ids_SimpleUnion.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SimpleUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SimpleUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SimpleUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SimpleUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SimpleUnion.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SimpleUnion.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_first = TypeObjectUtils::build_common_union_member(member_id_first, member_flags_first, type_ids_SimpleUnion.type_identifier1(), - label_seq_first); - } - else if (EK_COMPLETE == type_ids_SimpleUnion.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SimpleUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SimpleUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SimpleUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SimpleUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SimpleUnion.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SimpleUnion.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_first = TypeObjectUtils::build_common_union_member(member_id_first, member_flags_first, type_ids_SimpleUnion.type_identifier2(), - label_seq_first); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Union first member TypeIdentifier inconsistent."); - return; - } - MemberName name_first = "first"; - eprosima::fastcdr::optional member_ann_builtin_first; - ann_custom_SimpleUnion.reset(); - CompleteMemberDetail detail_first = TypeObjectUtils::build_complete_member_detail(name_first, member_ann_builtin_first, ann_custom_SimpleUnion); - CompleteUnionMember member_first = TypeObjectUtils::build_complete_union_member(common_first, detail_first); - TypeObjectUtils::add_complete_union_member(member_seq_SimpleUnion, member_first); - } - { - return_code_SimpleUnion = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int64_t", type_ids_SimpleUnion); - - if (return_code_SimpleUnion != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "second Union member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - UnionMemberFlag member_flags_second = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false); - UnionCaseLabelSeq label_seq_second; - TypeObjectUtils::add_union_case_label(label_seq_second, static_cast(1)); - CommonUnionMember common_second; - MemberId member_id_second = 0x00000002; - if (EK_COMPLETE == type_ids_SimpleUnion.type_identifier1()._d() || TK_NONE == type_ids_SimpleUnion.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SimpleUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SimpleUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SimpleUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SimpleUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SimpleUnion.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SimpleUnion.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_second = TypeObjectUtils::build_common_union_member(member_id_second, member_flags_second, type_ids_SimpleUnion.type_identifier1(), - label_seq_second); - } - else if (EK_COMPLETE == type_ids_SimpleUnion.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SimpleUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SimpleUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SimpleUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SimpleUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SimpleUnion.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SimpleUnion.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_second = TypeObjectUtils::build_common_union_member(member_id_second, member_flags_second, type_ids_SimpleUnion.type_identifier2(), - label_seq_second); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Union second member TypeIdentifier inconsistent."); - return; - } - MemberName name_second = "second"; - eprosima::fastcdr::optional member_ann_builtin_second; - ann_custom_SimpleUnion.reset(); - CompleteMemberDetail detail_second = TypeObjectUtils::build_complete_member_detail(name_second, member_ann_builtin_second, ann_custom_SimpleUnion); - CompleteUnionMember member_second = TypeObjectUtils::build_complete_union_member(common_second, detail_second); - TypeObjectUtils::add_complete_union_member(member_seq_SimpleUnion, member_second); - } - CompleteUnionType union_type_SimpleUnion = TypeObjectUtils::build_complete_union_type(union_flags_SimpleUnion, header_SimpleUnion, discriminator_SimpleUnion, - member_seq_SimpleUnion); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_union_type_object(union_type_SimpleUnion, type_name_SimpleUnion.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "SimpleUnion already registered in TypeObjectRegistry for a different type."); - } - return_code_SimpleUnion = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "SimpleUnion", type_ids_SimpleUnion); - if (return_code_SimpleUnion != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "SimpleUnion: Given Union TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } -} -void register_UnionUnion_type_identifier() -{ - { - ReturnCode_t return_code_UnionUnion; - TypeIdentifierPair type_ids_UnionUnion; - UnionTypeFlag union_flags_UnionUnion = TypeObjectUtils::build_union_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - QualifiedTypeName type_name_UnionUnion = "UnionUnion"; - eprosima::fastcdr::optional type_ann_builtin_UnionUnion; - eprosima::fastcdr::optional ann_custom_UnionUnion; - CompleteTypeDetail detail_UnionUnion = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_UnionUnion, ann_custom_UnionUnion, type_name_UnionUnion.to_string()); - CompleteUnionHeader header_UnionUnion = TypeObjectUtils::build_complete_union_header(detail_UnionUnion); - UnionDiscriminatorFlag member_flags_UnionUnion = TypeObjectUtils::build_union_discriminator_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false); - return_code_UnionUnion = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_UnionUnion); - - if (return_code_UnionUnion != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Union discriminator TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - CommonDiscriminatorMember common_UnionUnion; - if (EK_COMPLETE == type_ids_UnionUnion.type_identifier1()._d() || TK_NONE == type_ids_UnionUnion.type_identifier2()._d()) - { - common_UnionUnion = TypeObjectUtils::build_common_discriminator_member(member_flags_UnionUnion, type_ids_UnionUnion.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_UnionUnion.type_identifier2()._d()) - { - common_UnionUnion = TypeObjectUtils::build_common_discriminator_member(member_flags_UnionUnion, type_ids_UnionUnion.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "UnionUnion discriminator TypeIdentifier inconsistent."); - return; - } - type_ann_builtin_UnionUnion.reset(); - ann_custom_UnionUnion.reset(); - CompleteDiscriminatorMember discriminator_UnionUnion = TypeObjectUtils::build_complete_discriminator_member(common_UnionUnion, - type_ann_builtin_UnionUnion, ann_custom_UnionUnion); - CompleteUnionMemberSeq member_seq_UnionUnion; - { - return_code_UnionUnion = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_UnionUnion); - - if (return_code_UnionUnion != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "first Union member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - UnionMemberFlag member_flags_first = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false); - UnionCaseLabelSeq label_seq_first; - TypeObjectUtils::add_union_case_label(label_seq_first, static_cast(0)); - CommonUnionMember common_first; - MemberId member_id_first = 0x00000001; - if (EK_COMPLETE == type_ids_UnionUnion.type_identifier1()._d() || TK_NONE == type_ids_UnionUnion.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_UnionUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_UnionUnion.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_UnionUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_UnionUnion.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_UnionUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_UnionUnion.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_UnionUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_UnionUnion.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_UnionUnion.type_identifier1()._d() && - (EK_COMPLETE == type_ids_UnionUnion.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_UnionUnion.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_UnionUnion.type_identifier1()._d() && - (EK_COMPLETE == type_ids_UnionUnion.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_UnionUnion.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_first = TypeObjectUtils::build_common_union_member(member_id_first, member_flags_first, type_ids_UnionUnion.type_identifier1(), - label_seq_first); - } - else if (EK_COMPLETE == type_ids_UnionUnion.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_UnionUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_UnionUnion.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_UnionUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_UnionUnion.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_UnionUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_UnionUnion.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_UnionUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_UnionUnion.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_UnionUnion.type_identifier2()._d() && - (EK_COMPLETE == type_ids_UnionUnion.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_UnionUnion.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_UnionUnion.type_identifier2()._d() && - (EK_COMPLETE == type_ids_UnionUnion.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_UnionUnion.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_first = TypeObjectUtils::build_common_union_member(member_id_first, member_flags_first, type_ids_UnionUnion.type_identifier2(), - label_seq_first); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Union first member TypeIdentifier inconsistent."); - return; - } - MemberName name_first = "first"; - eprosima::fastcdr::optional member_ann_builtin_first; - ann_custom_UnionUnion.reset(); - CompleteMemberDetail detail_first = TypeObjectUtils::build_complete_member_detail(name_first, member_ann_builtin_first, ann_custom_UnionUnion); - CompleteUnionMember member_first = TypeObjectUtils::build_complete_union_member(common_first, detail_first); - TypeObjectUtils::add_complete_union_member(member_seq_UnionUnion, member_first); - } - { - return_code_UnionUnion = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "SimpleUnion", type_ids_UnionUnion); - - if (return_code_UnionUnion != eprosima::fastdds::dds::RETCODE_OK) - { - { - ReturnCode_t return_code_SimpleUnion; - TypeIdentifierPair type_ids_SimpleUnion; - UnionTypeFlag union_flags_SimpleUnion = TypeObjectUtils::build_union_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - QualifiedTypeName type_name_SimpleUnion = "SimpleUnion"; - eprosima::fastcdr::optional type_ann_builtin_SimpleUnion; - eprosima::fastcdr::optional ann_custom_SimpleUnion; - CompleteTypeDetail detail_SimpleUnion = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_SimpleUnion, ann_custom_SimpleUnion, type_name_SimpleUnion.to_string()); - CompleteUnionHeader header_SimpleUnion = TypeObjectUtils::build_complete_union_header(detail_SimpleUnion); - UnionDiscriminatorFlag member_flags_SimpleUnion = TypeObjectUtils::build_union_discriminator_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false); - return_code_SimpleUnion = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_SimpleUnion); - - if (return_code_SimpleUnion != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Union discriminator TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - CommonDiscriminatorMember common_SimpleUnion; - if (EK_COMPLETE == type_ids_SimpleUnion.type_identifier1()._d() || TK_NONE == type_ids_SimpleUnion.type_identifier2()._d()) - { - common_SimpleUnion = TypeObjectUtils::build_common_discriminator_member(member_flags_SimpleUnion, type_ids_SimpleUnion.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_SimpleUnion.type_identifier2()._d()) - { - common_SimpleUnion = TypeObjectUtils::build_common_discriminator_member(member_flags_SimpleUnion, type_ids_SimpleUnion.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "SimpleUnion discriminator TypeIdentifier inconsistent."); - return; - } - type_ann_builtin_SimpleUnion.reset(); - ann_custom_SimpleUnion.reset(); - CompleteDiscriminatorMember discriminator_SimpleUnion = TypeObjectUtils::build_complete_discriminator_member(common_SimpleUnion, - type_ann_builtin_SimpleUnion, ann_custom_SimpleUnion); - CompleteUnionMemberSeq member_seq_SimpleUnion; - { - return_code_SimpleUnion = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_SimpleUnion); - - if (return_code_SimpleUnion != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "first Union member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - UnionMemberFlag member_flags_first = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false); - UnionCaseLabelSeq label_seq_first; - TypeObjectUtils::add_union_case_label(label_seq_first, static_cast(0)); - CommonUnionMember common_first; - MemberId member_id_first = 0x00000001; - if (EK_COMPLETE == type_ids_SimpleUnion.type_identifier1()._d() || TK_NONE == type_ids_SimpleUnion.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SimpleUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SimpleUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SimpleUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SimpleUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SimpleUnion.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SimpleUnion.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_first = TypeObjectUtils::build_common_union_member(member_id_first, member_flags_first, type_ids_SimpleUnion.type_identifier1(), - label_seq_first); - } - else if (EK_COMPLETE == type_ids_SimpleUnion.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SimpleUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SimpleUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SimpleUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SimpleUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SimpleUnion.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SimpleUnion.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_first = TypeObjectUtils::build_common_union_member(member_id_first, member_flags_first, type_ids_SimpleUnion.type_identifier2(), - label_seq_first); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Union first member TypeIdentifier inconsistent."); - return; - } - MemberName name_first = "first"; - eprosima::fastcdr::optional member_ann_builtin_first; - ann_custom_SimpleUnion.reset(); - CompleteMemberDetail detail_first = TypeObjectUtils::build_complete_member_detail(name_first, member_ann_builtin_first, ann_custom_SimpleUnion); - CompleteUnionMember member_first = TypeObjectUtils::build_complete_union_member(common_first, detail_first); - TypeObjectUtils::add_complete_union_member(member_seq_SimpleUnion, member_first); - } - { - return_code_SimpleUnion = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int64_t", type_ids_SimpleUnion); - - if (return_code_SimpleUnion != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "second Union member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - UnionMemberFlag member_flags_second = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false); - UnionCaseLabelSeq label_seq_second; - TypeObjectUtils::add_union_case_label(label_seq_second, static_cast(1)); - CommonUnionMember common_second; - MemberId member_id_second = 0x00000002; - if (EK_COMPLETE == type_ids_SimpleUnion.type_identifier1()._d() || TK_NONE == type_ids_SimpleUnion.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SimpleUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SimpleUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SimpleUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SimpleUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SimpleUnion.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SimpleUnion.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_second = TypeObjectUtils::build_common_union_member(member_id_second, member_flags_second, type_ids_SimpleUnion.type_identifier1(), - label_seq_second); - } - else if (EK_COMPLETE == type_ids_SimpleUnion.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SimpleUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SimpleUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SimpleUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SimpleUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SimpleUnion.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SimpleUnion.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_second = TypeObjectUtils::build_common_union_member(member_id_second, member_flags_second, type_ids_SimpleUnion.type_identifier2(), - label_seq_second); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Union second member TypeIdentifier inconsistent."); - return; - } - MemberName name_second = "second"; - eprosima::fastcdr::optional member_ann_builtin_second; - ann_custom_SimpleUnion.reset(); - CompleteMemberDetail detail_second = TypeObjectUtils::build_complete_member_detail(name_second, member_ann_builtin_second, ann_custom_SimpleUnion); - CompleteUnionMember member_second = TypeObjectUtils::build_complete_union_member(common_second, detail_second); - TypeObjectUtils::add_complete_union_member(member_seq_SimpleUnion, member_second); - } - CompleteUnionType union_type_SimpleUnion = TypeObjectUtils::build_complete_union_type(union_flags_SimpleUnion, header_SimpleUnion, discriminator_SimpleUnion, - member_seq_SimpleUnion); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_union_type_object(union_type_SimpleUnion, type_name_SimpleUnion.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "SimpleUnion already registered in TypeObjectRegistry for a different type."); - } - return_code_SimpleUnion = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "SimpleUnion", type_ids_SimpleUnion); - if (return_code_SimpleUnion != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "SimpleUnion: Given Union TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - } - UnionMemberFlag member_flags_second = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false); - UnionCaseLabelSeq label_seq_second; - TypeObjectUtils::add_union_case_label(label_seq_second, static_cast(1)); - CommonUnionMember common_second; - MemberId member_id_second = 0x00000002; - if (EK_COMPLETE == type_ids_UnionUnion.type_identifier1()._d() || TK_NONE == type_ids_UnionUnion.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_UnionUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_UnionUnion.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_UnionUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_UnionUnion.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_UnionUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_UnionUnion.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_UnionUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_UnionUnion.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_UnionUnion.type_identifier1()._d() && - (EK_COMPLETE == type_ids_UnionUnion.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_UnionUnion.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_UnionUnion.type_identifier1()._d() && - (EK_COMPLETE == type_ids_UnionUnion.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_UnionUnion.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_second = TypeObjectUtils::build_common_union_member(member_id_second, member_flags_second, type_ids_UnionUnion.type_identifier1(), - label_seq_second); - } - else if (EK_COMPLETE == type_ids_UnionUnion.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_UnionUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_UnionUnion.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_UnionUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_UnionUnion.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_UnionUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_UnionUnion.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_UnionUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_UnionUnion.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_UnionUnion.type_identifier2()._d() && - (EK_COMPLETE == type_ids_UnionUnion.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_UnionUnion.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_UnionUnion.type_identifier2()._d() && - (EK_COMPLETE == type_ids_UnionUnion.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_UnionUnion.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_second = TypeObjectUtils::build_common_union_member(member_id_second, member_flags_second, type_ids_UnionUnion.type_identifier2(), - label_seq_second); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Union second member TypeIdentifier inconsistent."); - return; - } - MemberName name_second = "second"; - eprosima::fastcdr::optional member_ann_builtin_second; - ann_custom_UnionUnion.reset(); - CompleteMemberDetail detail_second = TypeObjectUtils::build_complete_member_detail(name_second, member_ann_builtin_second, ann_custom_UnionUnion); - CompleteUnionMember member_second = TypeObjectUtils::build_complete_union_member(common_second, detail_second); - TypeObjectUtils::add_complete_union_member(member_seq_UnionUnion, member_second); - } - CompleteUnionType union_type_UnionUnion = TypeObjectUtils::build_complete_union_type(union_flags_UnionUnion, header_UnionUnion, discriminator_UnionUnion, - member_seq_UnionUnion); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_union_type_object(union_type_UnionUnion, type_name_UnionUnion.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "UnionUnion already registered in TypeObjectRegistry for a different type."); - } - return_code_UnionUnion = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "UnionUnion", type_ids_UnionUnion); - if (return_code_UnionUnion != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "UnionUnion: Given Union TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } -} -void register_WCharUnion_type_identifier() -{ - { - ReturnCode_t return_code_WCharUnion; - TypeIdentifierPair type_ids_WCharUnion; - UnionTypeFlag union_flags_WCharUnion = TypeObjectUtils::build_union_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - QualifiedTypeName type_name_WCharUnion = "WCharUnion"; - eprosima::fastcdr::optional type_ann_builtin_WCharUnion; - eprosima::fastcdr::optional ann_custom_WCharUnion; - CompleteTypeDetail detail_WCharUnion = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_WCharUnion, ann_custom_WCharUnion, type_name_WCharUnion.to_string()); - CompleteUnionHeader header_WCharUnion = TypeObjectUtils::build_complete_union_header(detail_WCharUnion); - UnionDiscriminatorFlag member_flags_WCharUnion = TypeObjectUtils::build_union_discriminator_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false); - return_code_WCharUnion = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_wchar_t", type_ids_WCharUnion); - - if (return_code_WCharUnion != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Union discriminator TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - CommonDiscriminatorMember common_WCharUnion; - if (EK_COMPLETE == type_ids_WCharUnion.type_identifier1()._d() || TK_NONE == type_ids_WCharUnion.type_identifier2()._d()) - { - common_WCharUnion = TypeObjectUtils::build_common_discriminator_member(member_flags_WCharUnion, type_ids_WCharUnion.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_WCharUnion.type_identifier2()._d()) - { - common_WCharUnion = TypeObjectUtils::build_common_discriminator_member(member_flags_WCharUnion, type_ids_WCharUnion.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "WCharUnion discriminator TypeIdentifier inconsistent."); - return; - } - type_ann_builtin_WCharUnion.reset(); - ann_custom_WCharUnion.reset(); - CompleteDiscriminatorMember discriminator_WCharUnion = TypeObjectUtils::build_complete_discriminator_member(common_WCharUnion, - type_ann_builtin_WCharUnion, ann_custom_WCharUnion); - CompleteUnionMemberSeq member_seq_WCharUnion; - { - return_code_WCharUnion = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_WCharUnion); - - if (return_code_WCharUnion != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "first Union member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - UnionMemberFlag member_flags_first = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false); - UnionCaseLabelSeq label_seq_first; - TypeObjectUtils::add_union_case_label(label_seq_first, static_cast('A')); - CommonUnionMember common_first; - MemberId member_id_first = 0x00000001; - if (EK_COMPLETE == type_ids_WCharUnion.type_identifier1()._d() || TK_NONE == type_ids_WCharUnion.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_WCharUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_WCharUnion.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_WCharUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_WCharUnion.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_WCharUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_WCharUnion.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_WCharUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_WCharUnion.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_WCharUnion.type_identifier1()._d() && - (EK_COMPLETE == type_ids_WCharUnion.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_WCharUnion.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_WCharUnion.type_identifier1()._d() && - (EK_COMPLETE == type_ids_WCharUnion.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_WCharUnion.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_first = TypeObjectUtils::build_common_union_member(member_id_first, member_flags_first, type_ids_WCharUnion.type_identifier1(), - label_seq_first); - } - else if (EK_COMPLETE == type_ids_WCharUnion.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_WCharUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_WCharUnion.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_WCharUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_WCharUnion.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_WCharUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_WCharUnion.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_WCharUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_WCharUnion.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_WCharUnion.type_identifier2()._d() && - (EK_COMPLETE == type_ids_WCharUnion.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_WCharUnion.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_WCharUnion.type_identifier2()._d() && - (EK_COMPLETE == type_ids_WCharUnion.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_WCharUnion.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_first = TypeObjectUtils::build_common_union_member(member_id_first, member_flags_first, type_ids_WCharUnion.type_identifier2(), - label_seq_first); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Union first member TypeIdentifier inconsistent."); - return; - } - MemberName name_first = "first"; - eprosima::fastcdr::optional member_ann_builtin_first; - ann_custom_WCharUnion.reset(); - CompleteMemberDetail detail_first = TypeObjectUtils::build_complete_member_detail(name_first, member_ann_builtin_first, ann_custom_WCharUnion); - CompleteUnionMember member_first = TypeObjectUtils::build_complete_union_member(common_first, detail_first); - TypeObjectUtils::add_complete_union_member(member_seq_WCharUnion, member_first); - } - { - return_code_WCharUnion = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int64_t", type_ids_WCharUnion); - - if (return_code_WCharUnion != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "second Union member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - UnionMemberFlag member_flags_second = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false); - UnionCaseLabelSeq label_seq_second; - TypeObjectUtils::add_union_case_label(label_seq_second, static_cast('B')); - CommonUnionMember common_second; - MemberId member_id_second = 0x00000002; - if (EK_COMPLETE == type_ids_WCharUnion.type_identifier1()._d() || TK_NONE == type_ids_WCharUnion.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_WCharUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_WCharUnion.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_WCharUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_WCharUnion.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_WCharUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_WCharUnion.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_WCharUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_WCharUnion.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_WCharUnion.type_identifier1()._d() && - (EK_COMPLETE == type_ids_WCharUnion.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_WCharUnion.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_WCharUnion.type_identifier1()._d() && - (EK_COMPLETE == type_ids_WCharUnion.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_WCharUnion.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_second = TypeObjectUtils::build_common_union_member(member_id_second, member_flags_second, type_ids_WCharUnion.type_identifier1(), - label_seq_second); - } - else if (EK_COMPLETE == type_ids_WCharUnion.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_WCharUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_WCharUnion.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_WCharUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_WCharUnion.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_WCharUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_WCharUnion.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_WCharUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_WCharUnion.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_WCharUnion.type_identifier2()._d() && - (EK_COMPLETE == type_ids_WCharUnion.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_WCharUnion.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_WCharUnion.type_identifier2()._d() && - (EK_COMPLETE == type_ids_WCharUnion.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_WCharUnion.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_second = TypeObjectUtils::build_common_union_member(member_id_second, member_flags_second, type_ids_WCharUnion.type_identifier2(), - label_seq_second); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Union second member TypeIdentifier inconsistent."); - return; - } - MemberName name_second = "second"; - eprosima::fastcdr::optional member_ann_builtin_second; - ann_custom_WCharUnion.reset(); - CompleteMemberDetail detail_second = TypeObjectUtils::build_complete_member_detail(name_second, member_ann_builtin_second, ann_custom_WCharUnion); - CompleteUnionMember member_second = TypeObjectUtils::build_complete_union_member(common_second, detail_second); - TypeObjectUtils::add_complete_union_member(member_seq_WCharUnion, member_second); - } - CompleteUnionType union_type_WCharUnion = TypeObjectUtils::build_complete_union_type(union_flags_WCharUnion, header_WCharUnion, discriminator_WCharUnion, - member_seq_WCharUnion); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_union_type_object(union_type_WCharUnion, type_name_WCharUnion.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "WCharUnion already registered in TypeObjectRegistry for a different type."); - } - return_code_WCharUnion = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "WCharUnion", type_ids_WCharUnion); - if (return_code_WCharUnion != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "WCharUnion: Given Union TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } -} -void register_SimpleUnionStruct_type_identifier() -{ - { - StructTypeFlag struct_flags_SimpleUnionStruct = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_SimpleUnionStruct; - TypeIdentifierPair type_ids_SimpleUnionStruct; - QualifiedTypeName type_name_SimpleUnionStruct = "SimpleUnionStruct"; - eprosima::fastcdr::optional type_ann_builtin_SimpleUnionStruct; - eprosima::fastcdr::optional ann_custom_SimpleUnionStruct; - CompleteTypeDetail detail_SimpleUnionStruct = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_SimpleUnionStruct, ann_custom_SimpleUnionStruct, type_name_SimpleUnionStruct.to_string()); - CompleteStructHeader header_SimpleUnionStruct; - header_SimpleUnionStruct = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_SimpleUnionStruct); - CompleteStructMemberSeq member_seq_SimpleUnionStruct; - { - return_code_SimpleUnionStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "SimpleUnion", type_ids_SimpleUnionStruct); - - if (return_code_SimpleUnionStruct != eprosima::fastdds::dds::RETCODE_OK) - { - { - ReturnCode_t return_code_SimpleUnion; - TypeIdentifierPair type_ids_SimpleUnion; - UnionTypeFlag union_flags_SimpleUnion = TypeObjectUtils::build_union_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - QualifiedTypeName type_name_SimpleUnion = "SimpleUnion"; - eprosima::fastcdr::optional type_ann_builtin_SimpleUnion; - eprosima::fastcdr::optional ann_custom_SimpleUnion; - CompleteTypeDetail detail_SimpleUnion = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_SimpleUnion, ann_custom_SimpleUnion, type_name_SimpleUnion.to_string()); - CompleteUnionHeader header_SimpleUnion = TypeObjectUtils::build_complete_union_header(detail_SimpleUnion); - UnionDiscriminatorFlag member_flags_SimpleUnion = TypeObjectUtils::build_union_discriminator_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false); - return_code_SimpleUnion = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_SimpleUnion); - - if (return_code_SimpleUnion != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Union discriminator TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - CommonDiscriminatorMember common_SimpleUnion; - if (EK_COMPLETE == type_ids_SimpleUnion.type_identifier1()._d() || TK_NONE == type_ids_SimpleUnion.type_identifier2()._d()) - { - common_SimpleUnion = TypeObjectUtils::build_common_discriminator_member(member_flags_SimpleUnion, type_ids_SimpleUnion.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_SimpleUnion.type_identifier2()._d()) - { - common_SimpleUnion = TypeObjectUtils::build_common_discriminator_member(member_flags_SimpleUnion, type_ids_SimpleUnion.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "SimpleUnion discriminator TypeIdentifier inconsistent."); - return; - } - type_ann_builtin_SimpleUnion.reset(); - ann_custom_SimpleUnion.reset(); - CompleteDiscriminatorMember discriminator_SimpleUnion = TypeObjectUtils::build_complete_discriminator_member(common_SimpleUnion, - type_ann_builtin_SimpleUnion, ann_custom_SimpleUnion); - CompleteUnionMemberSeq member_seq_SimpleUnion; - { - return_code_SimpleUnion = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_SimpleUnion); - - if (return_code_SimpleUnion != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "first Union member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - UnionMemberFlag member_flags_first = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false); - UnionCaseLabelSeq label_seq_first; - TypeObjectUtils::add_union_case_label(label_seq_first, static_cast(0)); - CommonUnionMember common_first; - MemberId member_id_first = 0x00000001; - if (EK_COMPLETE == type_ids_SimpleUnion.type_identifier1()._d() || TK_NONE == type_ids_SimpleUnion.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SimpleUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SimpleUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SimpleUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SimpleUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SimpleUnion.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SimpleUnion.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_first = TypeObjectUtils::build_common_union_member(member_id_first, member_flags_first, type_ids_SimpleUnion.type_identifier1(), - label_seq_first); - } - else if (EK_COMPLETE == type_ids_SimpleUnion.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SimpleUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SimpleUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SimpleUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SimpleUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SimpleUnion.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SimpleUnion.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_first = TypeObjectUtils::build_common_union_member(member_id_first, member_flags_first, type_ids_SimpleUnion.type_identifier2(), - label_seq_first); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Union first member TypeIdentifier inconsistent."); - return; - } - MemberName name_first = "first"; - eprosima::fastcdr::optional member_ann_builtin_first; - ann_custom_SimpleUnion.reset(); - CompleteMemberDetail detail_first = TypeObjectUtils::build_complete_member_detail(name_first, member_ann_builtin_first, ann_custom_SimpleUnion); - CompleteUnionMember member_first = TypeObjectUtils::build_complete_union_member(common_first, detail_first); - TypeObjectUtils::add_complete_union_member(member_seq_SimpleUnion, member_first); - } - { - return_code_SimpleUnion = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int64_t", type_ids_SimpleUnion); - - if (return_code_SimpleUnion != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "second Union member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - UnionMemberFlag member_flags_second = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false); - UnionCaseLabelSeq label_seq_second; - TypeObjectUtils::add_union_case_label(label_seq_second, static_cast(1)); - CommonUnionMember common_second; - MemberId member_id_second = 0x00000002; - if (EK_COMPLETE == type_ids_SimpleUnion.type_identifier1()._d() || TK_NONE == type_ids_SimpleUnion.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SimpleUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SimpleUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SimpleUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SimpleUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SimpleUnion.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SimpleUnion.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_second = TypeObjectUtils::build_common_union_member(member_id_second, member_flags_second, type_ids_SimpleUnion.type_identifier1(), - label_seq_second); - } - else if (EK_COMPLETE == type_ids_SimpleUnion.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SimpleUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SimpleUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SimpleUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SimpleUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SimpleUnion.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SimpleUnion.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_second = TypeObjectUtils::build_common_union_member(member_id_second, member_flags_second, type_ids_SimpleUnion.type_identifier2(), - label_seq_second); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Union second member TypeIdentifier inconsistent."); - return; - } - MemberName name_second = "second"; - eprosima::fastcdr::optional member_ann_builtin_second; - ann_custom_SimpleUnion.reset(); - CompleteMemberDetail detail_second = TypeObjectUtils::build_complete_member_detail(name_second, member_ann_builtin_second, ann_custom_SimpleUnion); - CompleteUnionMember member_second = TypeObjectUtils::build_complete_union_member(common_second, detail_second); - TypeObjectUtils::add_complete_union_member(member_seq_SimpleUnion, member_second); - } - CompleteUnionType union_type_SimpleUnion = TypeObjectUtils::build_complete_union_type(union_flags_SimpleUnion, header_SimpleUnion, discriminator_SimpleUnion, - member_seq_SimpleUnion); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_union_type_object(union_type_SimpleUnion, type_name_SimpleUnion.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "SimpleUnion already registered in TypeObjectRegistry for a different type."); - } - return_code_SimpleUnion = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "SimpleUnion", type_ids_SimpleUnion); - if (return_code_SimpleUnion != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "SimpleUnion: Given Union TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - } - StructMemberFlag member_flags_my_union = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_union; - MemberId member_id_my_union = 0x00000000; - if (EK_COMPLETE == type_ids_SimpleUnionStruct.type_identifier1()._d() || TK_NONE == type_ids_SimpleUnionStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SimpleUnionStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleUnionStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SimpleUnionStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleUnionStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SimpleUnionStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleUnionStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SimpleUnionStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleUnionStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SimpleUnionStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SimpleUnionStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleUnionStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SimpleUnionStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SimpleUnionStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleUnionStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_union = TypeObjectUtils::build_common_struct_member(member_id_my_union, member_flags_my_union, type_ids_SimpleUnionStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_SimpleUnionStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SimpleUnionStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleUnionStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SimpleUnionStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleUnionStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SimpleUnionStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleUnionStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SimpleUnionStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleUnionStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SimpleUnionStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SimpleUnionStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleUnionStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SimpleUnionStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SimpleUnionStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleUnionStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_union = TypeObjectUtils::build_common_struct_member(member_id_my_union, member_flags_my_union, type_ids_SimpleUnionStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_union member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_union = "my_union"; - eprosima::fastcdr::optional member_ann_builtin_my_union; - ann_custom_SimpleUnionStruct.reset(); - CompleteMemberDetail detail_my_union = TypeObjectUtils::build_complete_member_detail(name_my_union, member_ann_builtin_my_union, ann_custom_SimpleUnionStruct); - CompleteStructMember member_my_union = TypeObjectUtils::build_complete_struct_member(common_my_union, detail_my_union); - TypeObjectUtils::add_complete_struct_member(member_seq_SimpleUnionStruct, member_my_union); - } - CompleteStructType struct_type_SimpleUnionStruct = TypeObjectUtils::build_complete_struct_type(struct_flags_SimpleUnionStruct, header_SimpleUnionStruct, member_seq_SimpleUnionStruct); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_SimpleUnionStruct, type_name_SimpleUnionStruct.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "SimpleUnionStruct already registered in TypeObjectRegistry for a different type."); - } - return_code_SimpleUnionStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "SimpleUnionStruct", type_ids_SimpleUnionStruct); - if (return_code_SimpleUnionStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "SimpleUnionStruct: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } -} -void register_UnionUnionUnionStruct_type_identifier() -{ - { - StructTypeFlag struct_flags_UnionUnionUnionStruct = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_UnionUnionUnionStruct; - TypeIdentifierPair type_ids_UnionUnionUnionStruct; - QualifiedTypeName type_name_UnionUnionUnionStruct = "UnionUnionUnionStruct"; - eprosima::fastcdr::optional type_ann_builtin_UnionUnionUnionStruct; - eprosima::fastcdr::optional ann_custom_UnionUnionUnionStruct; - CompleteTypeDetail detail_UnionUnionUnionStruct = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_UnionUnionUnionStruct, ann_custom_UnionUnionUnionStruct, type_name_UnionUnionUnionStruct.to_string()); - CompleteStructHeader header_UnionUnionUnionStruct; - header_UnionUnionUnionStruct = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_UnionUnionUnionStruct); - CompleteStructMemberSeq member_seq_UnionUnionUnionStruct; - { - return_code_UnionUnionUnionStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "UnionUnion", type_ids_UnionUnionUnionStruct); - - if (return_code_UnionUnionUnionStruct != eprosima::fastdds::dds::RETCODE_OK) - { - { - ReturnCode_t return_code_UnionUnion; - TypeIdentifierPair type_ids_UnionUnion; - UnionTypeFlag union_flags_UnionUnion = TypeObjectUtils::build_union_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - QualifiedTypeName type_name_UnionUnion = "UnionUnion"; - eprosima::fastcdr::optional type_ann_builtin_UnionUnion; - eprosima::fastcdr::optional ann_custom_UnionUnion; - CompleteTypeDetail detail_UnionUnion = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_UnionUnion, ann_custom_UnionUnion, type_name_UnionUnion.to_string()); - CompleteUnionHeader header_UnionUnion = TypeObjectUtils::build_complete_union_header(detail_UnionUnion); - UnionDiscriminatorFlag member_flags_UnionUnion = TypeObjectUtils::build_union_discriminator_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false); - return_code_UnionUnion = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_UnionUnion); - - if (return_code_UnionUnion != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Union discriminator TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - CommonDiscriminatorMember common_UnionUnion; - if (EK_COMPLETE == type_ids_UnionUnion.type_identifier1()._d() || TK_NONE == type_ids_UnionUnion.type_identifier2()._d()) - { - common_UnionUnion = TypeObjectUtils::build_common_discriminator_member(member_flags_UnionUnion, type_ids_UnionUnion.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_UnionUnion.type_identifier2()._d()) - { - common_UnionUnion = TypeObjectUtils::build_common_discriminator_member(member_flags_UnionUnion, type_ids_UnionUnion.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "UnionUnion discriminator TypeIdentifier inconsistent."); - return; - } - type_ann_builtin_UnionUnion.reset(); - ann_custom_UnionUnion.reset(); - CompleteDiscriminatorMember discriminator_UnionUnion = TypeObjectUtils::build_complete_discriminator_member(common_UnionUnion, - type_ann_builtin_UnionUnion, ann_custom_UnionUnion); - CompleteUnionMemberSeq member_seq_UnionUnion; - { - return_code_UnionUnion = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_UnionUnion); - - if (return_code_UnionUnion != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "first Union member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - UnionMemberFlag member_flags_first = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false); - UnionCaseLabelSeq label_seq_first; - TypeObjectUtils::add_union_case_label(label_seq_first, static_cast(0)); - CommonUnionMember common_first; - MemberId member_id_first = 0x00000001; - if (EK_COMPLETE == type_ids_UnionUnion.type_identifier1()._d() || TK_NONE == type_ids_UnionUnion.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_UnionUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_UnionUnion.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_UnionUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_UnionUnion.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_UnionUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_UnionUnion.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_UnionUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_UnionUnion.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_UnionUnion.type_identifier1()._d() && - (EK_COMPLETE == type_ids_UnionUnion.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_UnionUnion.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_UnionUnion.type_identifier1()._d() && - (EK_COMPLETE == type_ids_UnionUnion.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_UnionUnion.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_first = TypeObjectUtils::build_common_union_member(member_id_first, member_flags_first, type_ids_UnionUnion.type_identifier1(), - label_seq_first); - } - else if (EK_COMPLETE == type_ids_UnionUnion.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_UnionUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_UnionUnion.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_UnionUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_UnionUnion.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_UnionUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_UnionUnion.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_UnionUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_UnionUnion.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_UnionUnion.type_identifier2()._d() && - (EK_COMPLETE == type_ids_UnionUnion.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_UnionUnion.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_UnionUnion.type_identifier2()._d() && - (EK_COMPLETE == type_ids_UnionUnion.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_UnionUnion.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_first = TypeObjectUtils::build_common_union_member(member_id_first, member_flags_first, type_ids_UnionUnion.type_identifier2(), - label_seq_first); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Union first member TypeIdentifier inconsistent."); - return; - } - MemberName name_first = "first"; - eprosima::fastcdr::optional member_ann_builtin_first; - ann_custom_UnionUnion.reset(); - CompleteMemberDetail detail_first = TypeObjectUtils::build_complete_member_detail(name_first, member_ann_builtin_first, ann_custom_UnionUnion); - CompleteUnionMember member_first = TypeObjectUtils::build_complete_union_member(common_first, detail_first); - TypeObjectUtils::add_complete_union_member(member_seq_UnionUnion, member_first); - } - { - return_code_UnionUnion = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "SimpleUnion", type_ids_UnionUnion); - - if (return_code_UnionUnion != eprosima::fastdds::dds::RETCODE_OK) - { - { - ReturnCode_t return_code_SimpleUnion; - TypeIdentifierPair type_ids_SimpleUnion; - UnionTypeFlag union_flags_SimpleUnion = TypeObjectUtils::build_union_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - QualifiedTypeName type_name_SimpleUnion = "SimpleUnion"; - eprosima::fastcdr::optional type_ann_builtin_SimpleUnion; - eprosima::fastcdr::optional ann_custom_SimpleUnion; - CompleteTypeDetail detail_SimpleUnion = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_SimpleUnion, ann_custom_SimpleUnion, type_name_SimpleUnion.to_string()); - CompleteUnionHeader header_SimpleUnion = TypeObjectUtils::build_complete_union_header(detail_SimpleUnion); - UnionDiscriminatorFlag member_flags_SimpleUnion = TypeObjectUtils::build_union_discriminator_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false); - return_code_SimpleUnion = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_SimpleUnion); - - if (return_code_SimpleUnion != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Union discriminator TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - CommonDiscriminatorMember common_SimpleUnion; - if (EK_COMPLETE == type_ids_SimpleUnion.type_identifier1()._d() || TK_NONE == type_ids_SimpleUnion.type_identifier2()._d()) - { - common_SimpleUnion = TypeObjectUtils::build_common_discriminator_member(member_flags_SimpleUnion, type_ids_SimpleUnion.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_SimpleUnion.type_identifier2()._d()) - { - common_SimpleUnion = TypeObjectUtils::build_common_discriminator_member(member_flags_SimpleUnion, type_ids_SimpleUnion.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "SimpleUnion discriminator TypeIdentifier inconsistent."); - return; - } - type_ann_builtin_SimpleUnion.reset(); - ann_custom_SimpleUnion.reset(); - CompleteDiscriminatorMember discriminator_SimpleUnion = TypeObjectUtils::build_complete_discriminator_member(common_SimpleUnion, - type_ann_builtin_SimpleUnion, ann_custom_SimpleUnion); - CompleteUnionMemberSeq member_seq_SimpleUnion; - { - return_code_SimpleUnion = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_SimpleUnion); - - if (return_code_SimpleUnion != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "first Union member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - UnionMemberFlag member_flags_first = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false); - UnionCaseLabelSeq label_seq_first; - TypeObjectUtils::add_union_case_label(label_seq_first, static_cast(0)); - CommonUnionMember common_first; - MemberId member_id_first = 0x00000001; - if (EK_COMPLETE == type_ids_SimpleUnion.type_identifier1()._d() || TK_NONE == type_ids_SimpleUnion.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SimpleUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SimpleUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SimpleUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SimpleUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SimpleUnion.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SimpleUnion.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_first = TypeObjectUtils::build_common_union_member(member_id_first, member_flags_first, type_ids_SimpleUnion.type_identifier1(), - label_seq_first); - } - else if (EK_COMPLETE == type_ids_SimpleUnion.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SimpleUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SimpleUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SimpleUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SimpleUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SimpleUnion.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SimpleUnion.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_first = TypeObjectUtils::build_common_union_member(member_id_first, member_flags_first, type_ids_SimpleUnion.type_identifier2(), - label_seq_first); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Union first member TypeIdentifier inconsistent."); - return; - } - MemberName name_first = "first"; - eprosima::fastcdr::optional member_ann_builtin_first; - ann_custom_SimpleUnion.reset(); - CompleteMemberDetail detail_first = TypeObjectUtils::build_complete_member_detail(name_first, member_ann_builtin_first, ann_custom_SimpleUnion); - CompleteUnionMember member_first = TypeObjectUtils::build_complete_union_member(common_first, detail_first); - TypeObjectUtils::add_complete_union_member(member_seq_SimpleUnion, member_first); - } - { - return_code_SimpleUnion = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int64_t", type_ids_SimpleUnion); - - if (return_code_SimpleUnion != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "second Union member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - UnionMemberFlag member_flags_second = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false); - UnionCaseLabelSeq label_seq_second; - TypeObjectUtils::add_union_case_label(label_seq_second, static_cast(1)); - CommonUnionMember common_second; - MemberId member_id_second = 0x00000002; - if (EK_COMPLETE == type_ids_SimpleUnion.type_identifier1()._d() || TK_NONE == type_ids_SimpleUnion.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SimpleUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SimpleUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SimpleUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SimpleUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SimpleUnion.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SimpleUnion.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_second = TypeObjectUtils::build_common_union_member(member_id_second, member_flags_second, type_ids_SimpleUnion.type_identifier1(), - label_seq_second); - } - else if (EK_COMPLETE == type_ids_SimpleUnion.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SimpleUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SimpleUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SimpleUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SimpleUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SimpleUnion.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SimpleUnion.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_second = TypeObjectUtils::build_common_union_member(member_id_second, member_flags_second, type_ids_SimpleUnion.type_identifier2(), - label_seq_second); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Union second member TypeIdentifier inconsistent."); - return; - } - MemberName name_second = "second"; - eprosima::fastcdr::optional member_ann_builtin_second; - ann_custom_SimpleUnion.reset(); - CompleteMemberDetail detail_second = TypeObjectUtils::build_complete_member_detail(name_second, member_ann_builtin_second, ann_custom_SimpleUnion); - CompleteUnionMember member_second = TypeObjectUtils::build_complete_union_member(common_second, detail_second); - TypeObjectUtils::add_complete_union_member(member_seq_SimpleUnion, member_second); - } - CompleteUnionType union_type_SimpleUnion = TypeObjectUtils::build_complete_union_type(union_flags_SimpleUnion, header_SimpleUnion, discriminator_SimpleUnion, - member_seq_SimpleUnion); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_union_type_object(union_type_SimpleUnion, type_name_SimpleUnion.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "SimpleUnion already registered in TypeObjectRegistry for a different type."); - } - return_code_SimpleUnion = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "SimpleUnion", type_ids_SimpleUnion); - if (return_code_SimpleUnion != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "SimpleUnion: Given Union TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - } - UnionMemberFlag member_flags_second = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false); - UnionCaseLabelSeq label_seq_second; - TypeObjectUtils::add_union_case_label(label_seq_second, static_cast(1)); - CommonUnionMember common_second; - MemberId member_id_second = 0x00000002; - if (EK_COMPLETE == type_ids_UnionUnion.type_identifier1()._d() || TK_NONE == type_ids_UnionUnion.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_UnionUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_UnionUnion.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_UnionUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_UnionUnion.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_UnionUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_UnionUnion.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_UnionUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_UnionUnion.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_UnionUnion.type_identifier1()._d() && - (EK_COMPLETE == type_ids_UnionUnion.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_UnionUnion.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_UnionUnion.type_identifier1()._d() && - (EK_COMPLETE == type_ids_UnionUnion.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_UnionUnion.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_second = TypeObjectUtils::build_common_union_member(member_id_second, member_flags_second, type_ids_UnionUnion.type_identifier1(), - label_seq_second); - } - else if (EK_COMPLETE == type_ids_UnionUnion.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_UnionUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_UnionUnion.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_UnionUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_UnionUnion.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_UnionUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_UnionUnion.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_UnionUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_UnionUnion.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_UnionUnion.type_identifier2()._d() && - (EK_COMPLETE == type_ids_UnionUnion.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_UnionUnion.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_UnionUnion.type_identifier2()._d() && - (EK_COMPLETE == type_ids_UnionUnion.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_UnionUnion.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_second = TypeObjectUtils::build_common_union_member(member_id_second, member_flags_second, type_ids_UnionUnion.type_identifier2(), - label_seq_second); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Union second member TypeIdentifier inconsistent."); - return; - } - MemberName name_second = "second"; - eprosima::fastcdr::optional member_ann_builtin_second; - ann_custom_UnionUnion.reset(); - CompleteMemberDetail detail_second = TypeObjectUtils::build_complete_member_detail(name_second, member_ann_builtin_second, ann_custom_UnionUnion); - CompleteUnionMember member_second = TypeObjectUtils::build_complete_union_member(common_second, detail_second); - TypeObjectUtils::add_complete_union_member(member_seq_UnionUnion, member_second); - } - CompleteUnionType union_type_UnionUnion = TypeObjectUtils::build_complete_union_type(union_flags_UnionUnion, header_UnionUnion, discriminator_UnionUnion, - member_seq_UnionUnion); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_union_type_object(union_type_UnionUnion, type_name_UnionUnion.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "UnionUnion already registered in TypeObjectRegistry for a different type."); - } - return_code_UnionUnion = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "UnionUnion", type_ids_UnionUnion); - if (return_code_UnionUnion != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "UnionUnion: Given Union TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - } - StructMemberFlag member_flags_my_union = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_union; - MemberId member_id_my_union = 0x00000000; - if (EK_COMPLETE == type_ids_UnionUnionUnionStruct.type_identifier1()._d() || TK_NONE == type_ids_UnionUnionUnionStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_UnionUnionUnionStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_UnionUnionUnionStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_UnionUnionUnionStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_UnionUnionUnionStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_UnionUnionUnionStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_UnionUnionUnionStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_UnionUnionUnionStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_UnionUnionUnionStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_UnionUnionUnionStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_UnionUnionUnionStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_UnionUnionUnionStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_UnionUnionUnionStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_UnionUnionUnionStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_UnionUnionUnionStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_union = TypeObjectUtils::build_common_struct_member(member_id_my_union, member_flags_my_union, type_ids_UnionUnionUnionStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_UnionUnionUnionStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_UnionUnionUnionStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_UnionUnionUnionStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_UnionUnionUnionStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_UnionUnionUnionStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_UnionUnionUnionStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_UnionUnionUnionStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_UnionUnionUnionStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_UnionUnionUnionStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_UnionUnionUnionStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_UnionUnionUnionStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_UnionUnionUnionStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_UnionUnionUnionStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_UnionUnionUnionStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_UnionUnionUnionStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_union = TypeObjectUtils::build_common_struct_member(member_id_my_union, member_flags_my_union, type_ids_UnionUnionUnionStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_union member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_union = "my_union"; - eprosima::fastcdr::optional member_ann_builtin_my_union; - ann_custom_UnionUnionUnionStruct.reset(); - CompleteMemberDetail detail_my_union = TypeObjectUtils::build_complete_member_detail(name_my_union, member_ann_builtin_my_union, ann_custom_UnionUnionUnionStruct); - CompleteStructMember member_my_union = TypeObjectUtils::build_complete_struct_member(common_my_union, detail_my_union); - TypeObjectUtils::add_complete_struct_member(member_seq_UnionUnionUnionStruct, member_my_union); - } - CompleteStructType struct_type_UnionUnionUnionStruct = TypeObjectUtils::build_complete_struct_type(struct_flags_UnionUnionUnionStruct, header_UnionUnionUnionStruct, member_seq_UnionUnionUnionStruct); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_UnionUnionUnionStruct, type_name_UnionUnionUnionStruct.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "UnionUnionUnionStruct already registered in TypeObjectRegistry for a different type."); - } - return_code_UnionUnionUnionStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "UnionUnionUnionStruct", type_ids_UnionUnionUnionStruct); - if (return_code_UnionUnionUnionStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "UnionUnionUnionStruct: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } -} -void register_WCharUnionStruct_type_identifier() -{ - { - StructTypeFlag struct_flags_WCharUnionStruct = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_WCharUnionStruct; - TypeIdentifierPair type_ids_WCharUnionStruct; - QualifiedTypeName type_name_WCharUnionStruct = "WCharUnionStruct"; - eprosima::fastcdr::optional type_ann_builtin_WCharUnionStruct; - eprosima::fastcdr::optional ann_custom_WCharUnionStruct; - CompleteTypeDetail detail_WCharUnionStruct = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_WCharUnionStruct, ann_custom_WCharUnionStruct, type_name_WCharUnionStruct.to_string()); - CompleteStructHeader header_WCharUnionStruct; - header_WCharUnionStruct = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_WCharUnionStruct); - CompleteStructMemberSeq member_seq_WCharUnionStruct; - { - return_code_WCharUnionStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "WCharUnion", type_ids_WCharUnionStruct); - - if (return_code_WCharUnionStruct != eprosima::fastdds::dds::RETCODE_OK) - { - { - ReturnCode_t return_code_WCharUnion; - TypeIdentifierPair type_ids_WCharUnion; - UnionTypeFlag union_flags_WCharUnion = TypeObjectUtils::build_union_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - QualifiedTypeName type_name_WCharUnion = "WCharUnion"; - eprosima::fastcdr::optional type_ann_builtin_WCharUnion; - eprosima::fastcdr::optional ann_custom_WCharUnion; - CompleteTypeDetail detail_WCharUnion = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_WCharUnion, ann_custom_WCharUnion, type_name_WCharUnion.to_string()); - CompleteUnionHeader header_WCharUnion = TypeObjectUtils::build_complete_union_header(detail_WCharUnion); - UnionDiscriminatorFlag member_flags_WCharUnion = TypeObjectUtils::build_union_discriminator_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false); - return_code_WCharUnion = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_wchar_t", type_ids_WCharUnion); - - if (return_code_WCharUnion != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Union discriminator TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - CommonDiscriminatorMember common_WCharUnion; - if (EK_COMPLETE == type_ids_WCharUnion.type_identifier1()._d() || TK_NONE == type_ids_WCharUnion.type_identifier2()._d()) - { - common_WCharUnion = TypeObjectUtils::build_common_discriminator_member(member_flags_WCharUnion, type_ids_WCharUnion.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_WCharUnion.type_identifier2()._d()) - { - common_WCharUnion = TypeObjectUtils::build_common_discriminator_member(member_flags_WCharUnion, type_ids_WCharUnion.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "WCharUnion discriminator TypeIdentifier inconsistent."); - return; - } - type_ann_builtin_WCharUnion.reset(); - ann_custom_WCharUnion.reset(); - CompleteDiscriminatorMember discriminator_WCharUnion = TypeObjectUtils::build_complete_discriminator_member(common_WCharUnion, - type_ann_builtin_WCharUnion, ann_custom_WCharUnion); - CompleteUnionMemberSeq member_seq_WCharUnion; - { - return_code_WCharUnion = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_WCharUnion); - - if (return_code_WCharUnion != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "first Union member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - UnionMemberFlag member_flags_first = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false); - UnionCaseLabelSeq label_seq_first; - TypeObjectUtils::add_union_case_label(label_seq_first, static_cast('A')); - CommonUnionMember common_first; - MemberId member_id_first = 0x00000001; - if (EK_COMPLETE == type_ids_WCharUnion.type_identifier1()._d() || TK_NONE == type_ids_WCharUnion.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_WCharUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_WCharUnion.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_WCharUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_WCharUnion.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_WCharUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_WCharUnion.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_WCharUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_WCharUnion.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_WCharUnion.type_identifier1()._d() && - (EK_COMPLETE == type_ids_WCharUnion.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_WCharUnion.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_WCharUnion.type_identifier1()._d() && - (EK_COMPLETE == type_ids_WCharUnion.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_WCharUnion.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_first = TypeObjectUtils::build_common_union_member(member_id_first, member_flags_first, type_ids_WCharUnion.type_identifier1(), - label_seq_first); - } - else if (EK_COMPLETE == type_ids_WCharUnion.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_WCharUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_WCharUnion.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_WCharUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_WCharUnion.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_WCharUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_WCharUnion.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_WCharUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_WCharUnion.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_WCharUnion.type_identifier2()._d() && - (EK_COMPLETE == type_ids_WCharUnion.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_WCharUnion.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_WCharUnion.type_identifier2()._d() && - (EK_COMPLETE == type_ids_WCharUnion.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_WCharUnion.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_first = TypeObjectUtils::build_common_union_member(member_id_first, member_flags_first, type_ids_WCharUnion.type_identifier2(), - label_seq_first); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Union first member TypeIdentifier inconsistent."); - return; - } - MemberName name_first = "first"; - eprosima::fastcdr::optional member_ann_builtin_first; - ann_custom_WCharUnion.reset(); - CompleteMemberDetail detail_first = TypeObjectUtils::build_complete_member_detail(name_first, member_ann_builtin_first, ann_custom_WCharUnion); - CompleteUnionMember member_first = TypeObjectUtils::build_complete_union_member(common_first, detail_first); - TypeObjectUtils::add_complete_union_member(member_seq_WCharUnion, member_first); - } - { - return_code_WCharUnion = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int64_t", type_ids_WCharUnion); - - if (return_code_WCharUnion != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "second Union member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - UnionMemberFlag member_flags_second = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false); - UnionCaseLabelSeq label_seq_second; - TypeObjectUtils::add_union_case_label(label_seq_second, static_cast('B')); - CommonUnionMember common_second; - MemberId member_id_second = 0x00000002; - if (EK_COMPLETE == type_ids_WCharUnion.type_identifier1()._d() || TK_NONE == type_ids_WCharUnion.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_WCharUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_WCharUnion.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_WCharUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_WCharUnion.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_WCharUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_WCharUnion.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_WCharUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_WCharUnion.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_WCharUnion.type_identifier1()._d() && - (EK_COMPLETE == type_ids_WCharUnion.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_WCharUnion.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_WCharUnion.type_identifier1()._d() && - (EK_COMPLETE == type_ids_WCharUnion.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_WCharUnion.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_second = TypeObjectUtils::build_common_union_member(member_id_second, member_flags_second, type_ids_WCharUnion.type_identifier1(), - label_seq_second); - } - else if (EK_COMPLETE == type_ids_WCharUnion.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_WCharUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_WCharUnion.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_WCharUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_WCharUnion.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_WCharUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_WCharUnion.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_WCharUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_WCharUnion.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_WCharUnion.type_identifier2()._d() && - (EK_COMPLETE == type_ids_WCharUnion.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_WCharUnion.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_WCharUnion.type_identifier2()._d() && - (EK_COMPLETE == type_ids_WCharUnion.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_WCharUnion.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_second = TypeObjectUtils::build_common_union_member(member_id_second, member_flags_second, type_ids_WCharUnion.type_identifier2(), - label_seq_second); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Union second member TypeIdentifier inconsistent."); - return; - } - MemberName name_second = "second"; - eprosima::fastcdr::optional member_ann_builtin_second; - ann_custom_WCharUnion.reset(); - CompleteMemberDetail detail_second = TypeObjectUtils::build_complete_member_detail(name_second, member_ann_builtin_second, ann_custom_WCharUnion); - CompleteUnionMember member_second = TypeObjectUtils::build_complete_union_member(common_second, detail_second); - TypeObjectUtils::add_complete_union_member(member_seq_WCharUnion, member_second); - } - CompleteUnionType union_type_WCharUnion = TypeObjectUtils::build_complete_union_type(union_flags_WCharUnion, header_WCharUnion, discriminator_WCharUnion, - member_seq_WCharUnion); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_union_type_object(union_type_WCharUnion, type_name_WCharUnion.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "WCharUnion already registered in TypeObjectRegistry for a different type."); - } - return_code_WCharUnion = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "WCharUnion", type_ids_WCharUnion); - if (return_code_WCharUnion != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "WCharUnion: Given Union TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - } - StructMemberFlag member_flags_my_union = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_union; - MemberId member_id_my_union = 0x00000000; - if (EK_COMPLETE == type_ids_WCharUnionStruct.type_identifier1()._d() || TK_NONE == type_ids_WCharUnionStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_WCharUnionStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_WCharUnionStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_WCharUnionStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_WCharUnionStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_WCharUnionStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_WCharUnionStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_WCharUnionStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_WCharUnionStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_WCharUnionStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_WCharUnionStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_WCharUnionStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_WCharUnionStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_WCharUnionStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_WCharUnionStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_union = TypeObjectUtils::build_common_struct_member(member_id_my_union, member_flags_my_union, type_ids_WCharUnionStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_WCharUnionStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_WCharUnionStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_WCharUnionStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_WCharUnionStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_WCharUnionStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_WCharUnionStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_WCharUnionStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_WCharUnionStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_WCharUnionStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_WCharUnionStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_WCharUnionStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_WCharUnionStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_WCharUnionStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_WCharUnionStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_WCharUnionStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_union = TypeObjectUtils::build_common_struct_member(member_id_my_union, member_flags_my_union, type_ids_WCharUnionStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_union member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_union = "my_union"; - eprosima::fastcdr::optional member_ann_builtin_my_union; - ann_custom_WCharUnionStruct.reset(); - CompleteMemberDetail detail_my_union = TypeObjectUtils::build_complete_member_detail(name_my_union, member_ann_builtin_my_union, ann_custom_WCharUnionStruct); - CompleteStructMember member_my_union = TypeObjectUtils::build_complete_struct_member(common_my_union, detail_my_union); - TypeObjectUtils::add_complete_struct_member(member_seq_WCharUnionStruct, member_my_union); - } - CompleteStructType struct_type_WCharUnionStruct = TypeObjectUtils::build_complete_struct_type(struct_flags_WCharUnionStruct, header_WCharUnionStruct, member_seq_WCharUnionStruct); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_WCharUnionStruct, type_name_WCharUnionStruct.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "WCharUnionStruct already registered in TypeObjectRegistry for a different type."); - } - return_code_WCharUnionStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "WCharUnionStruct", type_ids_WCharUnionStruct); - if (return_code_WCharUnionStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "WCharUnionStruct: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } -} - diff --git a/test/unittest/dynamic_types/idl/BasicTypeObjectSupport.hpp b/test/unittest/dynamic_types/idl/BasicTypeObjectSupport.hpp deleted file mode 100644 index c6cc55faa93..00000000000 --- a/test/unittest/dynamic_types/idl/BasicTypeObjectSupport.hpp +++ /dev/null @@ -1,292 +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 BasicTypeObjectSupport.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_BASIC_TYPE_OBJECT_SUPPORT_HPP_ -#define _FAST_DDS_GENERATED_BASIC_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_Basic_type_objects(); - -#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC - -/** - * @brief Register EnumStruct 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_EnumStruct_type_identifier(); -/** - * @brief Register AliasStruct 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_AliasStruct_type_identifier(); -/** - * @brief Register AliasAliasStruct 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_AliasAliasStruct_type_identifier(); -/** - * @brief Register BoolStruct 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_BoolStruct_type_identifier(); -/** - * @brief Register OctetStruct 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_OctetStruct_type_identifier(); -/** - * @brief Register ShortStruct 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_ShortStruct_type_identifier(); -/** - * @brief Register LongStruct 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_LongStruct_type_identifier(); -/** - * @brief Register LongLongStruct 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_LongLongStruct_type_identifier(); -/** - * @brief Register UShortStruct 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_UShortStruct_type_identifier(); -/** - * @brief Register ULongStruct 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_ULongStruct_type_identifier(); -/** - * @brief Register ULongLongStruct 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_ULongLongStruct_type_identifier(); -/** - * @brief Register FloatStruct 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_FloatStruct_type_identifier(); -/** - * @brief Register DoubleStruct 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_DoubleStruct_type_identifier(); -/** - * @brief Register LongDoubleStruct 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_LongDoubleStruct_type_identifier(); -/** - * @brief Register CharStruct 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_CharStruct_type_identifier(); -/** - * @brief Register WCharStruct 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_WCharStruct_type_identifier(); -/** - * @brief Register StringStruct 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_StringStruct_type_identifier(); -/** - * @brief Register WStringStruct 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_WStringStruct_type_identifier(); -/** - * @brief Register LargeStringStruct 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_LargeStringStruct_type_identifier(); -/** - * @brief Register LargeWStringStruct 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_LargeWStringStruct_type_identifier(); -/** - * @brief Register ArraytStruct 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_ArraytStruct_type_identifier(); -/** - * @brief Register ArrayArrayStruct 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_ArrayArrayStruct_type_identifier(); -/** - * @brief Register SequenceStruct 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_SequenceStruct_type_identifier(); -/** - * @brief Register SequenceSequenceStruct 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_SequenceSequenceStruct_type_identifier(); -/** - * @brief Register MapStruct 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_MapStruct_type_identifier(); -/** - * @brief Register MapMapStruct 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_MapMapStruct_type_identifier(); -/** - * @brief Register BitsetStruct 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_BitsetStruct_type_identifier(); -/** - * @brief Register StructStruct 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_StructStruct_type_identifier(); -/** - * @brief Register StructStructStruct 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_StructStructStruct_type_identifier(); -/** - * @brief Register SimpleUnion 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_SimpleUnion_type_identifier(); -/** - * @brief Register UnionUnion 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_UnionUnion_type_identifier(); -/** - * @brief Register WCharUnion 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_WCharUnion_type_identifier(); -/** - * @brief Register SimpleUnionStruct 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_SimpleUnionStruct_type_identifier(); -/** - * @brief Register UnionUnionUnionStruct 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_UnionUnionUnionStruct_type_identifier(); -/** - * @brief Register WCharUnionStruct 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_WCharUnionStruct_type_identifier(); - - -#endif // DOXYGEN_SHOULD_SKIP_THIS_PUBLIC - -#endif // _FAST_DDS_GENERATED_BASIC_TYPE_OBJECT_SUPPORT_HPP_ diff --git a/test/unittest/dynamic_types/idl/Test.hpp b/test/unittest/dynamic_types/idl/Test.hpp deleted file mode 100644 index 104d57c6fac..00000000000 --- a/test/unittest/dynamic_types/idl/Test.hpp +++ /dev/null @@ -1,2904 +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 Test.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_TEST_HPP_ -#define _FAST_DDS_GENERATED_TEST_HPP_ - -#include -#include -#include -#include -#include -#include - -#include -#include - - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(TEST_SOURCE) -#define TEST_DllAPI __declspec( dllexport ) -#else -#define TEST_DllAPI __declspec( dllimport ) -#endif // TEST_SOURCE -#else -#define TEST_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define TEST_DllAPI -#endif // _WIN32 - -/*! - * @brief This class represents the enumeration MyEnum defined by the user in the IDL file. - * @ingroup Test - */ -enum class MyEnum : uint32_t -{ - A, - B, - C -}; -typedef MyEnum MyAliasEnum; - -typedef MyAliasEnum MyAliasEnum2; - -typedef MyAliasEnum2 MyAliasEnum3; - -/*! - * @brief This class represents the structure BasicStruct defined by the user in the IDL file. - * @ingroup Test - */ -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) - { - m_my_bool = x.m_my_bool; - - m_my_octet = x.m_my_octet; - - m_my_int16 = x.m_my_int16; - - m_my_int32 = x.m_my_int32; - - m_my_int64 = x.m_my_int64; - - m_my_uint16 = x.m_my_uint16; - - m_my_uint32 = x.m_my_uint32; - - m_my_uint64 = x.m_my_uint64; - - m_my_float32 = x.m_my_float32; - - m_my_float64 = x.m_my_float64; - - m_my_float128 = x.m_my_float128; - - m_my_char = x.m_my_char; - - m_my_string = x.m_my_string; - - } - - /*! - * @brief Move constructor. - * @param x Reference to the object BasicStruct that will be copied. - */ - eProsima_user_DllExport BasicStruct( - BasicStruct&& x) noexcept - { - m_my_bool = x.m_my_bool; - m_my_octet = x.m_my_octet; - m_my_int16 = x.m_my_int16; - m_my_int32 = x.m_my_int32; - m_my_int64 = x.m_my_int64; - m_my_uint16 = x.m_my_uint16; - m_my_uint32 = x.m_my_uint32; - m_my_uint64 = x.m_my_uint64; - m_my_float32 = x.m_my_float32; - m_my_float64 = x.m_my_float64; - m_my_float128 = x.m_my_float128; - m_my_char = x.m_my_char; - m_my_string = std::move(x.m_my_string); - } - - /*! - * @brief Copy assignment. - * @param x Reference to the object BasicStruct that will be copied. - */ - eProsima_user_DllExport BasicStruct& operator =( - const BasicStruct& x) - { - - m_my_bool = x.m_my_bool; - - m_my_octet = x.m_my_octet; - - m_my_int16 = x.m_my_int16; - - m_my_int32 = x.m_my_int32; - - m_my_int64 = x.m_my_int64; - - m_my_uint16 = x.m_my_uint16; - - m_my_uint32 = x.m_my_uint32; - - m_my_uint64 = x.m_my_uint64; - - m_my_float32 = x.m_my_float32; - - m_my_float64 = x.m_my_float64; - - m_my_float128 = x.m_my_float128; - - m_my_char = x.m_my_char; - - m_my_string = x.m_my_string; - - return *this; - } - - /*! - * @brief Move assignment. - * @param x Reference to the object BasicStruct that will be copied. - */ - eProsima_user_DllExport BasicStruct& operator =( - BasicStruct&& x) noexcept - { - - m_my_bool = x.m_my_bool; - m_my_octet = x.m_my_octet; - m_my_int16 = x.m_my_int16; - m_my_int32 = x.m_my_int32; - m_my_int64 = x.m_my_int64; - m_my_uint16 = x.m_my_uint16; - m_my_uint32 = x.m_my_uint32; - m_my_uint64 = x.m_my_uint64; - m_my_float32 = x.m_my_float32; - m_my_float64 = x.m_my_float64; - m_my_float128 = x.m_my_float128; - m_my_char = x.m_my_char; - m_my_string = std::move(x.m_my_string); - return *this; - } - - /*! - * @brief Comparison operator. - * @param x BasicStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const BasicStruct& x) const - { - return (m_my_bool == x.m_my_bool && - m_my_octet == x.m_my_octet && - m_my_int16 == x.m_my_int16 && - m_my_int32 == x.m_my_int32 && - m_my_int64 == x.m_my_int64 && - m_my_uint16 == x.m_my_uint16 && - m_my_uint32 == x.m_my_uint32 && - m_my_uint64 == x.m_my_uint64 && - m_my_float32 == x.m_my_float32 && - m_my_float64 == x.m_my_float64 && - m_my_float128 == x.m_my_float128 && - m_my_char == x.m_my_char && - m_my_string == x.m_my_string); - } - - /*! - * @brief Comparison operator. - * @param x BasicStruct object to compare. - */ - eProsima_user_DllExport bool 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport bool my_bool() const - { - return m_my_bool; - } - - /*! - * @brief This function returns a reference to member my_bool - * @return Reference to member my_bool - */ - eProsima_user_DllExport bool& my_bool() - { - return m_my_bool; - } - - - /*! - * @brief This function sets a value in member my_octet - * @param _my_octet New value for member my_octet - */ - eProsima_user_DllExport void my_octet( - uint8_t _my_octet) - { - m_my_octet = _my_octet; - } - - /*! - * @brief This function returns the value of member my_octet - * @return Value of member my_octet - */ - eProsima_user_DllExport uint8_t my_octet() const - { - return m_my_octet; - } - - /*! - * @brief This function returns a reference to member my_octet - * @return Reference to member my_octet - */ - eProsima_user_DllExport uint8_t& my_octet() - { - return m_my_octet; - } - - - /*! - * @brief This function sets a value in member my_int16 - * @param _my_int16 New value for member my_int16 - */ - eProsima_user_DllExport void my_int16( - int16_t _my_int16) - { - m_my_int16 = _my_int16; - } - - /*! - * @brief This function returns the value of member my_int16 - * @return Value of member my_int16 - */ - eProsima_user_DllExport int16_t my_int16() const - { - return m_my_int16; - } - - /*! - * @brief This function returns a reference to member my_int16 - * @return Reference to member my_int16 - */ - eProsima_user_DllExport int16_t& my_int16() - { - return m_my_int16; - } - - - /*! - * @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) - { - m_my_int32 = _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 - { - return m_my_int32; - } - - /*! - * @brief This function returns a reference to member my_int32 - * @return Reference to member my_int32 - */ - eProsima_user_DllExport int32_t& my_int32() - { - return m_my_int32; - } - - - /*! - * @brief This function sets a value in member my_int64 - * @param _my_int64 New value for member my_int64 - */ - eProsima_user_DllExport void my_int64( - int64_t _my_int64) - { - m_my_int64 = _my_int64; - } - - /*! - * @brief This function returns the value of member my_int64 - * @return Value of member my_int64 - */ - eProsima_user_DllExport int64_t my_int64() const - { - return m_my_int64; - } - - /*! - * @brief This function returns a reference to member my_int64 - * @return Reference to member my_int64 - */ - eProsima_user_DllExport int64_t& my_int64() - { - return m_my_int64; - } - - - /*! - * @brief This function sets a value in member my_uint16 - * @param _my_uint16 New value for member my_uint16 - */ - eProsima_user_DllExport void my_uint16( - uint16_t _my_uint16) - { - m_my_uint16 = _my_uint16; - } - - /*! - * @brief This function returns the value of member my_uint16 - * @return Value of member my_uint16 - */ - eProsima_user_DllExport uint16_t my_uint16() const - { - return m_my_uint16; - } - - /*! - * @brief This function returns a reference to member my_uint16 - * @return Reference to member my_uint16 - */ - eProsima_user_DllExport uint16_t& my_uint16() - { - return m_my_uint16; - } - - - /*! - * @brief This function sets a value in member my_uint32 - * @param _my_uint32 New value for member my_uint32 - */ - eProsima_user_DllExport void my_uint32( - uint32_t _my_uint32) - { - m_my_uint32 = _my_uint32; - } - - /*! - * @brief This function returns the value of member my_uint32 - * @return Value of member my_uint32 - */ - eProsima_user_DllExport uint32_t my_uint32() const - { - return m_my_uint32; - } - - /*! - * @brief This function returns a reference to member my_uint32 - * @return Reference to member my_uint32 - */ - eProsima_user_DllExport uint32_t& my_uint32() - { - return m_my_uint32; - } - - - /*! - * @brief This function sets a value in member my_uint64 - * @param _my_uint64 New value for member my_uint64 - */ - eProsima_user_DllExport void my_uint64( - uint64_t _my_uint64) - { - m_my_uint64 = _my_uint64; - } - - /*! - * @brief This function returns the value of member my_uint64 - * @return Value of member my_uint64 - */ - eProsima_user_DllExport uint64_t my_uint64() const - { - return m_my_uint64; - } - - /*! - * @brief This function returns a reference to member my_uint64 - * @return Reference to member my_uint64 - */ - eProsima_user_DllExport uint64_t& my_uint64() - { - return m_my_uint64; - } - - - /*! - * @brief This function sets a value in member my_float32 - * @param _my_float32 New value for member my_float32 - */ - eProsima_user_DllExport void my_float32( - float _my_float32) - { - m_my_float32 = _my_float32; - } - - /*! - * @brief This function returns the value of member my_float32 - * @return Value of member my_float32 - */ - eProsima_user_DllExport float my_float32() const - { - return m_my_float32; - } - - /*! - * @brief This function returns a reference to member my_float32 - * @return Reference to member my_float32 - */ - eProsima_user_DllExport float& my_float32() - { - return m_my_float32; - } - - - /*! - * @brief This function sets a value in member my_float64 - * @param _my_float64 New value for member my_float64 - */ - eProsima_user_DllExport void my_float64( - double _my_float64) - { - m_my_float64 = _my_float64; - } - - /*! - * @brief This function returns the value of member my_float64 - * @return Value of member my_float64 - */ - eProsima_user_DllExport double my_float64() const - { - return m_my_float64; - } - - /*! - * @brief This function returns a reference to member my_float64 - * @return Reference to member my_float64 - */ - eProsima_user_DllExport double& my_float64() - { - return m_my_float64; - } - - - /*! - * @brief This function sets a value in member my_float128 - * @param _my_float128 New value for member my_float128 - */ - eProsima_user_DllExport void my_float128( - long double _my_float128) - { - m_my_float128 = _my_float128; - } - - /*! - * @brief This function returns the value of member my_float128 - * @return Value of member my_float128 - */ - eProsima_user_DllExport long double my_float128() const - { - return m_my_float128; - } - - /*! - * @brief This function returns a reference to member my_float128 - * @return Reference to member my_float128 - */ - eProsima_user_DllExport long double& my_float128() - { - return m_my_float128; - } - - - /*! - * @brief This function sets a value in member my_char - * @param _my_char New value for member my_char - */ - eProsima_user_DllExport void my_char( - char _my_char) - { - m_my_char = _my_char; - } - - /*! - * @brief This function returns the value of member my_char - * @return Value of member my_char - */ - eProsima_user_DllExport char my_char() const - { - return m_my_char; - } - - /*! - * @brief This function returns a reference to member my_char - * @return Reference to member my_char - */ - eProsima_user_DllExport char& my_char() - { - return m_my_char; - } - - - /*! - * @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) - { - 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport const std::string& my_string() const - { - return m_my_string; - } - - /*! - * @brief This function returns a reference to member my_string - * @return Reference to member my_string - */ - eProsima_user_DllExport std::string& my_string() - { - return m_my_string; - } - - - -private: - - bool m_my_bool{false}; - uint8_t m_my_octet{0}; - int16_t m_my_int16{0}; - int32_t m_my_int32{0}; - int64_t m_my_int64{0}; - uint16_t m_my_uint16{0}; - uint32_t m_my_uint32{0}; - uint64_t m_my_uint64{0}; - float m_my_float32{0.0}; - double m_my_float64{0.0}; - long double m_my_float128{0.0}; - char m_my_char{0}; - std::string m_my_string; - -}; -typedef std::array MyOctetArray500; - -typedef std::array BSAlias5; - -typedef std::array MA3; - -typedef std::array MyMiniArray; - -typedef std::vector MySequenceLong; - -/*! - * @brief This class represents the structure ComplexStruct defined by the user in the IDL file. - * @ingroup Test - */ -class ComplexStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport ComplexStruct() - { - } - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~ComplexStruct() - { - } - - /*! - * @brief Copy constructor. - * @param x Reference to the object ComplexStruct that will be copied. - */ - eProsima_user_DllExport ComplexStruct( - const ComplexStruct& x) - { - m_my_octet = x.m_my_octet; - - m_my_basic_struct = x.m_my_basic_struct; - - m_my_alias_enum = x.m_my_alias_enum; - - m_my_enum = x.m_my_enum; - - m_my_sequence_octet = x.m_my_sequence_octet; - - m_my_sequence_struct = x.m_my_sequence_struct; - - m_my_array_octet = x.m_my_array_octet; - - m_my_octet_array_500 = x.m_my_octet_array_500; - - m_my_array_struct = x.m_my_array_struct; - - m_my_map_octet_short = x.m_my_map_octet_short; - - m_my_map_long_struct = x.m_my_map_long_struct; - - m_my_map_long_seq_octet = x.m_my_map_long_seq_octet; - - m_my_map_long_octet_array_500 = x.m_my_map_long_octet_array_500; - - m_my_map_long_lol_type = x.m_my_map_long_lol_type; - - m_my_small_string_8 = x.m_my_small_string_8; - - m_my_large_string_8 = x.m_my_large_string_8; - - m_my_array_string = x.m_my_array_string; - - m_multi_alias_array_42 = x.m_multi_alias_array_42; - - m_my_array_arrays = x.m_my_array_arrays; - - m_my_sequences_array = x.m_my_sequences_array; - - } - - /*! - * @brief Move constructor. - * @param x Reference to the object ComplexStruct that will be copied. - */ - eProsima_user_DllExport ComplexStruct( - ComplexStruct&& x) noexcept - { - m_my_octet = x.m_my_octet; - m_my_basic_struct = std::move(x.m_my_basic_struct); - m_my_alias_enum = x.m_my_alias_enum; - m_my_enum = x.m_my_enum; - m_my_sequence_octet = std::move(x.m_my_sequence_octet); - m_my_sequence_struct = std::move(x.m_my_sequence_struct); - m_my_array_octet = std::move(x.m_my_array_octet); - m_my_octet_array_500 = std::move(x.m_my_octet_array_500); - m_my_array_struct = std::move(x.m_my_array_struct); - m_my_map_octet_short = std::move(x.m_my_map_octet_short); - m_my_map_long_struct = std::move(x.m_my_map_long_struct); - m_my_map_long_seq_octet = std::move(x.m_my_map_long_seq_octet); - m_my_map_long_octet_array_500 = std::move(x.m_my_map_long_octet_array_500); - m_my_map_long_lol_type = std::move(x.m_my_map_long_lol_type); - m_my_small_string_8 = std::move(x.m_my_small_string_8); - m_my_large_string_8 = std::move(x.m_my_large_string_8); - m_my_array_string = std::move(x.m_my_array_string); - m_multi_alias_array_42 = std::move(x.m_multi_alias_array_42); - m_my_array_arrays = std::move(x.m_my_array_arrays); - m_my_sequences_array = std::move(x.m_my_sequences_array); - } - - /*! - * @brief Copy assignment. - * @param x Reference to the object ComplexStruct that will be copied. - */ - eProsima_user_DllExport ComplexStruct& operator =( - const ComplexStruct& x) - { - - m_my_octet = x.m_my_octet; - - m_my_basic_struct = x.m_my_basic_struct; - - m_my_alias_enum = x.m_my_alias_enum; - - m_my_enum = x.m_my_enum; - - m_my_sequence_octet = x.m_my_sequence_octet; - - m_my_sequence_struct = x.m_my_sequence_struct; - - m_my_array_octet = x.m_my_array_octet; - - m_my_octet_array_500 = x.m_my_octet_array_500; - - m_my_array_struct = x.m_my_array_struct; - - m_my_map_octet_short = x.m_my_map_octet_short; - - m_my_map_long_struct = x.m_my_map_long_struct; - - m_my_map_long_seq_octet = x.m_my_map_long_seq_octet; - - m_my_map_long_octet_array_500 = x.m_my_map_long_octet_array_500; - - m_my_map_long_lol_type = x.m_my_map_long_lol_type; - - m_my_small_string_8 = x.m_my_small_string_8; - - m_my_large_string_8 = x.m_my_large_string_8; - - m_my_array_string = x.m_my_array_string; - - m_multi_alias_array_42 = x.m_multi_alias_array_42; - - m_my_array_arrays = x.m_my_array_arrays; - - m_my_sequences_array = x.m_my_sequences_array; - - return *this; - } - - /*! - * @brief Move assignment. - * @param x Reference to the object ComplexStruct that will be copied. - */ - eProsima_user_DllExport ComplexStruct& operator =( - ComplexStruct&& x) noexcept - { - - m_my_octet = x.m_my_octet; - m_my_basic_struct = std::move(x.m_my_basic_struct); - m_my_alias_enum = x.m_my_alias_enum; - m_my_enum = x.m_my_enum; - m_my_sequence_octet = std::move(x.m_my_sequence_octet); - m_my_sequence_struct = std::move(x.m_my_sequence_struct); - m_my_array_octet = std::move(x.m_my_array_octet); - m_my_octet_array_500 = std::move(x.m_my_octet_array_500); - m_my_array_struct = std::move(x.m_my_array_struct); - m_my_map_octet_short = std::move(x.m_my_map_octet_short); - m_my_map_long_struct = std::move(x.m_my_map_long_struct); - m_my_map_long_seq_octet = std::move(x.m_my_map_long_seq_octet); - m_my_map_long_octet_array_500 = std::move(x.m_my_map_long_octet_array_500); - m_my_map_long_lol_type = std::move(x.m_my_map_long_lol_type); - m_my_small_string_8 = std::move(x.m_my_small_string_8); - m_my_large_string_8 = std::move(x.m_my_large_string_8); - m_my_array_string = std::move(x.m_my_array_string); - m_multi_alias_array_42 = std::move(x.m_multi_alias_array_42); - m_my_array_arrays = std::move(x.m_my_array_arrays); - m_my_sequences_array = std::move(x.m_my_sequences_array); - return *this; - } - - /*! - * @brief Comparison operator. - * @param x ComplexStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const ComplexStruct& x) const - { - return (m_my_octet == x.m_my_octet && - m_my_basic_struct == x.m_my_basic_struct && - m_my_alias_enum == x.m_my_alias_enum && - m_my_enum == x.m_my_enum && - m_my_sequence_octet == x.m_my_sequence_octet && - m_my_sequence_struct == x.m_my_sequence_struct && - m_my_array_octet == x.m_my_array_octet && - m_my_octet_array_500 == x.m_my_octet_array_500 && - m_my_array_struct == x.m_my_array_struct && - m_my_map_octet_short == x.m_my_map_octet_short && - m_my_map_long_struct == x.m_my_map_long_struct && - m_my_map_long_seq_octet == x.m_my_map_long_seq_octet && - m_my_map_long_octet_array_500 == x.m_my_map_long_octet_array_500 && - m_my_map_long_lol_type == x.m_my_map_long_lol_type && - m_my_small_string_8 == x.m_my_small_string_8 && - m_my_large_string_8 == x.m_my_large_string_8 && - m_my_array_string == x.m_my_array_string && - m_multi_alias_array_42 == x.m_multi_alias_array_42 && - m_my_array_arrays == x.m_my_array_arrays && - m_my_sequences_array == x.m_my_sequences_array); - } - - /*! - * @brief Comparison operator. - * @param x ComplexStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const ComplexStruct& x) const - { - return !(*this == x); - } - - /*! - * @brief This function sets a value in member my_octet - * @param _my_octet New value for member my_octet - */ - eProsima_user_DllExport void my_octet( - uint8_t _my_octet) - { - m_my_octet = _my_octet; - } - - /*! - * @brief This function returns the value of member my_octet - * @return Value of member my_octet - */ - eProsima_user_DllExport uint8_t my_octet() const - { - return m_my_octet; - } - - /*! - * @brief This function returns a reference to member my_octet - * @return Reference to member my_octet - */ - eProsima_user_DllExport uint8_t& my_octet() - { - return m_my_octet; - } - - - /*! - * @brief This function copies the value in member my_basic_struct - * @param _my_basic_struct New value to be copied in member my_basic_struct - */ - eProsima_user_DllExport void my_basic_struct( - const BasicStruct& _my_basic_struct) - { - m_my_basic_struct = _my_basic_struct; - } - - /*! - * @brief This function moves the value in member my_basic_struct - * @param _my_basic_struct New value to be moved in member my_basic_struct - */ - eProsima_user_DllExport void my_basic_struct( - BasicStruct&& _my_basic_struct) - { - m_my_basic_struct = std::move(_my_basic_struct); - } - - /*! - * @brief This function returns a constant reference to member my_basic_struct - * @return Constant reference to member my_basic_struct - */ - eProsima_user_DllExport const BasicStruct& my_basic_struct() const - { - return m_my_basic_struct; - } - - /*! - * @brief This function returns a reference to member my_basic_struct - * @return Reference to member my_basic_struct - */ - eProsima_user_DllExport BasicStruct& my_basic_struct() - { - return m_my_basic_struct; - } - - - /*! - * @brief This function sets a value in member my_alias_enum - * @param _my_alias_enum New value for member my_alias_enum - */ - eProsima_user_DllExport void my_alias_enum( - MyAliasEnum _my_alias_enum) - { - m_my_alias_enum = _my_alias_enum; - } - - /*! - * @brief This function returns the value of member my_alias_enum - * @return Value of member my_alias_enum - */ - eProsima_user_DllExport MyAliasEnum my_alias_enum() const - { - return m_my_alias_enum; - } - - /*! - * @brief This function returns a reference to member my_alias_enum - * @return Reference to member my_alias_enum - */ - eProsima_user_DllExport MyAliasEnum& my_alias_enum() - { - return m_my_alias_enum; - } - - - /*! - * @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) - { - m_my_enum = _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 - { - return m_my_enum; - } - - /*! - * @brief This function returns a reference to member my_enum - * @return Reference to member my_enum - */ - eProsima_user_DllExport MyEnum& my_enum() - { - return m_my_enum; - } - - - /*! - * @brief This function copies the value in member my_sequence_octet - * @param _my_sequence_octet New value to be copied in member my_sequence_octet - */ - eProsima_user_DllExport void my_sequence_octet( - const std::vector& _my_sequence_octet) - { - m_my_sequence_octet = _my_sequence_octet; - } - - /*! - * @brief This function moves the value in member my_sequence_octet - * @param _my_sequence_octet New value to be moved in member my_sequence_octet - */ - eProsima_user_DllExport void my_sequence_octet( - std::vector&& _my_sequence_octet) - { - m_my_sequence_octet = std::move(_my_sequence_octet); - } - - /*! - * @brief This function returns a constant reference to member my_sequence_octet - * @return Constant reference to member my_sequence_octet - */ - eProsima_user_DllExport const std::vector& my_sequence_octet() const - { - return m_my_sequence_octet; - } - - /*! - * @brief This function returns a reference to member my_sequence_octet - * @return Reference to member my_sequence_octet - */ - eProsima_user_DllExport std::vector& my_sequence_octet() - { - return m_my_sequence_octet; - } - - - /*! - * @brief This function copies the value in member my_sequence_struct - * @param _my_sequence_struct New value to be copied in member my_sequence_struct - */ - eProsima_user_DllExport void my_sequence_struct( - const std::vector& _my_sequence_struct) - { - m_my_sequence_struct = _my_sequence_struct; - } - - /*! - * @brief This function moves the value in member my_sequence_struct - * @param _my_sequence_struct New value to be moved in member my_sequence_struct - */ - eProsima_user_DllExport void my_sequence_struct( - std::vector&& _my_sequence_struct) - { - m_my_sequence_struct = std::move(_my_sequence_struct); - } - - /*! - * @brief This function returns a constant reference to member my_sequence_struct - * @return Constant reference to member my_sequence_struct - */ - eProsima_user_DllExport const std::vector& my_sequence_struct() const - { - return m_my_sequence_struct; - } - - /*! - * @brief This function returns a reference to member my_sequence_struct - * @return Reference to member my_sequence_struct - */ - eProsima_user_DllExport std::vector& my_sequence_struct() - { - return m_my_sequence_struct; - } - - - /*! - * @brief This function copies the value in member my_array_octet - * @param _my_array_octet New value to be copied in member my_array_octet - */ - eProsima_user_DllExport void my_array_octet( - const std::array, 5>, 500>& _my_array_octet) - { - m_my_array_octet = _my_array_octet; - } - - /*! - * @brief This function moves the value in member my_array_octet - * @param _my_array_octet New value to be moved in member my_array_octet - */ - eProsima_user_DllExport void my_array_octet( - std::array, 5>, 500>&& _my_array_octet) - { - m_my_array_octet = std::move(_my_array_octet); - } - - /*! - * @brief This function returns a constant reference to member my_array_octet - * @return Constant reference to member my_array_octet - */ - eProsima_user_DllExport const std::array, 5>, 500>& my_array_octet() const - { - return m_my_array_octet; - } - - /*! - * @brief This function returns a reference to member my_array_octet - * @return Reference to member my_array_octet - */ - eProsima_user_DllExport std::array, 5>, 500>& my_array_octet() - { - return m_my_array_octet; - } - - - /*! - * @brief This function copies the value in member my_octet_array_500 - * @param _my_octet_array_500 New value to be copied in member my_octet_array_500 - */ - eProsima_user_DllExport void my_octet_array_500( - const MyOctetArray500& _my_octet_array_500) - { - m_my_octet_array_500 = _my_octet_array_500; - } - - /*! - * @brief This function moves the value in member my_octet_array_500 - * @param _my_octet_array_500 New value to be moved in member my_octet_array_500 - */ - eProsima_user_DllExport void my_octet_array_500( - MyOctetArray500&& _my_octet_array_500) - { - m_my_octet_array_500 = std::move(_my_octet_array_500); - } - - /*! - * @brief This function returns a constant reference to member my_octet_array_500 - * @return Constant reference to member my_octet_array_500 - */ - eProsima_user_DllExport const MyOctetArray500& my_octet_array_500() const - { - return m_my_octet_array_500; - } - - /*! - * @brief This function returns a reference to member my_octet_array_500 - * @return Reference to member my_octet_array_500 - */ - eProsima_user_DllExport MyOctetArray500& my_octet_array_500() - { - return m_my_octet_array_500; - } - - - /*! - * @brief This function copies the value in member my_array_struct - * @param _my_array_struct New value to be copied in member my_array_struct - */ - eProsima_user_DllExport void my_array_struct( - const std::array& _my_array_struct) - { - m_my_array_struct = _my_array_struct; - } - - /*! - * @brief This function moves the value in member my_array_struct - * @param _my_array_struct New value to be moved in member my_array_struct - */ - eProsima_user_DllExport void my_array_struct( - std::array&& _my_array_struct) - { - m_my_array_struct = std::move(_my_array_struct); - } - - /*! - * @brief This function returns a constant reference to member my_array_struct - * @return Constant reference to member my_array_struct - */ - eProsima_user_DllExport const std::array& my_array_struct() const - { - return m_my_array_struct; - } - - /*! - * @brief This function returns a reference to member my_array_struct - * @return Reference to member my_array_struct - */ - eProsima_user_DllExport std::array& my_array_struct() - { - return m_my_array_struct; - } - - - /*! - * @brief This function copies the value in member my_map_octet_short - * @param _my_map_octet_short New value to be copied in member my_map_octet_short - */ - eProsima_user_DllExport void my_map_octet_short( - const std::map& _my_map_octet_short) - { - m_my_map_octet_short = _my_map_octet_short; - } - - /*! - * @brief This function moves the value in member my_map_octet_short - * @param _my_map_octet_short New value to be moved in member my_map_octet_short - */ - eProsima_user_DllExport void my_map_octet_short( - std::map&& _my_map_octet_short) - { - m_my_map_octet_short = std::move(_my_map_octet_short); - } - - /*! - * @brief This function returns a constant reference to member my_map_octet_short - * @return Constant reference to member my_map_octet_short - */ - eProsima_user_DllExport const std::map& my_map_octet_short() const - { - return m_my_map_octet_short; - } - - /*! - * @brief This function returns a reference to member my_map_octet_short - * @return Reference to member my_map_octet_short - */ - eProsima_user_DllExport std::map& my_map_octet_short() - { - return m_my_map_octet_short; - } - - - /*! - * @brief This function copies the value in member my_map_long_struct - * @param _my_map_long_struct New value to be copied in member my_map_long_struct - */ - eProsima_user_DllExport void my_map_long_struct( - const std::map& _my_map_long_struct) - { - m_my_map_long_struct = _my_map_long_struct; - } - - /*! - * @brief This function moves the value in member my_map_long_struct - * @param _my_map_long_struct New value to be moved in member my_map_long_struct - */ - eProsima_user_DllExport void my_map_long_struct( - std::map&& _my_map_long_struct) - { - m_my_map_long_struct = std::move(_my_map_long_struct); - } - - /*! - * @brief This function returns a constant reference to member my_map_long_struct - * @return Constant reference to member my_map_long_struct - */ - eProsima_user_DllExport const std::map& my_map_long_struct() const - { - return m_my_map_long_struct; - } - - /*! - * @brief This function returns a reference to member my_map_long_struct - * @return Reference to member my_map_long_struct - */ - eProsima_user_DllExport std::map& my_map_long_struct() - { - return m_my_map_long_struct; - } - - - /*! - * @brief This function copies the value in member my_map_long_seq_octet - * @param _my_map_long_seq_octet New value to be copied in member my_map_long_seq_octet - */ - eProsima_user_DllExport void my_map_long_seq_octet( - const std::map>>& _my_map_long_seq_octet) - { - m_my_map_long_seq_octet = _my_map_long_seq_octet; - } - - /*! - * @brief This function moves the value in member my_map_long_seq_octet - * @param _my_map_long_seq_octet New value to be moved in member my_map_long_seq_octet - */ - eProsima_user_DllExport void my_map_long_seq_octet( - std::map>>&& _my_map_long_seq_octet) - { - m_my_map_long_seq_octet = std::move(_my_map_long_seq_octet); - } - - /*! - * @brief This function returns a constant reference to member my_map_long_seq_octet - * @return Constant reference to member my_map_long_seq_octet - */ - eProsima_user_DllExport const std::map>>& my_map_long_seq_octet() const - { - return m_my_map_long_seq_octet; - } - - /*! - * @brief This function returns a reference to member my_map_long_seq_octet - * @return Reference to member my_map_long_seq_octet - */ - eProsima_user_DllExport std::map>>& my_map_long_seq_octet() - { - return m_my_map_long_seq_octet; - } - - - /*! - * @brief This function copies the value in member my_map_long_octet_array_500 - * @param _my_map_long_octet_array_500 New value to be copied in member my_map_long_octet_array_500 - */ - eProsima_user_DllExport void my_map_long_octet_array_500( - const std::map& _my_map_long_octet_array_500) - { - m_my_map_long_octet_array_500 = _my_map_long_octet_array_500; - } - - /*! - * @brief This function moves the value in member my_map_long_octet_array_500 - * @param _my_map_long_octet_array_500 New value to be moved in member my_map_long_octet_array_500 - */ - eProsima_user_DllExport void my_map_long_octet_array_500( - std::map&& _my_map_long_octet_array_500) - { - m_my_map_long_octet_array_500 = std::move(_my_map_long_octet_array_500); - } - - /*! - * @brief This function returns a constant reference to member my_map_long_octet_array_500 - * @return Constant reference to member my_map_long_octet_array_500 - */ - eProsima_user_DllExport const std::map& my_map_long_octet_array_500() const - { - return m_my_map_long_octet_array_500; - } - - /*! - * @brief This function returns a reference to member my_map_long_octet_array_500 - * @return Reference to member my_map_long_octet_array_500 - */ - eProsima_user_DllExport std::map& my_map_long_octet_array_500() - { - return m_my_map_long_octet_array_500; - } - - - /*! - * @brief This function copies the value in member my_map_long_lol_type - * @param _my_map_long_lol_type New value to be copied in member my_map_long_lol_type - */ - eProsima_user_DllExport void my_map_long_lol_type( - const std::map>& _my_map_long_lol_type) - { - m_my_map_long_lol_type = _my_map_long_lol_type; - } - - /*! - * @brief This function moves the value in member my_map_long_lol_type - * @param _my_map_long_lol_type New value to be moved in member my_map_long_lol_type - */ - eProsima_user_DllExport void my_map_long_lol_type( - std::map>&& _my_map_long_lol_type) - { - m_my_map_long_lol_type = std::move(_my_map_long_lol_type); - } - - /*! - * @brief This function returns a constant reference to member my_map_long_lol_type - * @return Constant reference to member my_map_long_lol_type - */ - eProsima_user_DllExport const std::map>& my_map_long_lol_type() const - { - return m_my_map_long_lol_type; - } - - /*! - * @brief This function returns a reference to member my_map_long_lol_type - * @return Reference to member my_map_long_lol_type - */ - eProsima_user_DllExport std::map>& my_map_long_lol_type() - { - return m_my_map_long_lol_type; - } - - - /*! - * @brief This function copies the value in member my_small_string_8 - * @param _my_small_string_8 New value to be copied in member my_small_string_8 - */ - eProsima_user_DllExport void my_small_string_8( - const eprosima::fastcdr::fixed_string<128>& _my_small_string_8) - { - m_my_small_string_8 = _my_small_string_8; - } - - /*! - * @brief This function moves the value in member my_small_string_8 - * @param _my_small_string_8 New value to be moved in member my_small_string_8 - */ - eProsima_user_DllExport void my_small_string_8( - eprosima::fastcdr::fixed_string<128>&& _my_small_string_8) - { - m_my_small_string_8 = std::move(_my_small_string_8); - } - - /*! - * @brief This function returns a constant reference to member my_small_string_8 - * @return Constant reference to member my_small_string_8 - */ - eProsima_user_DllExport const eprosima::fastcdr::fixed_string<128>& my_small_string_8() const - { - return m_my_small_string_8; - } - - /*! - * @brief This function returns a reference to member my_small_string_8 - * @return Reference to member my_small_string_8 - */ - eProsima_user_DllExport eprosima::fastcdr::fixed_string<128>& my_small_string_8() - { - return m_my_small_string_8; - } - - - /*! - * @brief This function copies the value in member my_large_string_8 - * @param _my_large_string_8 New value to be copied in member my_large_string_8 - */ - eProsima_user_DllExport void my_large_string_8( - const eprosima::fastcdr::fixed_string<500>& _my_large_string_8) - { - m_my_large_string_8 = _my_large_string_8; - } - - /*! - * @brief This function moves the value in member my_large_string_8 - * @param _my_large_string_8 New value to be moved in member my_large_string_8 - */ - eProsima_user_DllExport void my_large_string_8( - eprosima::fastcdr::fixed_string<500>&& _my_large_string_8) - { - m_my_large_string_8 = std::move(_my_large_string_8); - } - - /*! - * @brief This function returns a constant reference to member my_large_string_8 - * @return Constant reference to member my_large_string_8 - */ - eProsima_user_DllExport const eprosima::fastcdr::fixed_string<500>& my_large_string_8() const - { - return m_my_large_string_8; - } - - /*! - * @brief This function returns a reference to member my_large_string_8 - * @return Reference to member my_large_string_8 - */ - eProsima_user_DllExport eprosima::fastcdr::fixed_string<500>& my_large_string_8() - { - return m_my_large_string_8; - } - - - /*! - * @brief This function copies the value in member my_array_string - * @param _my_array_string New value to be copied in member my_array_string - */ - eProsima_user_DllExport void my_array_string( - const std::array, 5>, 5>& _my_array_string) - { - m_my_array_string = _my_array_string; - } - - /*! - * @brief This function moves the value in member my_array_string - * @param _my_array_string New value to be moved in member my_array_string - */ - eProsima_user_DllExport void my_array_string( - std::array, 5>, 5>&& _my_array_string) - { - m_my_array_string = std::move(_my_array_string); - } - - /*! - * @brief This function returns a constant reference to member my_array_string - * @return Constant reference to member my_array_string - */ - eProsima_user_DllExport const std::array, 5>, 5>& my_array_string() const - { - return m_my_array_string; - } - - /*! - * @brief This function returns a reference to member my_array_string - * @return Reference to member my_array_string - */ - eProsima_user_DllExport std::array, 5>, 5>& my_array_string() - { - return m_my_array_string; - } - - - /*! - * @brief This function copies the value in member multi_alias_array_42 - * @param _multi_alias_array_42 New value to be copied in member multi_alias_array_42 - */ - eProsima_user_DllExport void multi_alias_array_42( - const MA3& _multi_alias_array_42) - { - m_multi_alias_array_42 = _multi_alias_array_42; - } - - /*! - * @brief This function moves the value in member multi_alias_array_42 - * @param _multi_alias_array_42 New value to be moved in member multi_alias_array_42 - */ - eProsima_user_DllExport void multi_alias_array_42( - MA3&& _multi_alias_array_42) - { - m_multi_alias_array_42 = std::move(_multi_alias_array_42); - } - - /*! - * @brief This function returns a constant reference to member multi_alias_array_42 - * @return Constant reference to member multi_alias_array_42 - */ - eProsima_user_DllExport const MA3& multi_alias_array_42() const - { - return m_multi_alias_array_42; - } - - /*! - * @brief This function returns a reference to member multi_alias_array_42 - * @return Reference to member multi_alias_array_42 - */ - eProsima_user_DllExport MA3& multi_alias_array_42() - { - return m_multi_alias_array_42; - } - - - /*! - * @brief This function copies the value in member my_array_arrays - * @param _my_array_arrays New value to be copied in member my_array_arrays - */ - eProsima_user_DllExport void my_array_arrays( - const std::array& _my_array_arrays) - { - m_my_array_arrays = _my_array_arrays; - } - - /*! - * @brief This function moves the value in member my_array_arrays - * @param _my_array_arrays New value to be moved in member my_array_arrays - */ - eProsima_user_DllExport void my_array_arrays( - std::array&& _my_array_arrays) - { - m_my_array_arrays = std::move(_my_array_arrays); - } - - /*! - * @brief This function returns a constant reference to member my_array_arrays - * @return Constant reference to member my_array_arrays - */ - eProsima_user_DllExport const std::array& my_array_arrays() const - { - return m_my_array_arrays; - } - - /*! - * @brief This function returns a reference to member my_array_arrays - * @return Reference to member my_array_arrays - */ - eProsima_user_DllExport std::array& my_array_arrays() - { - return m_my_array_arrays; - } - - - /*! - * @brief This function copies the value in member my_sequences_array - * @param _my_sequences_array New value to be copied in member my_sequences_array - */ - eProsima_user_DllExport void my_sequences_array( - const std::array& _my_sequences_array) - { - m_my_sequences_array = _my_sequences_array; - } - - /*! - * @brief This function moves the value in member my_sequences_array - * @param _my_sequences_array New value to be moved in member my_sequences_array - */ - eProsima_user_DllExport void my_sequences_array( - std::array&& _my_sequences_array) - { - m_my_sequences_array = std::move(_my_sequences_array); - } - - /*! - * @brief This function returns a constant reference to member my_sequences_array - * @return Constant reference to member my_sequences_array - */ - eProsima_user_DllExport const std::array& my_sequences_array() const - { - return m_my_sequences_array; - } - - /*! - * @brief This function returns a reference to member my_sequences_array - * @return Reference to member my_sequences_array - */ - eProsima_user_DllExport std::array& my_sequences_array() - { - return m_my_sequences_array; - } - - - -private: - - uint8_t m_my_octet{0}; - BasicStruct m_my_basic_struct; - MyAliasEnum m_my_alias_enum{MyEnum::A}; - MyEnum m_my_enum{MyEnum::A}; - std::vector m_my_sequence_octet; - std::vector m_my_sequence_struct; - std::array, 5>, 500> m_my_array_octet{ {{ {{0}} }} }; - MyOctetArray500 m_my_octet_array_500{0}; - std::array m_my_array_struct; - std::map m_my_map_octet_short; - std::map m_my_map_long_struct; - std::map>> m_my_map_long_seq_octet; - std::map m_my_map_long_octet_array_500; - std::map> m_my_map_long_lol_type; - eprosima::fastcdr::fixed_string<128> m_my_small_string_8; - eprosima::fastcdr::fixed_string<500> m_my_large_string_8; - std::array, 5>, 5> m_my_array_string; - MA3 m_multi_alias_array_42{MyEnum::A}; - std::array m_my_array_arrays{ {{0}} }; - std::array m_my_sequences_array; - -}; -/*! - * @brief This class represents the union MyUnion defined by the user in the IDL file. - * @ingroup Test - */ -class MyUnion -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MyUnion() - { - m__d = MyEnum::A; - } - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MyUnion() - { - } - - /*! - * @brief Copy constructor. - * @param x Reference to the object MyUnion that will be copied. - */ - eProsima_user_DllExport MyUnion( - const MyUnion& x) - { - m__d = x.m__d; - - switch (m__d) - { - case MyEnum::A: - m_basic = x.m_basic; - break; - - - case MyEnum::B: - case MyEnum::C: - m_complex = x.m_complex; - break; - - default: - break; - } - } - - /*! - * @brief Move constructor. - * @param x Reference to the object MyUnion that will be copied. - */ - eProsima_user_DllExport MyUnion( - MyUnion&& x) noexcept - { - m__d = x.m__d; - - switch (m__d) - { - case MyEnum::A: - m_basic = std::move(x.m_basic); - - break; - - - case MyEnum::B: - case MyEnum::C: - m_complex = std::move(x.m_complex); - - break; - - default: - break; - } - } - - /*! - * @brief Copy assignment. - * @param x Reference to the object MyUnion that will be copied. - */ - eProsima_user_DllExport MyUnion& operator =( - const MyUnion& x) - { - m__d = x.m__d; - - switch (m__d) - { - case MyEnum::A: - m_basic = x.m_basic; - break; - - - case MyEnum::B: - case MyEnum::C: - m_complex = x.m_complex; - break; - - default: - break; - } - - return *this; - } - - /*! - * @brief Move assignment. - * @param x Reference to the object MyUnion that will be copied. - */ - eProsima_user_DllExport MyUnion& operator =( - MyUnion&& x) noexcept - { - m__d = x.m__d; - - switch (m__d) - { - case MyEnum::A: - m_basic = std::move(x.m_basic); - - break; - - - case MyEnum::B: - case MyEnum::C: - m_complex = std::move(x.m_complex); - - break; - - default: - break; - } - - return *this; - } - - /*! - * @brief Comparison operator. - * @param x MyUnion object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MyUnion& x) const - { - if (m__d != x.m__d) - { - return false; - } - - switch (m__d) - { - case MyEnum::A: - return (m_basic == x.m_basic); - break; - - - case MyEnum::B: - case MyEnum::C: - return (m_complex == x.m_complex); - break; - - default: - break; - } - return false; - } - - /*! - * @brief Comparison operator. - * @param x MyUnion object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MyUnion& 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( - MyEnum __d) - { - bool b = false; - - switch (m__d) - { - case MyEnum::A: - switch (__d) - { - case MyEnum::A: - b = true; - break; - default: - break; - } - break; - - - case MyEnum::B: - case MyEnum::C: - switch (__d) - { - case MyEnum::B: - case MyEnum::C: - b = true; - break; - default: - break; - } - break; - - default: - break; - } - - if (!b) - { - 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 MyEnum _d() const - { - return m__d; - } - - /*! - * @brief This function returns a reference to the discriminator. - * @return Reference to the discriminator. - */ - eProsima_user_DllExport MyEnum& _d() - { - return m__d; - } - - /*! - * @brief This function copies the value in member basic - * @param _basic New value to be copied in member basic - */ - eProsima_user_DllExport void basic( - const BasicStruct& _basic) - { - m_basic = _basic; - m__d = MyEnum::A; - - } - - /*! - * @brief This function moves the value in member basic - * @param _basic New value to be moved in member basic - */ - eProsima_user_DllExport void basic( - BasicStruct&& _basic) - { - m_basic = std::move(_basic); - m__d = MyEnum::A; - - } - - /*! - * @brief This function returns a constant reference to member basic - * @return Constant reference to member basic - * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport const BasicStruct& basic() const - { - bool b = false; - - switch (m__d) - { - case MyEnum::A: - b = true; - break; - default: - break; - } - - if (!b) - { - throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); - } - - return m_basic; - } - - /*! - * @brief This function returns a reference to member basic - * @return Reference to member basic - * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport BasicStruct& basic() - { - bool b = false; - - switch (m__d) - { - case MyEnum::A: - b = true; - break; - default: - break; - } - - if (!b) - { - throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); - } - - return m_basic; - } - - - /*! - * @brief This function copies the value in member complex - * @param _complex New value to be copied in member complex - */ - eProsima_user_DllExport void complex( - const ComplexStruct& _complex) - { - m_complex = _complex; - m__d = MyEnum::B; - - } - - /*! - * @brief This function moves the value in member complex - * @param _complex New value to be moved in member complex - */ - eProsima_user_DllExport void complex( - ComplexStruct&& _complex) - { - m_complex = std::move(_complex); - m__d = MyEnum::B; - - } - - /*! - * @brief This function returns a constant reference to member complex - * @return Constant reference to member complex - * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport const ComplexStruct& complex() const - { - bool b = false; - - switch (m__d) - { - case MyEnum::B: - case MyEnum::C: - b = true; - break; - default: - break; - } - - if (!b) - { - throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); - } - - return m_complex; - } - - /*! - * @brief This function returns a reference to member complex - * @return Reference to member complex - * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport ComplexStruct& complex() - { - bool b = false; - - switch (m__d) - { - case MyEnum::B: - case MyEnum::C: - b = true; - break; - default: - break; - } - - if (!b) - { - throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); - } - - return m_complex; - } - - - -private: - - MyEnum m__d; - - BasicStruct m_basic; - ComplexStruct m_complex; -}; -/*! - * @brief This class represents the union MyUnion2 defined by the user in the IDL file. - * @ingroup Test - */ -class MyUnion2 -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MyUnion2() - { - m__d = 0; - } - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MyUnion2() - { - } - - /*! - * @brief Copy constructor. - * @param x Reference to the object MyUnion2 that will be copied. - */ - eProsima_user_DllExport MyUnion2( - const MyUnion2& x) - { - m__d = x.m__d; - - switch (m__d) - { - case 0: - m_uno = x.m_uno; - break; - - - case 1: - m_imString = x.m_imString; - break; - - - case 2: - m_tres = x.m_tres; - break; - - default: - break; - } - } - - /*! - * @brief Move constructor. - * @param x Reference to the object MyUnion2 that will be copied. - */ - eProsima_user_DllExport MyUnion2( - MyUnion2&& x) noexcept - { - m__d = x.m__d; - - switch (m__d) - { - case 0: - m_uno = x.m_uno; - break; - - - case 1: - m_imString = std::move(x.m_imString); - - break; - - - case 2: - m_tres = x.m_tres; - break; - - default: - break; - } - } - - /*! - * @brief Copy assignment. - * @param x Reference to the object MyUnion2 that will be copied. - */ - eProsima_user_DllExport MyUnion2& operator =( - const MyUnion2& x) - { - m__d = x.m__d; - - switch (m__d) - { - case 0: - m_uno = x.m_uno; - break; - - - case 1: - m_imString = x.m_imString; - break; - - - case 2: - m_tres = x.m_tres; - break; - - default: - break; - } - - return *this; - } - - /*! - * @brief Move assignment. - * @param x Reference to the object MyUnion2 that will be copied. - */ - eProsima_user_DllExport MyUnion2& operator =( - MyUnion2&& x) noexcept - { - m__d = x.m__d; - - switch (m__d) - { - case 0: - m_uno = x.m_uno; - break; - - - case 1: - m_imString = std::move(x.m_imString); - - break; - - - case 2: - m_tres = x.m_tres; - break; - - default: - break; - } - - return *this; - } - - /*! - * @brief Comparison operator. - * @param x MyUnion2 object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MyUnion2& x) const - { - if (m__d != x.m__d) - { - return false; - } - - switch (m__d) - { - case 0: - return (m_uno == x.m_uno); - break; - - - case 1: - return (m_imString == x.m_imString); - break; - - - case 2: - return (m_tres == x.m_tres); - break; - - default: - break; - } - return false; - } - - /*! - * @brief Comparison operator. - * @param x MyUnion2 object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MyUnion2& 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 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; - - - case 2: - switch (__d) - { - case 2: - b = true; - break; - default: - break; - } - break; - - default: - break; - } - - if (!b) - { - 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 returns a reference to the discriminator. - * @return Reference to the discriminator. - */ - eProsima_user_DllExport uint8_t& _d() - { - return m__d; - } - - /*! - * @brief This function sets a value in member uno - * @param _uno New value for member uno - */ - eProsima_user_DllExport void uno( - int32_t _uno) - { - m_uno = _uno; - m__d = 0; - - } - - /*! - * @brief This function returns the value of member uno - * @return Value of member uno - * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t uno() const - { - bool b = false; - - switch (m__d) - { - case 0: - b = true; - break; - default: - break; - } - - if (!b) - { - throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); - } - - return m_uno; - } - - /*! - * @brief This function returns a reference to member uno - * @return Reference to member uno - * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t& uno() - { - bool b = false; - - switch (m__d) - { - case 0: - b = true; - break; - default: - break; - } - - if (!b) - { - throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); - } - - return m_uno; - } - - - /*! - * @brief This function copies the value in member imString - * @param _imString New value to be copied in member imString - */ - eProsima_user_DllExport void imString( - const std::string& _imString) - { - m_imString = _imString; - m__d = 1; - - } - - /*! - * @brief This function moves the value in member imString - * @param _imString New value to be moved in member imString - */ - eProsima_user_DllExport void imString( - std::string&& _imString) - { - m_imString = std::move(_imString); - m__d = 1; - - } - - /*! - * @brief This function returns a constant reference to member imString - * @return Constant reference to member imString - * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport const std::string& imString() const - { - bool b = false; - - switch (m__d) - { - case 1: - b = true; - break; - default: - break; - } - - if (!b) - { - throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); - } - - return m_imString; - } - - /*! - * @brief This function returns a reference to member imString - * @return Reference to member imString - * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport std::string& imString() - { - bool b = false; - - switch (m__d) - { - case 1: - b = true; - break; - default: - break; - } - - if (!b) - { - throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); - } - - return m_imString; - } - - - /*! - * @brief This function sets a value in member tres - * @param _tres New value for member tres - */ - eProsima_user_DllExport void tres( - int32_t _tres) - { - m_tres = _tres; - m__d = 2; - - } - - /*! - * @brief This function returns the value of member tres - * @return Value of member tres - * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t tres() const - { - bool b = false; - - switch (m__d) - { - case 2: - b = true; - break; - default: - break; - } - - if (!b) - { - throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); - } - - return m_tres; - } - - /*! - * @brief This function returns a reference to member tres - * @return Reference to member tres - * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t& tres() - { - bool b = false; - - switch (m__d) - { - case 2: - b = true; - break; - default: - break; - } - - if (!b) - { - throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); - } - - return m_tres; - } - - - -private: - - uint8_t m__d; - - int32_t m_uno{0}; - std::string m_imString; - int32_t m_tres{0}; -}; -/*! - * @brief This class represents the structure CompleteStruct defined by the user in the IDL file. - * @ingroup Test - */ -class CompleteStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport CompleteStruct() - { - } - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~CompleteStruct() - { - } - - /*! - * @brief Copy constructor. - * @param x Reference to the object CompleteStruct that will be copied. - */ - eProsima_user_DllExport CompleteStruct( - const CompleteStruct& x) - { - m_my_union = x.m_my_union; - - m_my_union_2 = x.m_my_union_2; - - } - - /*! - * @brief Move constructor. - * @param x Reference to the object CompleteStruct that will be copied. - */ - eProsima_user_DllExport CompleteStruct( - CompleteStruct&& x) noexcept - { - m_my_union = std::move(x.m_my_union); - m_my_union_2 = std::move(x.m_my_union_2); - } - - /*! - * @brief Copy assignment. - * @param x Reference to the object CompleteStruct that will be copied. - */ - eProsima_user_DllExport CompleteStruct& operator =( - const CompleteStruct& x) - { - - m_my_union = x.m_my_union; - - m_my_union_2 = x.m_my_union_2; - - return *this; - } - - /*! - * @brief Move assignment. - * @param x Reference to the object CompleteStruct that will be copied. - */ - eProsima_user_DllExport CompleteStruct& operator =( - CompleteStruct&& x) noexcept - { - - m_my_union = std::move(x.m_my_union); - m_my_union_2 = std::move(x.m_my_union_2); - return *this; - } - - /*! - * @brief Comparison operator. - * @param x CompleteStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const CompleteStruct& x) const - { - return (m_my_union == x.m_my_union && - m_my_union_2 == x.m_my_union_2); - } - - /*! - * @brief Comparison operator. - * @param x CompleteStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const CompleteStruct& 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 - */ - eProsima_user_DllExport void my_union( - const MyUnion& _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 - */ - eProsima_user_DllExport void my_union( - MyUnion&& _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 - */ - eProsima_user_DllExport const MyUnion& my_union() const - { - return m_my_union; - } - - /*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ - eProsima_user_DllExport MyUnion& my_union() - { - return m_my_union; - } - - - /*! - * @brief This function copies the value in member my_union_2 - * @param _my_union_2 New value to be copied in member my_union_2 - */ - eProsima_user_DllExport void my_union_2( - const MyUnion2& _my_union_2) - { - m_my_union_2 = _my_union_2; - } - - /*! - * @brief This function moves the value in member my_union_2 - * @param _my_union_2 New value to be moved in member my_union_2 - */ - eProsima_user_DllExport void my_union_2( - MyUnion2&& _my_union_2) - { - m_my_union_2 = std::move(_my_union_2); - } - - /*! - * @brief This function returns a constant reference to member my_union_2 - * @return Constant reference to member my_union_2 - */ - eProsima_user_DllExport const MyUnion2& my_union_2() const - { - return m_my_union_2; - } - - /*! - * @brief This function returns a reference to member my_union_2 - * @return Reference to member my_union_2 - */ - eProsima_user_DllExport MyUnion2& my_union_2() - { - return m_my_union_2; - } - - - -private: - - MyUnion m_my_union; - MyUnion2 m_my_union_2; - -}; -/*! - * @brief This class represents the structure KeyedStruct defined by the user in the IDL file. - * @ingroup Test - */ -class KeyedStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport KeyedStruct() - { - } - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~KeyedStruct() - { - } - - /*! - * @brief Copy constructor. - * @param x Reference to the object KeyedStruct that will be copied. - */ - eProsima_user_DllExport KeyedStruct( - const KeyedStruct& x) - { - m_key = x.m_key; - - m_basic = x.m_basic; - - } - - /*! - * @brief Move constructor. - * @param x Reference to the object KeyedStruct that will be copied. - */ - eProsima_user_DllExport KeyedStruct( - KeyedStruct&& x) noexcept - { - m_key = x.m_key; - m_basic = std::move(x.m_basic); - } - - /*! - * @brief Copy assignment. - * @param x Reference to the object KeyedStruct that will be copied. - */ - eProsima_user_DllExport KeyedStruct& operator =( - const KeyedStruct& x) - { - - m_key = x.m_key; - - m_basic = x.m_basic; - - return *this; - } - - /*! - * @brief Move assignment. - * @param x Reference to the object KeyedStruct that will be copied. - */ - eProsima_user_DllExport KeyedStruct& operator =( - KeyedStruct&& x) noexcept - { - - m_key = x.m_key; - m_basic = std::move(x.m_basic); - return *this; - } - - /*! - * @brief Comparison operator. - * @param x KeyedStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const KeyedStruct& x) const - { - return (m_key == x.m_key && - m_basic == x.m_basic); - } - - /*! - * @brief Comparison operator. - * @param x KeyedStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const KeyedStruct& x) const - { - return !(*this == x); - } - - /*! - * @brief This function sets a value in member key - * @param _key New value for member key - */ - eProsima_user_DllExport void key( - uint8_t _key) - { - m_key = _key; - } - - /*! - * @brief This function returns the value of member key - * @return Value of member key - */ - eProsima_user_DllExport uint8_t key() const - { - return m_key; - } - - /*! - * @brief This function returns a reference to member key - * @return Reference to member key - */ - eProsima_user_DllExport uint8_t& key() - { - return m_key; - } - - - /*! - * @brief This function copies the value in member basic - * @param _basic New value to be copied in member basic - */ - eProsima_user_DllExport void basic( - const BasicStruct& _basic) - { - m_basic = _basic; - } - - /*! - * @brief This function moves the value in member basic - * @param _basic New value to be moved in member basic - */ - eProsima_user_DllExport void basic( - BasicStruct&& _basic) - { - m_basic = std::move(_basic); - } - - /*! - * @brief This function returns a constant reference to member basic - * @return Constant reference to member basic - */ - eProsima_user_DllExport const BasicStruct& basic() const - { - return m_basic; - } - - /*! - * @brief This function returns a reference to member basic - * @return Reference to member basic - */ - eProsima_user_DllExport BasicStruct& basic() - { - return m_basic; - } - - - -private: - - uint8_t m_key{0}; - BasicStruct m_basic; - -}; - -#endif // _FAST_DDS_GENERATED_TEST_HPP_ - - diff --git a/test/unittest/dynamic_types/idl/Test.idl b/test/unittest/dynamic_types/idl/Test.idl deleted file mode 100644 index 8e8873cd5f9..00000000000 --- a/test/unittest/dynamic_types/idl/Test.idl +++ /dev/null @@ -1,93 +0,0 @@ - -enum MyEnum -{ - A, - B, - C -}; - -typedef MyEnum MyAliasEnum; -typedef MyAliasEnum MyAliasEnum2; -typedef MyAliasEnum2 MyAliasEnum3; - -struct BasicStruct -{ - boolean my_bool; - octet my_octet; - short my_int16; - long my_int32; - long long my_int64; - unsigned short my_uint16; - unsigned long my_uint32; - unsigned long long my_uint64; - float my_float32; - double my_float64; - long double my_float128; - char my_char; - //wchar my_wchar; //TODO(richiware) Remove when xtype 1.3. Also in DynamicComplexTypesTests.cpp. - string my_string; - //wstring my_wstring; //TODO(richiware) Remove when xtype 1.3. Also in DynamicComplexTypesTests.cpp. -}; - -typedef octet MyOctetArray500[500]; -typedef BasicStruct BSAlias5[5]; -typedef MyAliasEnum3 MA3[42]; -typedef long MyMiniArray[2]; -typedef sequence MySequenceLong; - -struct ComplexStruct -{ - octet my_octet; - BasicStruct my_basic_struct; - MyAliasEnum my_alias_enum; - MyEnum my_enum; - sequence my_sequence_octet; - sequence my_sequence_struct; - char my_array_octet[500][5][4]; - MyOctetArray500 my_octet_array_500; - BasicStruct my_array_struct[5]; - map my_map_octet_short; - map my_map_long_struct; - map > > my_map_long_seq_octet; - map my_map_long_octet_array_500; - map > my_map_long_lol_type; - string<128> my_small_string_8; - //wstring<64> my_small_string_16; //TODO(richiware) Remove when xtype 1.3 - string<500> my_large_string_8; - //wstring<1024> my_large_string_16; //TODO(richiware) Remove when xtype 1.3 - string<75> my_array_string[5][5]; - MA3 multi_alias_array_42; - MyMiniArray my_array_arrays[5]; - MySequenceLong my_sequences_array[23]; -}; - -union MyUnion switch (MyEnum) -{ - case A: - BasicStruct basic; - case B: - case C: - ComplexStruct complex; -}; - -union MyUnion2 switch (octet) -{ - case 0: - long uno; - case 1: - string imString; - case 2: - long tres; -}; - -struct CompleteStruct -{ - MyUnion my_union; - MyUnion2 my_union_2; -}; - -struct KeyedStruct -{ - @key octet key; - BasicStruct basic; -}; diff --git a/test/unittest/dynamic_types/idl/TestCdrAux.hpp b/test/unittest/dynamic_types/idl/TestCdrAux.hpp deleted file mode 100644 index ef84bd31ffb..00000000000 --- a/test/unittest/dynamic_types/idl/TestCdrAux.hpp +++ /dev/null @@ -1,85 +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 TestCdrAux.hpp - * This source file contains some definitions of CDR related functions. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_TESTCDRAUX_HPP_ -#define _FAST_DDS_GENERATED_TESTCDRAUX_HPP_ - -#include "Test.hpp" - -constexpr uint32_t KeyedStruct_max_cdr_typesize {344UL}; -constexpr uint32_t KeyedStruct_max_key_cdr_typesize {1UL}; - - - - -constexpr uint32_t BasicStruct_max_cdr_typesize {336UL}; -constexpr uint32_t BasicStruct_max_key_cdr_typesize {0UL}; - - -constexpr uint32_t ComplexStruct_max_cdr_typesize {15592UL}; -constexpr uint32_t ComplexStruct_max_key_cdr_typesize {0UL}; - - - -constexpr uint32_t CompleteStruct_max_cdr_typesize {15868UL}; -constexpr uint32_t CompleteStruct_max_key_cdr_typesize {0UL}; - - - - - - - -namespace eprosima { -namespace fastcdr { - -class Cdr; -class CdrSizeCalculator; - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const BasicStruct& data); - - - - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const ComplexStruct& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const CompleteStruct& data); - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const KeyedStruct& data); - - -} // namespace fastcdr -} // namespace eprosima - -#endif // _FAST_DDS_GENERATED_TESTCDRAUX_HPP_ - diff --git a/test/unittest/dynamic_types/idl/TestCdrAux.ipp b/test/unittest/dynamic_types/idl/TestCdrAux.ipp deleted file mode 100644 index 77a0f480fe9..00000000000 --- a/test/unittest/dynamic_types/idl/TestCdrAux.ipp +++ /dev/null @@ -1,848 +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 TestCdrAux.ipp - * This source file contains some declarations of CDR related functions. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_TESTCDRAUX_IPP_ -#define _FAST_DDS_GENERATED_TESTCDRAUX_IPP_ - -#include "TestCdrAux.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 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_octet(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), - data.my_int16(), 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_int64(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(5), - data.my_uint16(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(6), - data.my_uint32(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(7), - data.my_uint64(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(8), - data.my_float32(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(9), - data.my_float64(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(10), - data.my_float128(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(11), - data.my_char(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(12), - 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_octet() - << eprosima::fastcdr::MemberId(2) << data.my_int16() - << eprosima::fastcdr::MemberId(3) << data.my_int32() - << eprosima::fastcdr::MemberId(4) << data.my_int64() - << eprosima::fastcdr::MemberId(5) << data.my_uint16() - << eprosima::fastcdr::MemberId(6) << data.my_uint32() - << eprosima::fastcdr::MemberId(7) << data.my_uint64() - << eprosima::fastcdr::MemberId(8) << data.my_float32() - << eprosima::fastcdr::MemberId(9) << data.my_float64() - << eprosima::fastcdr::MemberId(10) << data.my_float128() - << eprosima::fastcdr::MemberId(11) << data.my_char() - << eprosima::fastcdr::MemberId(12) << 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_octet(); - break; - - case 2: - dcdr >> data.my_int16(); - break; - - case 3: - dcdr >> data.my_int32(); - break; - - case 4: - dcdr >> data.my_int64(); - break; - - case 5: - dcdr >> data.my_uint16(); - break; - - case 6: - dcdr >> data.my_uint32(); - break; - - case 7: - dcdr >> data.my_uint64(); - break; - - case 8: - dcdr >> data.my_float32(); - break; - - case 9: - dcdr >> data.my_float64(); - break; - - case 10: - dcdr >> data.my_float128(); - break; - - case 11: - dcdr >> data.my_char(); - break; - - case 12: - 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 ComplexStruct& 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_octet(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.my_basic_struct(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), - data.my_alias_enum(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), - data.my_enum(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(4), - data.my_sequence_octet(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(5), - data.my_sequence_struct(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(6), - data.my_array_octet(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(7), - data.my_octet_array_500(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(8), - data.my_array_struct(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(9), - data.my_map_octet_short(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(10), - data.my_map_long_struct(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(11), - data.my_map_long_seq_octet(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(12), - data.my_map_long_octet_array_500(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(13), - data.my_map_long_lol_type(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(14), - data.my_small_string_8(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(15), - data.my_large_string_8(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(16), - data.my_array_string(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(17), - data.multi_alias_array_42(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(18), - data.my_array_arrays(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(19), - data.my_sequences_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 ComplexStruct& 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_octet() - << eprosima::fastcdr::MemberId(1) << data.my_basic_struct() - << eprosima::fastcdr::MemberId(2) << data.my_alias_enum() - << eprosima::fastcdr::MemberId(3) << data.my_enum() - << eprosima::fastcdr::MemberId(4) << data.my_sequence_octet() - << eprosima::fastcdr::MemberId(5) << data.my_sequence_struct() - << eprosima::fastcdr::MemberId(6) << data.my_array_octet() - << eprosima::fastcdr::MemberId(7) << data.my_octet_array_500() - << eprosima::fastcdr::MemberId(8) << data.my_array_struct() - << eprosima::fastcdr::MemberId(9) << data.my_map_octet_short() - << eprosima::fastcdr::MemberId(10) << data.my_map_long_struct() - << eprosima::fastcdr::MemberId(11) << data.my_map_long_seq_octet() - << eprosima::fastcdr::MemberId(12) << data.my_map_long_octet_array_500() - << eprosima::fastcdr::MemberId(13) << data.my_map_long_lol_type() - << eprosima::fastcdr::MemberId(14) << data.my_small_string_8() - << eprosima::fastcdr::MemberId(15) << data.my_large_string_8() - << eprosima::fastcdr::MemberId(16) << data.my_array_string() - << eprosima::fastcdr::MemberId(17) << data.multi_alias_array_42() - << eprosima::fastcdr::MemberId(18) << data.my_array_arrays() - << eprosima::fastcdr::MemberId(19) << data.my_sequences_array() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - ComplexStruct& 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_octet(); - break; - - case 1: - dcdr >> data.my_basic_struct(); - break; - - case 2: - dcdr >> data.my_alias_enum(); - break; - - case 3: - dcdr >> data.my_enum(); - break; - - case 4: - dcdr >> data.my_sequence_octet(); - break; - - case 5: - dcdr >> data.my_sequence_struct(); - break; - - case 6: - dcdr >> data.my_array_octet(); - break; - - case 7: - dcdr >> data.my_octet_array_500(); - break; - - case 8: - dcdr >> data.my_array_struct(); - break; - - case 9: - dcdr >> data.my_map_octet_short(); - break; - - case 10: - dcdr >> data.my_map_long_struct(); - break; - - case 11: - dcdr >> data.my_map_long_seq_octet(); - break; - - case 12: - dcdr >> data.my_map_long_octet_array_500(); - break; - - case 13: - dcdr >> data.my_map_long_lol_type(); - break; - - case 14: - dcdr >> data.my_small_string_8(); - break; - - case 15: - dcdr >> data.my_large_string_8(); - break; - - case 16: - dcdr >> data.my_array_string(); - break; - - case 17: - dcdr >> data.multi_alias_array_42(); - break; - - case 18: - dcdr >> data.my_array_arrays(); - break; - - case 19: - dcdr >> data.my_sequences_array(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const ComplexStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const MyUnion& 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 MyEnum::A: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.basic(), current_alignment); - break; - - case MyEnum::B: - case MyEnum::C: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), - data.complex(), 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 MyUnion& 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 MyEnum::A: - scdr << eprosima::fastcdr::MemberId(1) << data.basic(); - break; - - case MyEnum::B: - case MyEnum::C: - scdr << eprosima::fastcdr::MemberId(2) << data.complex(); - break; - - default: - break; - } - - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - MyUnion& 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 MyEnum::A: - dcdr >> data.basic(); - break; - - case MyEnum::B: - case MyEnum::C: - dcdr >> data.complex(); - break; - - default: - break; - } - ret_value = false; - break; - } - return ret_value; - }); -} - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const MyUnion2& 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.uno(), current_alignment); - break; - - case 1: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), - data.imString(), current_alignment); - break; - - case 2: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), - data.tres(), 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 MyUnion2& 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.uno(); - break; - - case 1: - scdr << eprosima::fastcdr::MemberId(2) << data.imString(); - break; - - case 2: - scdr << eprosima::fastcdr::MemberId(3) << data.tres(); - break; - - default: - break; - } - - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - MyUnion2& 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.uno(); - break; - - case 1: - dcdr >> data.imString(); - break; - - case 2: - dcdr >> data.tres(); - break; - - default: - break; - } - ret_value = false; - break; - } - return ret_value; - }); -} - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const CompleteStruct& 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.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.my_union_2(), 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 CompleteStruct& 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() - << eprosima::fastcdr::MemberId(1) << data.my_union_2() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - CompleteStruct& 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; - - case 1: - dcdr >> data.my_union_2(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const CompleteStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const KeyedStruct& 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.key(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.basic(), 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 KeyedStruct& 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.key() - << eprosima::fastcdr::MemberId(1) << data.basic() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - KeyedStruct& 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.key(); - break; - - case 1: - dcdr >> data.basic(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const KeyedStruct& data) -{ - static_cast(scdr); - static_cast(data); - scdr << data.key(); - - -} - - - -} // namespace fastcdr -} // namespace eprosima - -#endif // _FAST_DDS_GENERATED_TESTCDRAUX_IPP_ - diff --git a/test/unittest/dynamic_types/idl/TestPubSubTypes.cxx b/test/unittest/dynamic_types/idl/TestPubSubTypes.cxx deleted file mode 100644 index 6b90c2bb827..00000000000 --- a/test/unittest/dynamic_types/idl/TestPubSubTypes.cxx +++ /dev/null @@ -1,815 +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 TestPubSubTypes.cpp - * This header file contains the implementation of the serialization functions. - * - * This file was generated by the tool fastddsgen. - */ - -#include "TestPubSubTypes.h" - -#include -#include - -#include "TestCdrAux.hpp" -#include "TestTypeObjectSupport.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; - -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; -} - -void BasicStructPubSubType::register_type_object_representation() const -{ - register_Test_type_objects(); -} - - - - - - -ComplexStructPubSubType::ComplexStructPubSubType() -{ - setName("ComplexStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(ComplexStruct::getMaxCdrSerializedSize()); -#else - ComplexStruct_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 = ComplexStruct_max_key_cdr_typesize > 16 ? ComplexStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -ComplexStructPubSubType::~ComplexStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool ComplexStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - ComplexStruct* 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 ComplexStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - ComplexStruct* 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 ComplexStructPubSubType::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* ComplexStructPubSubType::createData() -{ - return reinterpret_cast(new ComplexStruct()); -} - -void ComplexStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool ComplexStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - ComplexStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - ComplexStruct_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 || ComplexStruct_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} - -void ComplexStructPubSubType::register_type_object_representation() const -{ - register_Test_type_objects(); -} - - - -CompleteStructPubSubType::CompleteStructPubSubType() -{ - setName("CompleteStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(CompleteStruct::getMaxCdrSerializedSize()); -#else - CompleteStruct_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 = CompleteStruct_max_key_cdr_typesize > 16 ? CompleteStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -CompleteStructPubSubType::~CompleteStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool CompleteStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - CompleteStruct* 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 CompleteStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - CompleteStruct* 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 CompleteStructPubSubType::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* CompleteStructPubSubType::createData() -{ - return reinterpret_cast(new CompleteStruct()); -} - -void CompleteStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool CompleteStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - CompleteStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - CompleteStruct_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 || CompleteStruct_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} - -void CompleteStructPubSubType::register_type_object_representation() const -{ - register_Test_type_objects(); -} - -KeyedStructPubSubType::KeyedStructPubSubType() -{ - setName("KeyedStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(KeyedStruct::getMaxCdrSerializedSize()); -#else - KeyedStruct_max_cdr_typesize; -#endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = true; - uint32_t keyLength = KeyedStruct_max_key_cdr_typesize > 16 ? KeyedStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -KeyedStructPubSubType::~KeyedStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool KeyedStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - KeyedStruct* 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 KeyedStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - KeyedStruct* 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 KeyedStructPubSubType::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* KeyedStructPubSubType::createData() -{ - return reinterpret_cast(new KeyedStruct()); -} - -void KeyedStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool KeyedStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - KeyedStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - KeyedStruct_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 || KeyedStruct_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} - -void KeyedStructPubSubType::register_type_object_representation() const -{ - register_Test_type_objects(); -} - - -// Include auxiliary functions like for serializing/deserializing. -#include "TestCdrAux.ipp" diff --git a/test/unittest/dynamic_types/idl/TestPubSubTypes.h b/test/unittest/dynamic_types/idl/TestPubSubTypes.h deleted file mode 100644 index 991b786586c..00000000000 --- a/test/unittest/dynamic_types/idl/TestPubSubTypes.h +++ /dev/null @@ -1,416 +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 TestPubSubTypes.h - * This header file contains the declaration of the serialization functions. - * - * This file was generated by the tool fastddsgen. - */ - - -#ifndef _FAST_DDS_GENERATED_TEST_PUBSUBTYPES_H_ -#define _FAST_DDS_GENERATED_TEST_PUBSUBTYPES_H_ - -#include -#include -#include -#include -#include - -#include "Test.hpp" - - -#if !defined(GEN_API_VER) || (GEN_API_VER != 2) -#error \ - Generated Test is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. -#endif // GEN_API_VER - -typedef MyEnum MyAliasEnum; -typedef MyAliasEnum MyAliasEnum2; -typedef MyAliasEnum2 MyAliasEnum3; - -/*! - * @brief This class represents the TopicDataType of the type BasicStruct defined by the user in the IDL file. - * @ingroup Test - */ -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; - - //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::array MyOctetArray500; -typedef std::array BSAlias5; -typedef std::array MA3; -typedef std::array MyMiniArray; -typedef std::vector MySequenceLong; - -/*! - * @brief This class represents the TopicDataType of the type ComplexStruct defined by the user in the IDL file. - * @ingroup Test - */ -class ComplexStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef ComplexStruct type; - - eProsima_user_DllExport ComplexStructPubSubType(); - - eProsima_user_DllExport ~ComplexStructPubSubType() 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 CompleteStruct defined by the user in the IDL file. - * @ingroup Test - */ -class CompleteStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef CompleteStruct type; - - eProsima_user_DllExport CompleteStructPubSubType(); - - eProsima_user_DllExport ~CompleteStructPubSubType() 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 KeyedStruct defined by the user in the IDL file. - * @ingroup Test - */ -class KeyedStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef KeyedStruct type; - - eProsima_user_DllExport KeyedStructPubSubType(); - - eProsima_user_DllExport ~KeyedStructPubSubType() 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; - -}; - -#endif // _FAST_DDS_GENERATED_TEST_PUBSUBTYPES_H_ - diff --git a/test/unittest/dynamic_types/idl/TestTypeObjectSupport.cxx b/test/unittest/dynamic_types/idl/TestTypeObjectSupport.cxx deleted file mode 100644 index d09b0cfc6b2..00000000000 --- a/test/unittest/dynamic_types/idl/TestTypeObjectSupport.cxx +++ /dev/null @@ -1,32526 +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 TestTypeObjectSupport.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 "TestTypeObjectSupport.hpp" - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "Test.hpp" - - -using namespace eprosima::fastdds::dds::xtypes; - -void register_Test_type_objects() -{ - static std::once_flag once_flag; - std::call_once(once_flag, []() - { - register_BasicStruct_type_identifier(); - - register_ComplexStruct_type_identifier(); - - register_MyUnion_type_identifier(); - - register_MyUnion2_type_identifier(); - - register_CompleteStruct_type_identifier(); - - register_KeyedStruct_type_identifier(); - - }); -} - -void register_BasicStruct_type_identifier() -{ - { - StructTypeFlag struct_flags_BasicStruct = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_BasicStruct; - TypeIdentifierPair type_ids_BasicStruct; - QualifiedTypeName type_name_BasicStruct = "BasicStruct"; - eprosima::fastcdr::optional type_ann_builtin_BasicStruct; - eprosima::fastcdr::optional ann_custom_BasicStruct; - CompleteTypeDetail detail_BasicStruct = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_BasicStruct, ann_custom_BasicStruct, type_name_BasicStruct.to_string()); - CompleteStructHeader header_BasicStruct; - header_BasicStruct = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_BasicStruct); - CompleteStructMemberSeq member_seq_BasicStruct; - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_bool", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_bool Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_bool = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_bool; - MemberId member_id_my_bool = 0x00000000; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_bool = TypeObjectUtils::build_common_struct_member(member_id_my_bool, member_flags_my_bool, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_bool = TypeObjectUtils::build_common_struct_member(member_id_my_bool, member_flags_my_bool, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_bool member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_bool = "my_bool"; - eprosima::fastcdr::optional member_ann_builtin_my_bool; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_bool = TypeObjectUtils::build_complete_member_detail(name_my_bool, member_ann_builtin_my_bool, ann_custom_BasicStruct); - CompleteStructMember member_my_bool = TypeObjectUtils::build_complete_struct_member(common_my_bool, detail_my_bool); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_bool); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_byte", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_octet Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_octet = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_octet; - MemberId member_id_my_octet = 0x00000001; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_octet = TypeObjectUtils::build_common_struct_member(member_id_my_octet, member_flags_my_octet, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_octet = TypeObjectUtils::build_common_struct_member(member_id_my_octet, member_flags_my_octet, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_octet member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_octet = "my_octet"; - eprosima::fastcdr::optional member_ann_builtin_my_octet; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_octet = TypeObjectUtils::build_complete_member_detail(name_my_octet, member_ann_builtin_my_octet, ann_custom_BasicStruct); - CompleteStructMember member_my_octet = TypeObjectUtils::build_complete_struct_member(common_my_octet, detail_my_octet); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_octet); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int16_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_int16 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_int16 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_int16; - MemberId member_id_my_int16 = 0x00000002; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_int16 = TypeObjectUtils::build_common_struct_member(member_id_my_int16, member_flags_my_int16, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_int16 = TypeObjectUtils::build_common_struct_member(member_id_my_int16, member_flags_my_int16, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_int16 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_int16 = "my_int16"; - eprosima::fastcdr::optional member_ann_builtin_my_int16; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_int16 = TypeObjectUtils::build_complete_member_detail(name_my_int16, member_ann_builtin_my_int16, ann_custom_BasicStruct); - CompleteStructMember member_my_int16 = TypeObjectUtils::build_complete_struct_member(common_my_int16, detail_my_int16); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_int16); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_int32 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_int32 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_int32; - MemberId member_id_my_int32 = 0x00000003; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_int32 = TypeObjectUtils::build_common_struct_member(member_id_my_int32, member_flags_my_int32, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_int32 = TypeObjectUtils::build_common_struct_member(member_id_my_int32, member_flags_my_int32, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_int32 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_int32 = "my_int32"; - eprosima::fastcdr::optional member_ann_builtin_my_int32; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_int32 = TypeObjectUtils::build_complete_member_detail(name_my_int32, member_ann_builtin_my_int32, ann_custom_BasicStruct); - CompleteStructMember member_my_int32 = TypeObjectUtils::build_complete_struct_member(common_my_int32, detail_my_int32); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_int32); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int64_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_int64 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_int64 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_int64; - MemberId member_id_my_int64 = 0x00000004; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_int64 = TypeObjectUtils::build_common_struct_member(member_id_my_int64, member_flags_my_int64, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_int64 = TypeObjectUtils::build_common_struct_member(member_id_my_int64, member_flags_my_int64, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_int64 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_int64 = "my_int64"; - eprosima::fastcdr::optional member_ann_builtin_my_int64; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_int64 = TypeObjectUtils::build_complete_member_detail(name_my_int64, member_ann_builtin_my_int64, ann_custom_BasicStruct); - CompleteStructMember member_my_int64 = TypeObjectUtils::build_complete_struct_member(common_my_int64, detail_my_int64); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_int64); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_uint16_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_uint16 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_uint16 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_uint16; - MemberId member_id_my_uint16 = 0x00000005; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_uint16 = TypeObjectUtils::build_common_struct_member(member_id_my_uint16, member_flags_my_uint16, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_uint16 = TypeObjectUtils::build_common_struct_member(member_id_my_uint16, member_flags_my_uint16, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_uint16 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_uint16 = "my_uint16"; - eprosima::fastcdr::optional member_ann_builtin_my_uint16; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_uint16 = TypeObjectUtils::build_complete_member_detail(name_my_uint16, member_ann_builtin_my_uint16, ann_custom_BasicStruct); - CompleteStructMember member_my_uint16 = TypeObjectUtils::build_complete_struct_member(common_my_uint16, detail_my_uint16); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_uint16); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_uint32_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_uint32 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_uint32 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_uint32; - MemberId member_id_my_uint32 = 0x00000006; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_uint32 = TypeObjectUtils::build_common_struct_member(member_id_my_uint32, member_flags_my_uint32, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_uint32 = TypeObjectUtils::build_common_struct_member(member_id_my_uint32, member_flags_my_uint32, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_uint32 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_uint32 = "my_uint32"; - eprosima::fastcdr::optional member_ann_builtin_my_uint32; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_uint32 = TypeObjectUtils::build_complete_member_detail(name_my_uint32, member_ann_builtin_my_uint32, ann_custom_BasicStruct); - CompleteStructMember member_my_uint32 = TypeObjectUtils::build_complete_struct_member(common_my_uint32, detail_my_uint32); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_uint32); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_uint64_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_uint64 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_uint64 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_uint64; - MemberId member_id_my_uint64 = 0x00000007; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_uint64 = TypeObjectUtils::build_common_struct_member(member_id_my_uint64, member_flags_my_uint64, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_uint64 = TypeObjectUtils::build_common_struct_member(member_id_my_uint64, member_flags_my_uint64, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_uint64 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_uint64 = "my_uint64"; - eprosima::fastcdr::optional member_ann_builtin_my_uint64; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_uint64 = TypeObjectUtils::build_complete_member_detail(name_my_uint64, member_ann_builtin_my_uint64, ann_custom_BasicStruct); - CompleteStructMember member_my_uint64 = TypeObjectUtils::build_complete_struct_member(common_my_uint64, detail_my_uint64); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_uint64); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_float", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_float32 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_float32 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_float32; - MemberId member_id_my_float32 = 0x00000008; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_float32 = TypeObjectUtils::build_common_struct_member(member_id_my_float32, member_flags_my_float32, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_float32 = TypeObjectUtils::build_common_struct_member(member_id_my_float32, member_flags_my_float32, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_float32 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_float32 = "my_float32"; - eprosima::fastcdr::optional member_ann_builtin_my_float32; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_float32 = TypeObjectUtils::build_complete_member_detail(name_my_float32, member_ann_builtin_my_float32, ann_custom_BasicStruct); - CompleteStructMember member_my_float32 = TypeObjectUtils::build_complete_struct_member(common_my_float32, detail_my_float32); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_float32); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_double", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_float64 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_float64 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_float64; - MemberId member_id_my_float64 = 0x00000009; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_float64 = TypeObjectUtils::build_common_struct_member(member_id_my_float64, member_flags_my_float64, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_float64 = TypeObjectUtils::build_common_struct_member(member_id_my_float64, member_flags_my_float64, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_float64 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_float64 = "my_float64"; - eprosima::fastcdr::optional member_ann_builtin_my_float64; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_float64 = TypeObjectUtils::build_complete_member_detail(name_my_float64, member_ann_builtin_my_float64, ann_custom_BasicStruct); - CompleteStructMember member_my_float64 = TypeObjectUtils::build_complete_struct_member(common_my_float64, detail_my_float64); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_float64); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_longdouble", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_float128 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_float128 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_float128; - MemberId member_id_my_float128 = 0x0000000a; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_float128 = TypeObjectUtils::build_common_struct_member(member_id_my_float128, member_flags_my_float128, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_float128 = TypeObjectUtils::build_common_struct_member(member_id_my_float128, member_flags_my_float128, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_float128 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_float128 = "my_float128"; - eprosima::fastcdr::optional member_ann_builtin_my_float128; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_float128 = TypeObjectUtils::build_complete_member_detail(name_my_float128, member_ann_builtin_my_float128, ann_custom_BasicStruct); - CompleteStructMember member_my_float128 = TypeObjectUtils::build_complete_struct_member(common_my_float128, detail_my_float128); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_float128); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_char", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_char Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_char = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_char; - MemberId member_id_my_char = 0x0000000b; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_char = TypeObjectUtils::build_common_struct_member(member_id_my_char, member_flags_my_char, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_char = TypeObjectUtils::build_common_struct_member(member_id_my_char, member_flags_my_char, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_char member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_char = "my_char"; - eprosima::fastcdr::optional member_ann_builtin_my_char; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_char = TypeObjectUtils::build_complete_member_detail(name_my_char, member_ann_builtin_my_char, ann_custom_BasicStruct); - CompleteStructMember member_my_char = TypeObjectUtils::build_complete_struct_member(common_my_char, detail_my_char); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_char); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_string_unbounded", type_ids_BasicStruct); - - if (return_code_BasicStruct != 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_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_string_unbounded", type_ids_BasicStruct); - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_string_unbounded: Given String TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_string = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_string; - MemberId member_id_my_string = 0x0000000c; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_string = TypeObjectUtils::build_common_struct_member(member_id_my_string, member_flags_my_string, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_string = TypeObjectUtils::build_common_struct_member(member_id_my_string, member_flags_my_string, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_string member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_string = "my_string"; - eprosima::fastcdr::optional member_ann_builtin_my_string; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_string = TypeObjectUtils::build_complete_member_detail(name_my_string, member_ann_builtin_my_string, ann_custom_BasicStruct); - CompleteStructMember member_my_string = TypeObjectUtils::build_complete_struct_member(common_my_string, detail_my_string); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_string); - } - CompleteStructType struct_type_BasicStruct = TypeObjectUtils::build_complete_struct_type(struct_flags_BasicStruct, header_BasicStruct, member_seq_BasicStruct); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_BasicStruct, type_name_BasicStruct.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "BasicStruct already registered in TypeObjectRegistry for a different type."); - } - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "BasicStruct", type_ids_BasicStruct); - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "BasicStruct: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } -} -void register_ComplexStruct_type_identifier() -{ - { - StructTypeFlag struct_flags_ComplexStruct = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_ComplexStruct; - TypeIdentifierPair type_ids_ComplexStruct; - QualifiedTypeName type_name_ComplexStruct = "ComplexStruct"; - eprosima::fastcdr::optional type_ann_builtin_ComplexStruct; - eprosima::fastcdr::optional ann_custom_ComplexStruct; - CompleteTypeDetail detail_ComplexStruct = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_ComplexStruct, ann_custom_ComplexStruct, type_name_ComplexStruct.to_string()); - CompleteStructHeader header_ComplexStruct; - header_ComplexStruct = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_ComplexStruct); - CompleteStructMemberSeq member_seq_ComplexStruct; - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_byte", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_octet Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_octet = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_octet; - MemberId member_id_my_octet = 0x00000000; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_octet = TypeObjectUtils::build_common_struct_member(member_id_my_octet, member_flags_my_octet, type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_octet = TypeObjectUtils::build_common_struct_member(member_id_my_octet, member_flags_my_octet, type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_octet member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_octet = "my_octet"; - eprosima::fastcdr::optional member_ann_builtin_my_octet; - ann_custom_ComplexStruct.reset(); - CompleteMemberDetail detail_my_octet = TypeObjectUtils::build_complete_member_detail(name_my_octet, member_ann_builtin_my_octet, ann_custom_ComplexStruct); - CompleteStructMember member_my_octet = TypeObjectUtils::build_complete_struct_member(common_my_octet, detail_my_octet); - TypeObjectUtils::add_complete_struct_member(member_seq_ComplexStruct, member_my_octet); - } - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "BasicStruct", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - { - StructTypeFlag struct_flags_BasicStruct = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_BasicStruct; - TypeIdentifierPair type_ids_BasicStruct; - QualifiedTypeName type_name_BasicStruct = "BasicStruct"; - eprosima::fastcdr::optional type_ann_builtin_BasicStruct; - eprosima::fastcdr::optional ann_custom_BasicStruct; - CompleteTypeDetail detail_BasicStruct = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_BasicStruct, ann_custom_BasicStruct, type_name_BasicStruct.to_string()); - CompleteStructHeader header_BasicStruct; - header_BasicStruct = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_BasicStruct); - CompleteStructMemberSeq member_seq_BasicStruct; - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_bool", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_bool Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_bool = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_bool; - MemberId member_id_my_bool = 0x00000000; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_bool = TypeObjectUtils::build_common_struct_member(member_id_my_bool, member_flags_my_bool, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_bool = TypeObjectUtils::build_common_struct_member(member_id_my_bool, member_flags_my_bool, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_bool member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_bool = "my_bool"; - eprosima::fastcdr::optional member_ann_builtin_my_bool; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_bool = TypeObjectUtils::build_complete_member_detail(name_my_bool, member_ann_builtin_my_bool, ann_custom_BasicStruct); - CompleteStructMember member_my_bool = TypeObjectUtils::build_complete_struct_member(common_my_bool, detail_my_bool); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_bool); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_byte", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_octet Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_octet = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_octet; - MemberId member_id_my_octet = 0x00000001; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_octet = TypeObjectUtils::build_common_struct_member(member_id_my_octet, member_flags_my_octet, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_octet = TypeObjectUtils::build_common_struct_member(member_id_my_octet, member_flags_my_octet, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_octet member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_octet = "my_octet"; - eprosima::fastcdr::optional member_ann_builtin_my_octet; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_octet = TypeObjectUtils::build_complete_member_detail(name_my_octet, member_ann_builtin_my_octet, ann_custom_BasicStruct); - CompleteStructMember member_my_octet = TypeObjectUtils::build_complete_struct_member(common_my_octet, detail_my_octet); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_octet); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int16_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_int16 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_int16 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_int16; - MemberId member_id_my_int16 = 0x00000002; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_int16 = TypeObjectUtils::build_common_struct_member(member_id_my_int16, member_flags_my_int16, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_int16 = TypeObjectUtils::build_common_struct_member(member_id_my_int16, member_flags_my_int16, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_int16 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_int16 = "my_int16"; - eprosima::fastcdr::optional member_ann_builtin_my_int16; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_int16 = TypeObjectUtils::build_complete_member_detail(name_my_int16, member_ann_builtin_my_int16, ann_custom_BasicStruct); - CompleteStructMember member_my_int16 = TypeObjectUtils::build_complete_struct_member(common_my_int16, detail_my_int16); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_int16); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_int32 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_int32 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_int32; - MemberId member_id_my_int32 = 0x00000003; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_int32 = TypeObjectUtils::build_common_struct_member(member_id_my_int32, member_flags_my_int32, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_int32 = TypeObjectUtils::build_common_struct_member(member_id_my_int32, member_flags_my_int32, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_int32 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_int32 = "my_int32"; - eprosima::fastcdr::optional member_ann_builtin_my_int32; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_int32 = TypeObjectUtils::build_complete_member_detail(name_my_int32, member_ann_builtin_my_int32, ann_custom_BasicStruct); - CompleteStructMember member_my_int32 = TypeObjectUtils::build_complete_struct_member(common_my_int32, detail_my_int32); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_int32); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int64_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_int64 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_int64 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_int64; - MemberId member_id_my_int64 = 0x00000004; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_int64 = TypeObjectUtils::build_common_struct_member(member_id_my_int64, member_flags_my_int64, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_int64 = TypeObjectUtils::build_common_struct_member(member_id_my_int64, member_flags_my_int64, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_int64 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_int64 = "my_int64"; - eprosima::fastcdr::optional member_ann_builtin_my_int64; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_int64 = TypeObjectUtils::build_complete_member_detail(name_my_int64, member_ann_builtin_my_int64, ann_custom_BasicStruct); - CompleteStructMember member_my_int64 = TypeObjectUtils::build_complete_struct_member(common_my_int64, detail_my_int64); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_int64); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_uint16_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_uint16 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_uint16 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_uint16; - MemberId member_id_my_uint16 = 0x00000005; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_uint16 = TypeObjectUtils::build_common_struct_member(member_id_my_uint16, member_flags_my_uint16, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_uint16 = TypeObjectUtils::build_common_struct_member(member_id_my_uint16, member_flags_my_uint16, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_uint16 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_uint16 = "my_uint16"; - eprosima::fastcdr::optional member_ann_builtin_my_uint16; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_uint16 = TypeObjectUtils::build_complete_member_detail(name_my_uint16, member_ann_builtin_my_uint16, ann_custom_BasicStruct); - CompleteStructMember member_my_uint16 = TypeObjectUtils::build_complete_struct_member(common_my_uint16, detail_my_uint16); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_uint16); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_uint32_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_uint32 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_uint32 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_uint32; - MemberId member_id_my_uint32 = 0x00000006; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_uint32 = TypeObjectUtils::build_common_struct_member(member_id_my_uint32, member_flags_my_uint32, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_uint32 = TypeObjectUtils::build_common_struct_member(member_id_my_uint32, member_flags_my_uint32, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_uint32 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_uint32 = "my_uint32"; - eprosima::fastcdr::optional member_ann_builtin_my_uint32; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_uint32 = TypeObjectUtils::build_complete_member_detail(name_my_uint32, member_ann_builtin_my_uint32, ann_custom_BasicStruct); - CompleteStructMember member_my_uint32 = TypeObjectUtils::build_complete_struct_member(common_my_uint32, detail_my_uint32); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_uint32); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_uint64_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_uint64 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_uint64 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_uint64; - MemberId member_id_my_uint64 = 0x00000007; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_uint64 = TypeObjectUtils::build_common_struct_member(member_id_my_uint64, member_flags_my_uint64, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_uint64 = TypeObjectUtils::build_common_struct_member(member_id_my_uint64, member_flags_my_uint64, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_uint64 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_uint64 = "my_uint64"; - eprosima::fastcdr::optional member_ann_builtin_my_uint64; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_uint64 = TypeObjectUtils::build_complete_member_detail(name_my_uint64, member_ann_builtin_my_uint64, ann_custom_BasicStruct); - CompleteStructMember member_my_uint64 = TypeObjectUtils::build_complete_struct_member(common_my_uint64, detail_my_uint64); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_uint64); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_float", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_float32 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_float32 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_float32; - MemberId member_id_my_float32 = 0x00000008; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_float32 = TypeObjectUtils::build_common_struct_member(member_id_my_float32, member_flags_my_float32, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_float32 = TypeObjectUtils::build_common_struct_member(member_id_my_float32, member_flags_my_float32, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_float32 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_float32 = "my_float32"; - eprosima::fastcdr::optional member_ann_builtin_my_float32; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_float32 = TypeObjectUtils::build_complete_member_detail(name_my_float32, member_ann_builtin_my_float32, ann_custom_BasicStruct); - CompleteStructMember member_my_float32 = TypeObjectUtils::build_complete_struct_member(common_my_float32, detail_my_float32); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_float32); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_double", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_float64 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_float64 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_float64; - MemberId member_id_my_float64 = 0x00000009; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_float64 = TypeObjectUtils::build_common_struct_member(member_id_my_float64, member_flags_my_float64, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_float64 = TypeObjectUtils::build_common_struct_member(member_id_my_float64, member_flags_my_float64, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_float64 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_float64 = "my_float64"; - eprosima::fastcdr::optional member_ann_builtin_my_float64; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_float64 = TypeObjectUtils::build_complete_member_detail(name_my_float64, member_ann_builtin_my_float64, ann_custom_BasicStruct); - CompleteStructMember member_my_float64 = TypeObjectUtils::build_complete_struct_member(common_my_float64, detail_my_float64); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_float64); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_longdouble", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_float128 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_float128 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_float128; - MemberId member_id_my_float128 = 0x0000000a; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_float128 = TypeObjectUtils::build_common_struct_member(member_id_my_float128, member_flags_my_float128, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_float128 = TypeObjectUtils::build_common_struct_member(member_id_my_float128, member_flags_my_float128, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_float128 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_float128 = "my_float128"; - eprosima::fastcdr::optional member_ann_builtin_my_float128; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_float128 = TypeObjectUtils::build_complete_member_detail(name_my_float128, member_ann_builtin_my_float128, ann_custom_BasicStruct); - CompleteStructMember member_my_float128 = TypeObjectUtils::build_complete_struct_member(common_my_float128, detail_my_float128); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_float128); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_char", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_char Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_char = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_char; - MemberId member_id_my_char = 0x0000000b; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_char = TypeObjectUtils::build_common_struct_member(member_id_my_char, member_flags_my_char, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_char = TypeObjectUtils::build_common_struct_member(member_id_my_char, member_flags_my_char, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_char member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_char = "my_char"; - eprosima::fastcdr::optional member_ann_builtin_my_char; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_char = TypeObjectUtils::build_complete_member_detail(name_my_char, member_ann_builtin_my_char, ann_custom_BasicStruct); - CompleteStructMember member_my_char = TypeObjectUtils::build_complete_struct_member(common_my_char, detail_my_char); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_char); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_string_unbounded", type_ids_BasicStruct); - - if (return_code_BasicStruct != 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_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_string_unbounded", type_ids_BasicStruct); - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_string_unbounded: Given String TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_string = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_string; - MemberId member_id_my_string = 0x0000000c; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_string = TypeObjectUtils::build_common_struct_member(member_id_my_string, member_flags_my_string, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_string = TypeObjectUtils::build_common_struct_member(member_id_my_string, member_flags_my_string, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_string member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_string = "my_string"; - eprosima::fastcdr::optional member_ann_builtin_my_string; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_string = TypeObjectUtils::build_complete_member_detail(name_my_string, member_ann_builtin_my_string, ann_custom_BasicStruct); - CompleteStructMember member_my_string = TypeObjectUtils::build_complete_struct_member(common_my_string, detail_my_string); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_string); - } - CompleteStructType struct_type_BasicStruct = TypeObjectUtils::build_complete_struct_type(struct_flags_BasicStruct, header_BasicStruct, member_seq_BasicStruct); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_BasicStruct, type_name_BasicStruct.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "BasicStruct already registered in TypeObjectRegistry for a different type."); - } - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "BasicStruct", type_ids_BasicStruct); - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "BasicStruct: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - } - StructMemberFlag member_flags_my_basic_struct = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_basic_struct; - MemberId member_id_my_basic_struct = 0x00000001; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_basic_struct = TypeObjectUtils::build_common_struct_member(member_id_my_basic_struct, member_flags_my_basic_struct, type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_basic_struct = TypeObjectUtils::build_common_struct_member(member_id_my_basic_struct, member_flags_my_basic_struct, type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_basic_struct member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_basic_struct = "my_basic_struct"; - eprosima::fastcdr::optional member_ann_builtin_my_basic_struct; - ann_custom_ComplexStruct.reset(); - CompleteMemberDetail detail_my_basic_struct = TypeObjectUtils::build_complete_member_detail(name_my_basic_struct, member_ann_builtin_my_basic_struct, ann_custom_ComplexStruct); - CompleteStructMember member_my_basic_struct = TypeObjectUtils::build_complete_struct_member(common_my_basic_struct, detail_my_basic_struct); - TypeObjectUtils::add_complete_struct_member(member_seq_ComplexStruct, member_my_basic_struct); - } - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyAliasEnum", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - AliasTypeFlag alias_flags_MyAliasEnum = 0; - QualifiedTypeName type_name_MyAliasEnum = "MyAliasEnum"; - eprosima::fastcdr::optional type_ann_builtin_MyAliasEnum; - eprosima::fastcdr::optional ann_custom_MyAliasEnum; - CompleteTypeDetail detail_MyAliasEnum = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_MyAliasEnum, ann_custom_MyAliasEnum, type_name_MyAliasEnum.to_string()); - CompleteAliasHeader header_MyAliasEnum = TypeObjectUtils::build_complete_alias_header(detail_MyAliasEnum); - AliasMemberFlag related_flags_MyAliasEnum = 0; - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyEnum", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EnumTypeFlag enum_flags_MyEnum = 0; - BitBound bit_bound_MyEnum = 32; - CommonEnumeratedHeader common_MyEnum = TypeObjectUtils::build_common_enumerated_header(bit_bound_MyEnum); - QualifiedTypeName type_name_MyEnum = "MyEnum"; - eprosima::fastcdr::optional type_ann_builtin_MyEnum; - eprosima::fastcdr::optional ann_custom_MyEnum; - CompleteTypeDetail detail_MyEnum = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_MyEnum, ann_custom_MyEnum, type_name_MyEnum.to_string()); - CompleteEnumeratedHeader header_MyEnum = TypeObjectUtils::build_complete_enumerated_header(common_MyEnum, detail_MyEnum); - CompleteEnumeratedLiteralSeq literal_seq_MyEnum; - { - EnumeratedLiteralFlag flags_A = TypeObjectUtils::build_enumerated_literal_flag(false); - CommonEnumeratedLiteral common_A = TypeObjectUtils::build_common_enumerated_literal(0, flags_A); - eprosima::fastcdr::optional member_ann_builtin_A; - ann_custom_MyEnum.reset(); - MemberName name_A = "A"; - CompleteMemberDetail detail_A = TypeObjectUtils::build_complete_member_detail(name_A, member_ann_builtin_A, ann_custom_MyEnum); - CompleteEnumeratedLiteral literal_A = TypeObjectUtils::build_complete_enumerated_literal(common_A, detail_A); - TypeObjectUtils::add_complete_enumerated_literal(literal_seq_MyEnum, literal_A); - } - { - EnumeratedLiteralFlag flags_B = TypeObjectUtils::build_enumerated_literal_flag(false); - CommonEnumeratedLiteral common_B = TypeObjectUtils::build_common_enumerated_literal(1, flags_B); - eprosima::fastcdr::optional member_ann_builtin_B; - ann_custom_MyEnum.reset(); - MemberName name_B = "B"; - CompleteMemberDetail detail_B = TypeObjectUtils::build_complete_member_detail(name_B, member_ann_builtin_B, ann_custom_MyEnum); - CompleteEnumeratedLiteral literal_B = TypeObjectUtils::build_complete_enumerated_literal(common_B, detail_B); - TypeObjectUtils::add_complete_enumerated_literal(literal_seq_MyEnum, literal_B); - } - { - EnumeratedLiteralFlag flags_C = TypeObjectUtils::build_enumerated_literal_flag(false); - CommonEnumeratedLiteral common_C = TypeObjectUtils::build_common_enumerated_literal(2, flags_C); - eprosima::fastcdr::optional member_ann_builtin_C; - ann_custom_MyEnum.reset(); - MemberName name_C = "C"; - CompleteMemberDetail detail_C = TypeObjectUtils::build_complete_member_detail(name_C, member_ann_builtin_C, ann_custom_MyEnum); - CompleteEnumeratedLiteral literal_C = TypeObjectUtils::build_complete_enumerated_literal(common_C, detail_C); - TypeObjectUtils::add_complete_enumerated_literal(literal_seq_MyEnum, literal_C); - } - CompleteEnumeratedType enumerated_type_MyEnum = TypeObjectUtils::build_complete_enumerated_type(enum_flags_MyEnum, header_MyEnum, - literal_seq_MyEnum); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_enumerated_type_object(enumerated_type_MyEnum, type_name_MyEnum.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyEnum already registered in TypeObjectRegistry for a different type."); - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyEnum", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyEnum: Given Enum TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - CommonAliasBody common_MyAliasEnum; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_MyAliasEnum = TypeObjectUtils::build_common_alias_body(related_flags_MyAliasEnum, type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_MyAliasEnum = TypeObjectUtils::build_common_alias_body(related_flags_MyAliasEnum, type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyAliasEnum related TypeIdentifier inconsistent."); - return; - } - eprosima::fastcdr::optional member_ann_builtin_MyAliasEnum; - ann_custom_MyAliasEnum.reset(); - CompleteAliasBody body_MyAliasEnum = TypeObjectUtils::build_complete_alias_body(common_MyAliasEnum, member_ann_builtin_MyAliasEnum, ann_custom_MyAliasEnum); - CompleteAliasType alias_type_MyAliasEnum = TypeObjectUtils::build_complete_alias_type(alias_flags_MyAliasEnum, header_MyAliasEnum, body_MyAliasEnum); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_alias_type_object(alias_type_MyAliasEnum, type_name_MyAliasEnum.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyAliasEnum already registered in TypeObjectRegistry for a different type."); - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyAliasEnum", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyAliasEnum: Given Alias TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_alias_enum = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_alias_enum; - MemberId member_id_my_alias_enum = 0x00000002; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_alias_enum = TypeObjectUtils::build_common_struct_member(member_id_my_alias_enum, member_flags_my_alias_enum, type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_alias_enum = TypeObjectUtils::build_common_struct_member(member_id_my_alias_enum, member_flags_my_alias_enum, type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_alias_enum member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_alias_enum = "my_alias_enum"; - eprosima::fastcdr::optional member_ann_builtin_my_alias_enum; - ann_custom_ComplexStruct.reset(); - CompleteMemberDetail detail_my_alias_enum = TypeObjectUtils::build_complete_member_detail(name_my_alias_enum, member_ann_builtin_my_alias_enum, ann_custom_ComplexStruct); - CompleteStructMember member_my_alias_enum = TypeObjectUtils::build_complete_struct_member(common_my_alias_enum, detail_my_alias_enum); - TypeObjectUtils::add_complete_struct_member(member_seq_ComplexStruct, member_my_alias_enum); - } - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyEnum", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EnumTypeFlag enum_flags_MyEnum = 0; - BitBound bit_bound_MyEnum = 32; - CommonEnumeratedHeader common_MyEnum = TypeObjectUtils::build_common_enumerated_header(bit_bound_MyEnum); - QualifiedTypeName type_name_MyEnum = "MyEnum"; - eprosima::fastcdr::optional type_ann_builtin_MyEnum; - eprosima::fastcdr::optional ann_custom_MyEnum; - CompleteTypeDetail detail_MyEnum = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_MyEnum, ann_custom_MyEnum, type_name_MyEnum.to_string()); - CompleteEnumeratedHeader header_MyEnum = TypeObjectUtils::build_complete_enumerated_header(common_MyEnum, detail_MyEnum); - CompleteEnumeratedLiteralSeq literal_seq_MyEnum; - { - EnumeratedLiteralFlag flags_A = TypeObjectUtils::build_enumerated_literal_flag(false); - CommonEnumeratedLiteral common_A = TypeObjectUtils::build_common_enumerated_literal(0, flags_A); - eprosima::fastcdr::optional member_ann_builtin_A; - ann_custom_MyEnum.reset(); - MemberName name_A = "A"; - CompleteMemberDetail detail_A = TypeObjectUtils::build_complete_member_detail(name_A, member_ann_builtin_A, ann_custom_MyEnum); - CompleteEnumeratedLiteral literal_A = TypeObjectUtils::build_complete_enumerated_literal(common_A, detail_A); - TypeObjectUtils::add_complete_enumerated_literal(literal_seq_MyEnum, literal_A); - } - { - EnumeratedLiteralFlag flags_B = TypeObjectUtils::build_enumerated_literal_flag(false); - CommonEnumeratedLiteral common_B = TypeObjectUtils::build_common_enumerated_literal(1, flags_B); - eprosima::fastcdr::optional member_ann_builtin_B; - ann_custom_MyEnum.reset(); - MemberName name_B = "B"; - CompleteMemberDetail detail_B = TypeObjectUtils::build_complete_member_detail(name_B, member_ann_builtin_B, ann_custom_MyEnum); - CompleteEnumeratedLiteral literal_B = TypeObjectUtils::build_complete_enumerated_literal(common_B, detail_B); - TypeObjectUtils::add_complete_enumerated_literal(literal_seq_MyEnum, literal_B); - } - { - EnumeratedLiteralFlag flags_C = TypeObjectUtils::build_enumerated_literal_flag(false); - CommonEnumeratedLiteral common_C = TypeObjectUtils::build_common_enumerated_literal(2, flags_C); - eprosima::fastcdr::optional member_ann_builtin_C; - ann_custom_MyEnum.reset(); - MemberName name_C = "C"; - CompleteMemberDetail detail_C = TypeObjectUtils::build_complete_member_detail(name_C, member_ann_builtin_C, ann_custom_MyEnum); - CompleteEnumeratedLiteral literal_C = TypeObjectUtils::build_complete_enumerated_literal(common_C, detail_C); - TypeObjectUtils::add_complete_enumerated_literal(literal_seq_MyEnum, literal_C); - } - CompleteEnumeratedType enumerated_type_MyEnum = TypeObjectUtils::build_complete_enumerated_type(enum_flags_MyEnum, header_MyEnum, - literal_seq_MyEnum); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_enumerated_type_object(enumerated_type_MyEnum, type_name_MyEnum.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyEnum already registered in TypeObjectRegistry for a different type."); - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyEnum", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyEnum: Given Enum TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_enum = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_enum; - MemberId member_id_my_enum = 0x00000003; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_enum = TypeObjectUtils::build_common_struct_member(member_id_my_enum, member_flags_my_enum, type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_enum = TypeObjectUtils::build_common_struct_member(member_id_my_enum, member_flags_my_enum, type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_enum member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_enum = "my_enum"; - eprosima::fastcdr::optional member_ann_builtin_my_enum; - ann_custom_ComplexStruct.reset(); - CompleteMemberDetail detail_my_enum = TypeObjectUtils::build_complete_member_detail(name_my_enum, member_ann_builtin_my_enum, ann_custom_ComplexStruct); - CompleteStructMember member_my_enum = TypeObjectUtils::build_complete_struct_member(common_my_enum, detail_my_enum); - TypeObjectUtils::add_complete_struct_member(member_seq_ComplexStruct, member_my_enum); - } - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_sequence_uint8_t_55", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_byte", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != 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_55 {nullptr}; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_sequence_uint8_t_55 = new TypeIdentifier(type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_sequence_uint8_t_55 = new TypeIdentifier(type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Sequence element TypeIdentifier inconsistent."); - return; - } - EquivalenceKind equiv_kind_anonymous_sequence_uint8_t_55 = EK_COMPLETE; - if (TK_NONE == type_ids_ComplexStruct.type_identifier2()._d()) - { - equiv_kind_anonymous_sequence_uint8_t_55 = EK_BOTH; - } - CollectionElementFlag element_flags_anonymous_sequence_uint8_t_55 = 0; - PlainCollectionHeader header_anonymous_sequence_uint8_t_55 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_sequence_uint8_t_55, element_flags_anonymous_sequence_uint8_t_55); - std::string type_id_kind_anonymous_sequence_uint8_t_55("TI_PLAIN_SEQUENCE_SMALL"); - if (type_id_kind_anonymous_sequence_uint8_t_55 == "TI_PLAIN_SEQUENCE_SMALL") - { - SBound bound = static_cast(55); - PlainSequenceSElemDefn seq_sdefn = TypeObjectUtils::build_plain_sequence_s_elem_defn(header_anonymous_sequence_uint8_t_55, bound, - eprosima::fastcdr::external(element_identifier_anonymous_sequence_uint8_t_55)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_s_sequence_type_identifier(seq_sdefn, "anonymous_sequence_uint8_t_55")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_sequence_uint8_t_55 already registered in TypeObjectRegistry for a different type."); - } - } - else - { - LBound bound = 55; - PlainSequenceLElemDefn seq_ldefn = TypeObjectUtils::build_plain_sequence_l_elem_defn(header_anonymous_sequence_uint8_t_55, bound, - eprosima::fastcdr::external(element_identifier_anonymous_sequence_uint8_t_55)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_l_sequence_type_identifier(seq_ldefn, "anonymous_sequence_uint8_t_55")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_sequence_uint8_t_55 already registered in TypeObjectRegistry for a different type."); - } - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_sequence_uint8_t_55", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_sequence_uint8_t_55: Given Sequence TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_sequence_octet = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_sequence_octet; - MemberId member_id_my_sequence_octet = 0x00000004; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_sequence_octet = TypeObjectUtils::build_common_struct_member(member_id_my_sequence_octet, member_flags_my_sequence_octet, type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_sequence_octet = TypeObjectUtils::build_common_struct_member(member_id_my_sequence_octet, member_flags_my_sequence_octet, type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_sequence_octet member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_sequence_octet = "my_sequence_octet"; - eprosima::fastcdr::optional member_ann_builtin_my_sequence_octet; - ann_custom_ComplexStruct.reset(); - CompleteMemberDetail detail_my_sequence_octet = TypeObjectUtils::build_complete_member_detail(name_my_sequence_octet, member_ann_builtin_my_sequence_octet, ann_custom_ComplexStruct); - CompleteStructMember member_my_sequence_octet = TypeObjectUtils::build_complete_struct_member(common_my_sequence_octet, detail_my_sequence_octet); - TypeObjectUtils::add_complete_struct_member(member_seq_ComplexStruct, member_my_sequence_octet); - } - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_sequence_BasicStruct_unbounded", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "BasicStruct", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - { - StructTypeFlag struct_flags_BasicStruct = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_BasicStruct; - TypeIdentifierPair type_ids_BasicStruct; - QualifiedTypeName type_name_BasicStruct = "BasicStruct"; - eprosima::fastcdr::optional type_ann_builtin_BasicStruct; - eprosima::fastcdr::optional ann_custom_BasicStruct; - CompleteTypeDetail detail_BasicStruct = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_BasicStruct, ann_custom_BasicStruct, type_name_BasicStruct.to_string()); - CompleteStructHeader header_BasicStruct; - header_BasicStruct = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_BasicStruct); - CompleteStructMemberSeq member_seq_BasicStruct; - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_bool", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_bool Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_bool = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_bool; - MemberId member_id_my_bool = 0x00000000; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_bool = TypeObjectUtils::build_common_struct_member(member_id_my_bool, member_flags_my_bool, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_bool = TypeObjectUtils::build_common_struct_member(member_id_my_bool, member_flags_my_bool, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_bool member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_bool = "my_bool"; - eprosima::fastcdr::optional member_ann_builtin_my_bool; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_bool = TypeObjectUtils::build_complete_member_detail(name_my_bool, member_ann_builtin_my_bool, ann_custom_BasicStruct); - CompleteStructMember member_my_bool = TypeObjectUtils::build_complete_struct_member(common_my_bool, detail_my_bool); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_bool); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_byte", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_octet Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_octet = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_octet; - MemberId member_id_my_octet = 0x00000001; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_octet = TypeObjectUtils::build_common_struct_member(member_id_my_octet, member_flags_my_octet, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_octet = TypeObjectUtils::build_common_struct_member(member_id_my_octet, member_flags_my_octet, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_octet member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_octet = "my_octet"; - eprosima::fastcdr::optional member_ann_builtin_my_octet; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_octet = TypeObjectUtils::build_complete_member_detail(name_my_octet, member_ann_builtin_my_octet, ann_custom_BasicStruct); - CompleteStructMember member_my_octet = TypeObjectUtils::build_complete_struct_member(common_my_octet, detail_my_octet); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_octet); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int16_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_int16 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_int16 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_int16; - MemberId member_id_my_int16 = 0x00000002; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_int16 = TypeObjectUtils::build_common_struct_member(member_id_my_int16, member_flags_my_int16, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_int16 = TypeObjectUtils::build_common_struct_member(member_id_my_int16, member_flags_my_int16, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_int16 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_int16 = "my_int16"; - eprosima::fastcdr::optional member_ann_builtin_my_int16; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_int16 = TypeObjectUtils::build_complete_member_detail(name_my_int16, member_ann_builtin_my_int16, ann_custom_BasicStruct); - CompleteStructMember member_my_int16 = TypeObjectUtils::build_complete_struct_member(common_my_int16, detail_my_int16); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_int16); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_int32 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_int32 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_int32; - MemberId member_id_my_int32 = 0x00000003; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_int32 = TypeObjectUtils::build_common_struct_member(member_id_my_int32, member_flags_my_int32, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_int32 = TypeObjectUtils::build_common_struct_member(member_id_my_int32, member_flags_my_int32, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_int32 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_int32 = "my_int32"; - eprosima::fastcdr::optional member_ann_builtin_my_int32; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_int32 = TypeObjectUtils::build_complete_member_detail(name_my_int32, member_ann_builtin_my_int32, ann_custom_BasicStruct); - CompleteStructMember member_my_int32 = TypeObjectUtils::build_complete_struct_member(common_my_int32, detail_my_int32); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_int32); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int64_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_int64 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_int64 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_int64; - MemberId member_id_my_int64 = 0x00000004; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_int64 = TypeObjectUtils::build_common_struct_member(member_id_my_int64, member_flags_my_int64, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_int64 = TypeObjectUtils::build_common_struct_member(member_id_my_int64, member_flags_my_int64, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_int64 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_int64 = "my_int64"; - eprosima::fastcdr::optional member_ann_builtin_my_int64; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_int64 = TypeObjectUtils::build_complete_member_detail(name_my_int64, member_ann_builtin_my_int64, ann_custom_BasicStruct); - CompleteStructMember member_my_int64 = TypeObjectUtils::build_complete_struct_member(common_my_int64, detail_my_int64); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_int64); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_uint16_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_uint16 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_uint16 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_uint16; - MemberId member_id_my_uint16 = 0x00000005; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_uint16 = TypeObjectUtils::build_common_struct_member(member_id_my_uint16, member_flags_my_uint16, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_uint16 = TypeObjectUtils::build_common_struct_member(member_id_my_uint16, member_flags_my_uint16, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_uint16 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_uint16 = "my_uint16"; - eprosima::fastcdr::optional member_ann_builtin_my_uint16; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_uint16 = TypeObjectUtils::build_complete_member_detail(name_my_uint16, member_ann_builtin_my_uint16, ann_custom_BasicStruct); - CompleteStructMember member_my_uint16 = TypeObjectUtils::build_complete_struct_member(common_my_uint16, detail_my_uint16); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_uint16); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_uint32_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_uint32 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_uint32 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_uint32; - MemberId member_id_my_uint32 = 0x00000006; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_uint32 = TypeObjectUtils::build_common_struct_member(member_id_my_uint32, member_flags_my_uint32, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_uint32 = TypeObjectUtils::build_common_struct_member(member_id_my_uint32, member_flags_my_uint32, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_uint32 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_uint32 = "my_uint32"; - eprosima::fastcdr::optional member_ann_builtin_my_uint32; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_uint32 = TypeObjectUtils::build_complete_member_detail(name_my_uint32, member_ann_builtin_my_uint32, ann_custom_BasicStruct); - CompleteStructMember member_my_uint32 = TypeObjectUtils::build_complete_struct_member(common_my_uint32, detail_my_uint32); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_uint32); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_uint64_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_uint64 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_uint64 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_uint64; - MemberId member_id_my_uint64 = 0x00000007; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_uint64 = TypeObjectUtils::build_common_struct_member(member_id_my_uint64, member_flags_my_uint64, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_uint64 = TypeObjectUtils::build_common_struct_member(member_id_my_uint64, member_flags_my_uint64, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_uint64 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_uint64 = "my_uint64"; - eprosima::fastcdr::optional member_ann_builtin_my_uint64; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_uint64 = TypeObjectUtils::build_complete_member_detail(name_my_uint64, member_ann_builtin_my_uint64, ann_custom_BasicStruct); - CompleteStructMember member_my_uint64 = TypeObjectUtils::build_complete_struct_member(common_my_uint64, detail_my_uint64); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_uint64); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_float", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_float32 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_float32 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_float32; - MemberId member_id_my_float32 = 0x00000008; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_float32 = TypeObjectUtils::build_common_struct_member(member_id_my_float32, member_flags_my_float32, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_float32 = TypeObjectUtils::build_common_struct_member(member_id_my_float32, member_flags_my_float32, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_float32 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_float32 = "my_float32"; - eprosima::fastcdr::optional member_ann_builtin_my_float32; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_float32 = TypeObjectUtils::build_complete_member_detail(name_my_float32, member_ann_builtin_my_float32, ann_custom_BasicStruct); - CompleteStructMember member_my_float32 = TypeObjectUtils::build_complete_struct_member(common_my_float32, detail_my_float32); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_float32); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_double", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_float64 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_float64 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_float64; - MemberId member_id_my_float64 = 0x00000009; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_float64 = TypeObjectUtils::build_common_struct_member(member_id_my_float64, member_flags_my_float64, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_float64 = TypeObjectUtils::build_common_struct_member(member_id_my_float64, member_flags_my_float64, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_float64 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_float64 = "my_float64"; - eprosima::fastcdr::optional member_ann_builtin_my_float64; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_float64 = TypeObjectUtils::build_complete_member_detail(name_my_float64, member_ann_builtin_my_float64, ann_custom_BasicStruct); - CompleteStructMember member_my_float64 = TypeObjectUtils::build_complete_struct_member(common_my_float64, detail_my_float64); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_float64); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_longdouble", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_float128 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_float128 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_float128; - MemberId member_id_my_float128 = 0x0000000a; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_float128 = TypeObjectUtils::build_common_struct_member(member_id_my_float128, member_flags_my_float128, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_float128 = TypeObjectUtils::build_common_struct_member(member_id_my_float128, member_flags_my_float128, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_float128 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_float128 = "my_float128"; - eprosima::fastcdr::optional member_ann_builtin_my_float128; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_float128 = TypeObjectUtils::build_complete_member_detail(name_my_float128, member_ann_builtin_my_float128, ann_custom_BasicStruct); - CompleteStructMember member_my_float128 = TypeObjectUtils::build_complete_struct_member(common_my_float128, detail_my_float128); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_float128); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_char", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_char Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_char = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_char; - MemberId member_id_my_char = 0x0000000b; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_char = TypeObjectUtils::build_common_struct_member(member_id_my_char, member_flags_my_char, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_char = TypeObjectUtils::build_common_struct_member(member_id_my_char, member_flags_my_char, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_char member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_char = "my_char"; - eprosima::fastcdr::optional member_ann_builtin_my_char; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_char = TypeObjectUtils::build_complete_member_detail(name_my_char, member_ann_builtin_my_char, ann_custom_BasicStruct); - CompleteStructMember member_my_char = TypeObjectUtils::build_complete_struct_member(common_my_char, detail_my_char); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_char); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_string_unbounded", type_ids_BasicStruct); - - if (return_code_BasicStruct != 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_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_string_unbounded", type_ids_BasicStruct); - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_string_unbounded: Given String TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_string = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_string; - MemberId member_id_my_string = 0x0000000c; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_string = TypeObjectUtils::build_common_struct_member(member_id_my_string, member_flags_my_string, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_string = TypeObjectUtils::build_common_struct_member(member_id_my_string, member_flags_my_string, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_string member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_string = "my_string"; - eprosima::fastcdr::optional member_ann_builtin_my_string; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_string = TypeObjectUtils::build_complete_member_detail(name_my_string, member_ann_builtin_my_string, ann_custom_BasicStruct); - CompleteStructMember member_my_string = TypeObjectUtils::build_complete_struct_member(common_my_string, detail_my_string); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_string); - } - CompleteStructType struct_type_BasicStruct = TypeObjectUtils::build_complete_struct_type(struct_flags_BasicStruct, header_BasicStruct, member_seq_BasicStruct); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_BasicStruct, type_name_BasicStruct.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "BasicStruct already registered in TypeObjectRegistry for a different type."); - } - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "BasicStruct", type_ids_BasicStruct); - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "BasicStruct: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - } - TypeIdentifier* element_identifier_anonymous_sequence_BasicStruct_unbounded {nullptr}; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_sequence_BasicStruct_unbounded = new TypeIdentifier(type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_sequence_BasicStruct_unbounded = new TypeIdentifier(type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Sequence element TypeIdentifier inconsistent."); - return; - } - EquivalenceKind equiv_kind_anonymous_sequence_BasicStruct_unbounded = EK_COMPLETE; - if (TK_NONE == type_ids_ComplexStruct.type_identifier2()._d()) - { - equiv_kind_anonymous_sequence_BasicStruct_unbounded = EK_BOTH; - } - CollectionElementFlag element_flags_anonymous_sequence_BasicStruct_unbounded = 0; - PlainCollectionHeader header_anonymous_sequence_BasicStruct_unbounded = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_sequence_BasicStruct_unbounded, element_flags_anonymous_sequence_BasicStruct_unbounded); - std::string type_id_kind_anonymous_sequence_BasicStruct_unbounded("TI_PLAIN_SEQUENCE_SMALL"); - if (type_id_kind_anonymous_sequence_BasicStruct_unbounded == "TI_PLAIN_SEQUENCE_SMALL") - { - SBound bound = 0; - PlainSequenceSElemDefn seq_sdefn = TypeObjectUtils::build_plain_sequence_s_elem_defn(header_anonymous_sequence_BasicStruct_unbounded, bound, - eprosima::fastcdr::external(element_identifier_anonymous_sequence_BasicStruct_unbounded)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_s_sequence_type_identifier(seq_sdefn, "anonymous_sequence_BasicStruct_unbounded")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_sequence_BasicStruct_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_BasicStruct_unbounded, bound, - eprosima::fastcdr::external(element_identifier_anonymous_sequence_BasicStruct_unbounded)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_l_sequence_type_identifier(seq_ldefn, "anonymous_sequence_BasicStruct_unbounded")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_sequence_BasicStruct_unbounded already registered in TypeObjectRegistry for a different type."); - } - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_sequence_BasicStruct_unbounded", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_sequence_BasicStruct_unbounded: Given Sequence TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_sequence_struct = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_sequence_struct; - MemberId member_id_my_sequence_struct = 0x00000005; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_sequence_struct = TypeObjectUtils::build_common_struct_member(member_id_my_sequence_struct, member_flags_my_sequence_struct, type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_sequence_struct = TypeObjectUtils::build_common_struct_member(member_id_my_sequence_struct, member_flags_my_sequence_struct, type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_sequence_struct member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_sequence_struct = "my_sequence_struct"; - eprosima::fastcdr::optional member_ann_builtin_my_sequence_struct; - ann_custom_ComplexStruct.reset(); - CompleteMemberDetail detail_my_sequence_struct = TypeObjectUtils::build_complete_member_detail(name_my_sequence_struct, member_ann_builtin_my_sequence_struct, ann_custom_ComplexStruct); - CompleteStructMember member_my_sequence_struct = TypeObjectUtils::build_complete_struct_member(common_my_sequence_struct, detail_my_sequence_struct); - TypeObjectUtils::add_complete_struct_member(member_seq_ComplexStruct, member_my_sequence_struct); - } - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_array_char_500_5_4", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_char", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Array element TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - TypeIdentifier* element_identifier_anonymous_array_char_500_5_4 {nullptr}; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_array_char_500_5_4 = new TypeIdentifier(type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_array_char_500_5_4 = new TypeIdentifier(type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Array element TypeIdentifier inconsistent."); - return; - } - EquivalenceKind equiv_kind_anonymous_array_char_500_5_4 = EK_COMPLETE; - if (TK_NONE == type_ids_ComplexStruct.type_identifier2()._d()) - { - equiv_kind_anonymous_array_char_500_5_4 = EK_BOTH; - } - CollectionElementFlag element_flags_anonymous_array_char_500_5_4 = 0; - PlainCollectionHeader header_anonymous_array_char_500_5_4 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_char_500_5_4, element_flags_anonymous_array_char_500_5_4); - std::string type_id_kind_anonymous_array_char_500_5_4("TI_PLAIN_ARRAY_LARGE"); - if (type_id_kind_anonymous_array_char_500_5_4 == "TI_PLAIN_ARRAY_SMALL") - { - SBoundSeq array_bound_seq; - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(500)); - - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(5)); - - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); - - PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_char_500_5_4, array_bound_seq, - eprosima::fastcdr::external(element_identifier_anonymous_array_char_500_5_4)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_char_500_5_4")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_char_500_5_4 already registered in TypeObjectRegistry for a different type."); - } - } - else - { - LBoundSeq array_bound_seq; - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(500)); - - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(5)); - - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); - - PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_char_500_5_4, array_bound_seq, - eprosima::fastcdr::external(element_identifier_anonymous_array_char_500_5_4)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_char_500_5_4")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_char_500_5_4 already registered in TypeObjectRegistry for a different type."); - } - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_array_char_500_5_4", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_char_500_5_4: Given Array TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_array_octet = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_array_octet; - MemberId member_id_my_array_octet = 0x00000006; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_array_octet = TypeObjectUtils::build_common_struct_member(member_id_my_array_octet, member_flags_my_array_octet, type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_array_octet = TypeObjectUtils::build_common_struct_member(member_id_my_array_octet, member_flags_my_array_octet, type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_array_octet member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_array_octet = "my_array_octet"; - eprosima::fastcdr::optional member_ann_builtin_my_array_octet; - ann_custom_ComplexStruct.reset(); - CompleteMemberDetail detail_my_array_octet = TypeObjectUtils::build_complete_member_detail(name_my_array_octet, member_ann_builtin_my_array_octet, ann_custom_ComplexStruct); - CompleteStructMember member_my_array_octet = TypeObjectUtils::build_complete_struct_member(common_my_array_octet, detail_my_array_octet); - TypeObjectUtils::add_complete_struct_member(member_seq_ComplexStruct, member_my_array_octet); - } - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyOctetArray500", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - AliasTypeFlag alias_flags_MyOctetArray500 = 0; - QualifiedTypeName type_name_MyOctetArray500 = "MyOctetArray500"; - eprosima::fastcdr::optional type_ann_builtin_MyOctetArray500; - eprosima::fastcdr::optional ann_custom_MyOctetArray500; - CompleteTypeDetail detail_MyOctetArray500 = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_MyOctetArray500, ann_custom_MyOctetArray500, type_name_MyOctetArray500.to_string()); - CompleteAliasHeader header_MyOctetArray500 = TypeObjectUtils::build_complete_alias_header(detail_MyOctetArray500); - AliasMemberFlag related_flags_MyOctetArray500 = 0; - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_array_uint8_t_500", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_byte", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Array element TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - TypeIdentifier* element_identifier_anonymous_array_uint8_t_500 {nullptr}; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_array_uint8_t_500 = new TypeIdentifier(type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_array_uint8_t_500 = new TypeIdentifier(type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Array element TypeIdentifier inconsistent."); - return; - } - EquivalenceKind equiv_kind_anonymous_array_uint8_t_500 = EK_COMPLETE; - if (TK_NONE == type_ids_ComplexStruct.type_identifier2()._d()) - { - equiv_kind_anonymous_array_uint8_t_500 = EK_BOTH; - } - CollectionElementFlag element_flags_anonymous_array_uint8_t_500 = 0; - PlainCollectionHeader header_anonymous_array_uint8_t_500 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_500, element_flags_anonymous_array_uint8_t_500); - std::string type_id_kind_anonymous_array_uint8_t_500("TI_PLAIN_ARRAY_LARGE"); - if (type_id_kind_anonymous_array_uint8_t_500 == "TI_PLAIN_ARRAY_SMALL") - { - SBoundSeq array_bound_seq; - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(500)); - - PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_500, array_bound_seq, - eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_500)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_500")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_uint8_t_500 already registered in TypeObjectRegistry for a different type."); - } - } - else - { - LBoundSeq array_bound_seq; - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(500)); - - PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_500, array_bound_seq, - eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_500)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_500")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_uint8_t_500 already registered in TypeObjectRegistry for a different type."); - } - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_array_uint8_t_500", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_uint8_t_500: Given Array TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - CommonAliasBody common_MyOctetArray500; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_MyOctetArray500 = TypeObjectUtils::build_common_alias_body(related_flags_MyOctetArray500, type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_MyOctetArray500 = TypeObjectUtils::build_common_alias_body(related_flags_MyOctetArray500, type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyOctetArray500 related TypeIdentifier inconsistent."); - return; - } - eprosima::fastcdr::optional member_ann_builtin_MyOctetArray500; - ann_custom_MyOctetArray500.reset(); - CompleteAliasBody body_MyOctetArray500 = TypeObjectUtils::build_complete_alias_body(common_MyOctetArray500, member_ann_builtin_MyOctetArray500, ann_custom_MyOctetArray500); - CompleteAliasType alias_type_MyOctetArray500 = TypeObjectUtils::build_complete_alias_type(alias_flags_MyOctetArray500, header_MyOctetArray500, body_MyOctetArray500); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_alias_type_object(alias_type_MyOctetArray500, type_name_MyOctetArray500.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyOctetArray500 already registered in TypeObjectRegistry for a different type."); - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyOctetArray500", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyOctetArray500: Given Alias TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_octet_array_500 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_octet_array_500; - MemberId member_id_my_octet_array_500 = 0x00000007; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_octet_array_500 = TypeObjectUtils::build_common_struct_member(member_id_my_octet_array_500, member_flags_my_octet_array_500, type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_octet_array_500 = TypeObjectUtils::build_common_struct_member(member_id_my_octet_array_500, member_flags_my_octet_array_500, type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_octet_array_500 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_octet_array_500 = "my_octet_array_500"; - eprosima::fastcdr::optional member_ann_builtin_my_octet_array_500; - ann_custom_ComplexStruct.reset(); - CompleteMemberDetail detail_my_octet_array_500 = TypeObjectUtils::build_complete_member_detail(name_my_octet_array_500, member_ann_builtin_my_octet_array_500, ann_custom_ComplexStruct); - CompleteStructMember member_my_octet_array_500 = TypeObjectUtils::build_complete_struct_member(common_my_octet_array_500, detail_my_octet_array_500); - TypeObjectUtils::add_complete_struct_member(member_seq_ComplexStruct, member_my_octet_array_500); - } - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_array_BasicStruct_5", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "BasicStruct", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - { - StructTypeFlag struct_flags_BasicStruct = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_BasicStruct; - TypeIdentifierPair type_ids_BasicStruct; - QualifiedTypeName type_name_BasicStruct = "BasicStruct"; - eprosima::fastcdr::optional type_ann_builtin_BasicStruct; - eprosima::fastcdr::optional ann_custom_BasicStruct; - CompleteTypeDetail detail_BasicStruct = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_BasicStruct, ann_custom_BasicStruct, type_name_BasicStruct.to_string()); - CompleteStructHeader header_BasicStruct; - header_BasicStruct = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_BasicStruct); - CompleteStructMemberSeq member_seq_BasicStruct; - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_bool", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_bool Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_bool = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_bool; - MemberId member_id_my_bool = 0x00000000; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_bool = TypeObjectUtils::build_common_struct_member(member_id_my_bool, member_flags_my_bool, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_bool = TypeObjectUtils::build_common_struct_member(member_id_my_bool, member_flags_my_bool, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_bool member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_bool = "my_bool"; - eprosima::fastcdr::optional member_ann_builtin_my_bool; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_bool = TypeObjectUtils::build_complete_member_detail(name_my_bool, member_ann_builtin_my_bool, ann_custom_BasicStruct); - CompleteStructMember member_my_bool = TypeObjectUtils::build_complete_struct_member(common_my_bool, detail_my_bool); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_bool); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_byte", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_octet Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_octet = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_octet; - MemberId member_id_my_octet = 0x00000001; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_octet = TypeObjectUtils::build_common_struct_member(member_id_my_octet, member_flags_my_octet, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_octet = TypeObjectUtils::build_common_struct_member(member_id_my_octet, member_flags_my_octet, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_octet member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_octet = "my_octet"; - eprosima::fastcdr::optional member_ann_builtin_my_octet; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_octet = TypeObjectUtils::build_complete_member_detail(name_my_octet, member_ann_builtin_my_octet, ann_custom_BasicStruct); - CompleteStructMember member_my_octet = TypeObjectUtils::build_complete_struct_member(common_my_octet, detail_my_octet); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_octet); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int16_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_int16 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_int16 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_int16; - MemberId member_id_my_int16 = 0x00000002; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_int16 = TypeObjectUtils::build_common_struct_member(member_id_my_int16, member_flags_my_int16, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_int16 = TypeObjectUtils::build_common_struct_member(member_id_my_int16, member_flags_my_int16, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_int16 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_int16 = "my_int16"; - eprosima::fastcdr::optional member_ann_builtin_my_int16; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_int16 = TypeObjectUtils::build_complete_member_detail(name_my_int16, member_ann_builtin_my_int16, ann_custom_BasicStruct); - CompleteStructMember member_my_int16 = TypeObjectUtils::build_complete_struct_member(common_my_int16, detail_my_int16); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_int16); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_int32 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_int32 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_int32; - MemberId member_id_my_int32 = 0x00000003; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_int32 = TypeObjectUtils::build_common_struct_member(member_id_my_int32, member_flags_my_int32, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_int32 = TypeObjectUtils::build_common_struct_member(member_id_my_int32, member_flags_my_int32, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_int32 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_int32 = "my_int32"; - eprosima::fastcdr::optional member_ann_builtin_my_int32; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_int32 = TypeObjectUtils::build_complete_member_detail(name_my_int32, member_ann_builtin_my_int32, ann_custom_BasicStruct); - CompleteStructMember member_my_int32 = TypeObjectUtils::build_complete_struct_member(common_my_int32, detail_my_int32); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_int32); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int64_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_int64 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_int64 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_int64; - MemberId member_id_my_int64 = 0x00000004; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_int64 = TypeObjectUtils::build_common_struct_member(member_id_my_int64, member_flags_my_int64, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_int64 = TypeObjectUtils::build_common_struct_member(member_id_my_int64, member_flags_my_int64, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_int64 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_int64 = "my_int64"; - eprosima::fastcdr::optional member_ann_builtin_my_int64; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_int64 = TypeObjectUtils::build_complete_member_detail(name_my_int64, member_ann_builtin_my_int64, ann_custom_BasicStruct); - CompleteStructMember member_my_int64 = TypeObjectUtils::build_complete_struct_member(common_my_int64, detail_my_int64); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_int64); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_uint16_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_uint16 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_uint16 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_uint16; - MemberId member_id_my_uint16 = 0x00000005; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_uint16 = TypeObjectUtils::build_common_struct_member(member_id_my_uint16, member_flags_my_uint16, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_uint16 = TypeObjectUtils::build_common_struct_member(member_id_my_uint16, member_flags_my_uint16, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_uint16 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_uint16 = "my_uint16"; - eprosima::fastcdr::optional member_ann_builtin_my_uint16; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_uint16 = TypeObjectUtils::build_complete_member_detail(name_my_uint16, member_ann_builtin_my_uint16, ann_custom_BasicStruct); - CompleteStructMember member_my_uint16 = TypeObjectUtils::build_complete_struct_member(common_my_uint16, detail_my_uint16); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_uint16); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_uint32_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_uint32 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_uint32 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_uint32; - MemberId member_id_my_uint32 = 0x00000006; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_uint32 = TypeObjectUtils::build_common_struct_member(member_id_my_uint32, member_flags_my_uint32, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_uint32 = TypeObjectUtils::build_common_struct_member(member_id_my_uint32, member_flags_my_uint32, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_uint32 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_uint32 = "my_uint32"; - eprosima::fastcdr::optional member_ann_builtin_my_uint32; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_uint32 = TypeObjectUtils::build_complete_member_detail(name_my_uint32, member_ann_builtin_my_uint32, ann_custom_BasicStruct); - CompleteStructMember member_my_uint32 = TypeObjectUtils::build_complete_struct_member(common_my_uint32, detail_my_uint32); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_uint32); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_uint64_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_uint64 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_uint64 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_uint64; - MemberId member_id_my_uint64 = 0x00000007; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_uint64 = TypeObjectUtils::build_common_struct_member(member_id_my_uint64, member_flags_my_uint64, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_uint64 = TypeObjectUtils::build_common_struct_member(member_id_my_uint64, member_flags_my_uint64, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_uint64 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_uint64 = "my_uint64"; - eprosima::fastcdr::optional member_ann_builtin_my_uint64; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_uint64 = TypeObjectUtils::build_complete_member_detail(name_my_uint64, member_ann_builtin_my_uint64, ann_custom_BasicStruct); - CompleteStructMember member_my_uint64 = TypeObjectUtils::build_complete_struct_member(common_my_uint64, detail_my_uint64); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_uint64); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_float", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_float32 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_float32 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_float32; - MemberId member_id_my_float32 = 0x00000008; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_float32 = TypeObjectUtils::build_common_struct_member(member_id_my_float32, member_flags_my_float32, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_float32 = TypeObjectUtils::build_common_struct_member(member_id_my_float32, member_flags_my_float32, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_float32 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_float32 = "my_float32"; - eprosima::fastcdr::optional member_ann_builtin_my_float32; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_float32 = TypeObjectUtils::build_complete_member_detail(name_my_float32, member_ann_builtin_my_float32, ann_custom_BasicStruct); - CompleteStructMember member_my_float32 = TypeObjectUtils::build_complete_struct_member(common_my_float32, detail_my_float32); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_float32); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_double", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_float64 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_float64 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_float64; - MemberId member_id_my_float64 = 0x00000009; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_float64 = TypeObjectUtils::build_common_struct_member(member_id_my_float64, member_flags_my_float64, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_float64 = TypeObjectUtils::build_common_struct_member(member_id_my_float64, member_flags_my_float64, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_float64 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_float64 = "my_float64"; - eprosima::fastcdr::optional member_ann_builtin_my_float64; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_float64 = TypeObjectUtils::build_complete_member_detail(name_my_float64, member_ann_builtin_my_float64, ann_custom_BasicStruct); - CompleteStructMember member_my_float64 = TypeObjectUtils::build_complete_struct_member(common_my_float64, detail_my_float64); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_float64); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_longdouble", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_float128 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_float128 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_float128; - MemberId member_id_my_float128 = 0x0000000a; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_float128 = TypeObjectUtils::build_common_struct_member(member_id_my_float128, member_flags_my_float128, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_float128 = TypeObjectUtils::build_common_struct_member(member_id_my_float128, member_flags_my_float128, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_float128 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_float128 = "my_float128"; - eprosima::fastcdr::optional member_ann_builtin_my_float128; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_float128 = TypeObjectUtils::build_complete_member_detail(name_my_float128, member_ann_builtin_my_float128, ann_custom_BasicStruct); - CompleteStructMember member_my_float128 = TypeObjectUtils::build_complete_struct_member(common_my_float128, detail_my_float128); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_float128); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_char", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_char Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_char = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_char; - MemberId member_id_my_char = 0x0000000b; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_char = TypeObjectUtils::build_common_struct_member(member_id_my_char, member_flags_my_char, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_char = TypeObjectUtils::build_common_struct_member(member_id_my_char, member_flags_my_char, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_char member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_char = "my_char"; - eprosima::fastcdr::optional member_ann_builtin_my_char; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_char = TypeObjectUtils::build_complete_member_detail(name_my_char, member_ann_builtin_my_char, ann_custom_BasicStruct); - CompleteStructMember member_my_char = TypeObjectUtils::build_complete_struct_member(common_my_char, detail_my_char); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_char); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_string_unbounded", type_ids_BasicStruct); - - if (return_code_BasicStruct != 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_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_string_unbounded", type_ids_BasicStruct); - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_string_unbounded: Given String TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_string = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_string; - MemberId member_id_my_string = 0x0000000c; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_string = TypeObjectUtils::build_common_struct_member(member_id_my_string, member_flags_my_string, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_string = TypeObjectUtils::build_common_struct_member(member_id_my_string, member_flags_my_string, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_string member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_string = "my_string"; - eprosima::fastcdr::optional member_ann_builtin_my_string; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_string = TypeObjectUtils::build_complete_member_detail(name_my_string, member_ann_builtin_my_string, ann_custom_BasicStruct); - CompleteStructMember member_my_string = TypeObjectUtils::build_complete_struct_member(common_my_string, detail_my_string); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_string); - } - CompleteStructType struct_type_BasicStruct = TypeObjectUtils::build_complete_struct_type(struct_flags_BasicStruct, header_BasicStruct, member_seq_BasicStruct); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_BasicStruct, type_name_BasicStruct.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "BasicStruct already registered in TypeObjectRegistry for a different type."); - } - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "BasicStruct", type_ids_BasicStruct); - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "BasicStruct: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - } - TypeIdentifier* element_identifier_anonymous_array_BasicStruct_5 {nullptr}; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_array_BasicStruct_5 = new TypeIdentifier(type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_array_BasicStruct_5 = new TypeIdentifier(type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Array element TypeIdentifier inconsistent."); - return; - } - EquivalenceKind equiv_kind_anonymous_array_BasicStruct_5 = EK_COMPLETE; - if (TK_NONE == type_ids_ComplexStruct.type_identifier2()._d()) - { - equiv_kind_anonymous_array_BasicStruct_5 = EK_BOTH; - } - CollectionElementFlag element_flags_anonymous_array_BasicStruct_5 = 0; - PlainCollectionHeader header_anonymous_array_BasicStruct_5 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_BasicStruct_5, element_flags_anonymous_array_BasicStruct_5); - std::string type_id_kind_anonymous_array_BasicStruct_5("TI_PLAIN_ARRAY_SMALL"); - if (type_id_kind_anonymous_array_BasicStruct_5 == "TI_PLAIN_ARRAY_SMALL") - { - SBoundSeq array_bound_seq; - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(5)); - - PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_BasicStruct_5, array_bound_seq, - eprosima::fastcdr::external(element_identifier_anonymous_array_BasicStruct_5)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_BasicStruct_5")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_BasicStruct_5 already registered in TypeObjectRegistry for a different type."); - } - } - else - { - LBoundSeq array_bound_seq; - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(5)); - - PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_BasicStruct_5, array_bound_seq, - eprosima::fastcdr::external(element_identifier_anonymous_array_BasicStruct_5)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_BasicStruct_5")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_BasicStruct_5 already registered in TypeObjectRegistry for a different type."); - } - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_array_BasicStruct_5", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_BasicStruct_5: Given Array TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_array_struct = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_array_struct; - MemberId member_id_my_array_struct = 0x00000008; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_array_struct = TypeObjectUtils::build_common_struct_member(member_id_my_array_struct, member_flags_my_array_struct, type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_array_struct = TypeObjectUtils::build_common_struct_member(member_id_my_array_struct, member_flags_my_array_struct, type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_array_struct member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_array_struct = "my_array_struct"; - eprosima::fastcdr::optional member_ann_builtin_my_array_struct; - ann_custom_ComplexStruct.reset(); - CompleteMemberDetail detail_my_array_struct = TypeObjectUtils::build_complete_member_detail(name_my_array_struct, member_ann_builtin_my_array_struct, ann_custom_ComplexStruct); - CompleteStructMember member_my_array_struct = TypeObjectUtils::build_complete_struct_member(common_my_array_struct, detail_my_array_struct); - TypeObjectUtils::add_complete_struct_member(member_seq_ComplexStruct, member_my_array_struct); - } - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_map_uint8_t_int16_t_unbounded", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int16_t", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Map element TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - TypeIdentifier* element_identifier_anonymous_map_uint8_t_int16_t_unbounded {nullptr}; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_map_uint8_t_int16_t_unbounded = new TypeIdentifier(type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_map_uint8_t_int16_t_unbounded = new TypeIdentifier(type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_uint8_t_int16_t_unbounded inconsistent element TypeIdentifier."); - return; - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_byte", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Map key TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - TypeIdentifier* key_identifier_anonymous_map_uint8_t_int16_t_unbounded {nullptr}; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - key_identifier_anonymous_map_uint8_t_int16_t_unbounded = new TypeIdentifier(type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - key_identifier_anonymous_map_uint8_t_int16_t_unbounded = new TypeIdentifier(type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_uint8_t_int16_t_unbounded inconsistent key TypeIdentifier."); - return; - } - EquivalenceKind equiv_kind_anonymous_map_uint8_t_int16_t_unbounded = EK_BOTH; - if ((EK_COMPLETE == key_identifier_anonymous_map_uint8_t_int16_t_unbounded->_d() || EK_COMPLETE == element_identifier_anonymous_map_uint8_t_int16_t_unbounded->_d()) || - (TI_PLAIN_SEQUENCE_SMALL == element_identifier_anonymous_map_uint8_t_int16_t_unbounded->_d() && EK_COMPLETE == element_identifier_anonymous_map_uint8_t_int16_t_unbounded->seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == element_identifier_anonymous_map_uint8_t_int16_t_unbounded->_d() && EK_COMPLETE == element_identifier_anonymous_map_uint8_t_int16_t_unbounded->seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == element_identifier_anonymous_map_uint8_t_int16_t_unbounded->_d() && EK_COMPLETE == element_identifier_anonymous_map_uint8_t_int16_t_unbounded->array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == element_identifier_anonymous_map_uint8_t_int16_t_unbounded->_d() && EK_COMPLETE == element_identifier_anonymous_map_uint8_t_int16_t_unbounded->array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == element_identifier_anonymous_map_uint8_t_int16_t_unbounded->_d() && (EK_COMPLETE == element_identifier_anonymous_map_uint8_t_int16_t_unbounded->map_sdefn().key_identifier()->_d() || EK_COMPLETE == element_identifier_anonymous_map_uint8_t_int16_t_unbounded->map_sdefn().header().equiv_kind())) || - (TI_PLAIN_MAP_LARGE == element_identifier_anonymous_map_uint8_t_int16_t_unbounded->_d() && (EK_COMPLETE == element_identifier_anonymous_map_uint8_t_int16_t_unbounded->map_ldefn().key_identifier()->_d() || EK_COMPLETE == element_identifier_anonymous_map_uint8_t_int16_t_unbounded->map_ldefn().header().equiv_kind()))) - { - equiv_kind_anonymous_map_uint8_t_int16_t_unbounded = EK_COMPLETE; - } - CollectionElementFlag element_flags_anonymous_map_uint8_t_int16_t_unbounded = 0; - CollectionElementFlag key_flags_anonymous_map_uint8_t_int16_t_unbounded = 0; - PlainCollectionHeader header_anonymous_map_uint8_t_int16_t_unbounded = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_map_uint8_t_int16_t_unbounded, element_flags_anonymous_map_uint8_t_int16_t_unbounded); - std::string type_id_kind_anonymous_map_uint8_t_int16_t_unbounded("TI_PLAIN_MAP_SMALL"); - if (type_id_kind_anonymous_map_uint8_t_int16_t_unbounded == "TI_PLAIN_MAP_SMALL") - { - SBound bound = 0; - PlainMapSTypeDefn map_sdefn = TypeObjectUtils::build_plain_map_s_type_defn(header_anonymous_map_uint8_t_int16_t_unbounded, bound, - eprosima::fastcdr::external(element_identifier_anonymous_map_uint8_t_int16_t_unbounded), key_flags_anonymous_map_uint8_t_int16_t_unbounded, - eprosima::fastcdr::external(key_identifier_anonymous_map_uint8_t_int16_t_unbounded)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_s_map_type_identifier(map_sdefn, "anonymous_map_uint8_t_int16_t_unbounded")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_uint8_t_int16_t_unbounded already registered in TypeObjectRegistry for a different type."); - } - } - else - { - LBound bound = 0; - PlainMapLTypeDefn map_ldefn = TypeObjectUtils::build_plain_map_l_type_defn(header_anonymous_map_uint8_t_int16_t_unbounded, bound, - eprosima::fastcdr::external(element_identifier_anonymous_map_uint8_t_int16_t_unbounded), key_flags_anonymous_map_uint8_t_int16_t_unbounded, - eprosima::fastcdr::external(key_identifier_anonymous_map_uint8_t_int16_t_unbounded)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_l_map_type_identifier(map_ldefn, "anonymous_map_uint8_t_int16_t_unbounded")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_uint8_t_int16_t_unbounded already registered in TypeObjectRegistry for a different type."); - } - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_map_uint8_t_int16_t_unbounded", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_uint8_t_int16_t_unbounded: Given Map TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_map_octet_short = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_map_octet_short; - MemberId member_id_my_map_octet_short = 0x00000009; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_map_octet_short = TypeObjectUtils::build_common_struct_member(member_id_my_map_octet_short, member_flags_my_map_octet_short, type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_map_octet_short = TypeObjectUtils::build_common_struct_member(member_id_my_map_octet_short, member_flags_my_map_octet_short, type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_map_octet_short member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_map_octet_short = "my_map_octet_short"; - eprosima::fastcdr::optional member_ann_builtin_my_map_octet_short; - ann_custom_ComplexStruct.reset(); - CompleteMemberDetail detail_my_map_octet_short = TypeObjectUtils::build_complete_member_detail(name_my_map_octet_short, member_ann_builtin_my_map_octet_short, ann_custom_ComplexStruct); - CompleteStructMember member_my_map_octet_short = TypeObjectUtils::build_complete_struct_member(common_my_map_octet_short, detail_my_map_octet_short); - TypeObjectUtils::add_complete_struct_member(member_seq_ComplexStruct, member_my_map_octet_short); - } - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_map_int32_t_BasicStruct_unbounded", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "BasicStruct", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - { - StructTypeFlag struct_flags_BasicStruct = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_BasicStruct; - TypeIdentifierPair type_ids_BasicStruct; - QualifiedTypeName type_name_BasicStruct = "BasicStruct"; - eprosima::fastcdr::optional type_ann_builtin_BasicStruct; - eprosima::fastcdr::optional ann_custom_BasicStruct; - CompleteTypeDetail detail_BasicStruct = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_BasicStruct, ann_custom_BasicStruct, type_name_BasicStruct.to_string()); - CompleteStructHeader header_BasicStruct; - header_BasicStruct = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_BasicStruct); - CompleteStructMemberSeq member_seq_BasicStruct; - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_bool", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_bool Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_bool = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_bool; - MemberId member_id_my_bool = 0x00000000; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_bool = TypeObjectUtils::build_common_struct_member(member_id_my_bool, member_flags_my_bool, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_bool = TypeObjectUtils::build_common_struct_member(member_id_my_bool, member_flags_my_bool, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_bool member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_bool = "my_bool"; - eprosima::fastcdr::optional member_ann_builtin_my_bool; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_bool = TypeObjectUtils::build_complete_member_detail(name_my_bool, member_ann_builtin_my_bool, ann_custom_BasicStruct); - CompleteStructMember member_my_bool = TypeObjectUtils::build_complete_struct_member(common_my_bool, detail_my_bool); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_bool); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_byte", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_octet Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_octet = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_octet; - MemberId member_id_my_octet = 0x00000001; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_octet = TypeObjectUtils::build_common_struct_member(member_id_my_octet, member_flags_my_octet, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_octet = TypeObjectUtils::build_common_struct_member(member_id_my_octet, member_flags_my_octet, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_octet member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_octet = "my_octet"; - eprosima::fastcdr::optional member_ann_builtin_my_octet; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_octet = TypeObjectUtils::build_complete_member_detail(name_my_octet, member_ann_builtin_my_octet, ann_custom_BasicStruct); - CompleteStructMember member_my_octet = TypeObjectUtils::build_complete_struct_member(common_my_octet, detail_my_octet); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_octet); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int16_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_int16 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_int16 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_int16; - MemberId member_id_my_int16 = 0x00000002; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_int16 = TypeObjectUtils::build_common_struct_member(member_id_my_int16, member_flags_my_int16, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_int16 = TypeObjectUtils::build_common_struct_member(member_id_my_int16, member_flags_my_int16, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_int16 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_int16 = "my_int16"; - eprosima::fastcdr::optional member_ann_builtin_my_int16; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_int16 = TypeObjectUtils::build_complete_member_detail(name_my_int16, member_ann_builtin_my_int16, ann_custom_BasicStruct); - CompleteStructMember member_my_int16 = TypeObjectUtils::build_complete_struct_member(common_my_int16, detail_my_int16); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_int16); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_int32 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_int32 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_int32; - MemberId member_id_my_int32 = 0x00000003; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_int32 = TypeObjectUtils::build_common_struct_member(member_id_my_int32, member_flags_my_int32, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_int32 = TypeObjectUtils::build_common_struct_member(member_id_my_int32, member_flags_my_int32, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_int32 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_int32 = "my_int32"; - eprosima::fastcdr::optional member_ann_builtin_my_int32; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_int32 = TypeObjectUtils::build_complete_member_detail(name_my_int32, member_ann_builtin_my_int32, ann_custom_BasicStruct); - CompleteStructMember member_my_int32 = TypeObjectUtils::build_complete_struct_member(common_my_int32, detail_my_int32); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_int32); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int64_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_int64 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_int64 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_int64; - MemberId member_id_my_int64 = 0x00000004; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_int64 = TypeObjectUtils::build_common_struct_member(member_id_my_int64, member_flags_my_int64, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_int64 = TypeObjectUtils::build_common_struct_member(member_id_my_int64, member_flags_my_int64, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_int64 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_int64 = "my_int64"; - eprosima::fastcdr::optional member_ann_builtin_my_int64; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_int64 = TypeObjectUtils::build_complete_member_detail(name_my_int64, member_ann_builtin_my_int64, ann_custom_BasicStruct); - CompleteStructMember member_my_int64 = TypeObjectUtils::build_complete_struct_member(common_my_int64, detail_my_int64); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_int64); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_uint16_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_uint16 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_uint16 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_uint16; - MemberId member_id_my_uint16 = 0x00000005; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_uint16 = TypeObjectUtils::build_common_struct_member(member_id_my_uint16, member_flags_my_uint16, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_uint16 = TypeObjectUtils::build_common_struct_member(member_id_my_uint16, member_flags_my_uint16, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_uint16 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_uint16 = "my_uint16"; - eprosima::fastcdr::optional member_ann_builtin_my_uint16; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_uint16 = TypeObjectUtils::build_complete_member_detail(name_my_uint16, member_ann_builtin_my_uint16, ann_custom_BasicStruct); - CompleteStructMember member_my_uint16 = TypeObjectUtils::build_complete_struct_member(common_my_uint16, detail_my_uint16); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_uint16); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_uint32_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_uint32 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_uint32 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_uint32; - MemberId member_id_my_uint32 = 0x00000006; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_uint32 = TypeObjectUtils::build_common_struct_member(member_id_my_uint32, member_flags_my_uint32, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_uint32 = TypeObjectUtils::build_common_struct_member(member_id_my_uint32, member_flags_my_uint32, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_uint32 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_uint32 = "my_uint32"; - eprosima::fastcdr::optional member_ann_builtin_my_uint32; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_uint32 = TypeObjectUtils::build_complete_member_detail(name_my_uint32, member_ann_builtin_my_uint32, ann_custom_BasicStruct); - CompleteStructMember member_my_uint32 = TypeObjectUtils::build_complete_struct_member(common_my_uint32, detail_my_uint32); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_uint32); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_uint64_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_uint64 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_uint64 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_uint64; - MemberId member_id_my_uint64 = 0x00000007; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_uint64 = TypeObjectUtils::build_common_struct_member(member_id_my_uint64, member_flags_my_uint64, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_uint64 = TypeObjectUtils::build_common_struct_member(member_id_my_uint64, member_flags_my_uint64, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_uint64 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_uint64 = "my_uint64"; - eprosima::fastcdr::optional member_ann_builtin_my_uint64; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_uint64 = TypeObjectUtils::build_complete_member_detail(name_my_uint64, member_ann_builtin_my_uint64, ann_custom_BasicStruct); - CompleteStructMember member_my_uint64 = TypeObjectUtils::build_complete_struct_member(common_my_uint64, detail_my_uint64); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_uint64); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_float", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_float32 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_float32 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_float32; - MemberId member_id_my_float32 = 0x00000008; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_float32 = TypeObjectUtils::build_common_struct_member(member_id_my_float32, member_flags_my_float32, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_float32 = TypeObjectUtils::build_common_struct_member(member_id_my_float32, member_flags_my_float32, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_float32 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_float32 = "my_float32"; - eprosima::fastcdr::optional member_ann_builtin_my_float32; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_float32 = TypeObjectUtils::build_complete_member_detail(name_my_float32, member_ann_builtin_my_float32, ann_custom_BasicStruct); - CompleteStructMember member_my_float32 = TypeObjectUtils::build_complete_struct_member(common_my_float32, detail_my_float32); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_float32); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_double", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_float64 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_float64 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_float64; - MemberId member_id_my_float64 = 0x00000009; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_float64 = TypeObjectUtils::build_common_struct_member(member_id_my_float64, member_flags_my_float64, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_float64 = TypeObjectUtils::build_common_struct_member(member_id_my_float64, member_flags_my_float64, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_float64 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_float64 = "my_float64"; - eprosima::fastcdr::optional member_ann_builtin_my_float64; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_float64 = TypeObjectUtils::build_complete_member_detail(name_my_float64, member_ann_builtin_my_float64, ann_custom_BasicStruct); - CompleteStructMember member_my_float64 = TypeObjectUtils::build_complete_struct_member(common_my_float64, detail_my_float64); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_float64); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_longdouble", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_float128 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_float128 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_float128; - MemberId member_id_my_float128 = 0x0000000a; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_float128 = TypeObjectUtils::build_common_struct_member(member_id_my_float128, member_flags_my_float128, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_float128 = TypeObjectUtils::build_common_struct_member(member_id_my_float128, member_flags_my_float128, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_float128 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_float128 = "my_float128"; - eprosima::fastcdr::optional member_ann_builtin_my_float128; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_float128 = TypeObjectUtils::build_complete_member_detail(name_my_float128, member_ann_builtin_my_float128, ann_custom_BasicStruct); - CompleteStructMember member_my_float128 = TypeObjectUtils::build_complete_struct_member(common_my_float128, detail_my_float128); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_float128); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_char", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_char Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_char = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_char; - MemberId member_id_my_char = 0x0000000b; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_char = TypeObjectUtils::build_common_struct_member(member_id_my_char, member_flags_my_char, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_char = TypeObjectUtils::build_common_struct_member(member_id_my_char, member_flags_my_char, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_char member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_char = "my_char"; - eprosima::fastcdr::optional member_ann_builtin_my_char; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_char = TypeObjectUtils::build_complete_member_detail(name_my_char, member_ann_builtin_my_char, ann_custom_BasicStruct); - CompleteStructMember member_my_char = TypeObjectUtils::build_complete_struct_member(common_my_char, detail_my_char); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_char); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_string_unbounded", type_ids_BasicStruct); - - if (return_code_BasicStruct != 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_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_string_unbounded", type_ids_BasicStruct); - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_string_unbounded: Given String TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_string = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_string; - MemberId member_id_my_string = 0x0000000c; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_string = TypeObjectUtils::build_common_struct_member(member_id_my_string, member_flags_my_string, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_string = TypeObjectUtils::build_common_struct_member(member_id_my_string, member_flags_my_string, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_string member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_string = "my_string"; - eprosima::fastcdr::optional member_ann_builtin_my_string; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_string = TypeObjectUtils::build_complete_member_detail(name_my_string, member_ann_builtin_my_string, ann_custom_BasicStruct); - CompleteStructMember member_my_string = TypeObjectUtils::build_complete_struct_member(common_my_string, detail_my_string); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_string); - } - CompleteStructType struct_type_BasicStruct = TypeObjectUtils::build_complete_struct_type(struct_flags_BasicStruct, header_BasicStruct, member_seq_BasicStruct); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_BasicStruct, type_name_BasicStruct.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "BasicStruct already registered in TypeObjectRegistry for a different type."); - } - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "BasicStruct", type_ids_BasicStruct); - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "BasicStruct: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - } - TypeIdentifier* element_identifier_anonymous_map_int32_t_BasicStruct_unbounded {nullptr}; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_map_int32_t_BasicStruct_unbounded = new TypeIdentifier(type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_map_int32_t_BasicStruct_unbounded = new TypeIdentifier(type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_BasicStruct_unbounded inconsistent element TypeIdentifier."); - return; - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Map key TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - TypeIdentifier* key_identifier_anonymous_map_int32_t_BasicStruct_unbounded {nullptr}; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - key_identifier_anonymous_map_int32_t_BasicStruct_unbounded = new TypeIdentifier(type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - key_identifier_anonymous_map_int32_t_BasicStruct_unbounded = new TypeIdentifier(type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_BasicStruct_unbounded inconsistent key TypeIdentifier."); - return; - } - EquivalenceKind equiv_kind_anonymous_map_int32_t_BasicStruct_unbounded = EK_BOTH; - if ((EK_COMPLETE == key_identifier_anonymous_map_int32_t_BasicStruct_unbounded->_d() || EK_COMPLETE == element_identifier_anonymous_map_int32_t_BasicStruct_unbounded->_d()) || - (TI_PLAIN_SEQUENCE_SMALL == element_identifier_anonymous_map_int32_t_BasicStruct_unbounded->_d() && EK_COMPLETE == element_identifier_anonymous_map_int32_t_BasicStruct_unbounded->seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == element_identifier_anonymous_map_int32_t_BasicStruct_unbounded->_d() && EK_COMPLETE == element_identifier_anonymous_map_int32_t_BasicStruct_unbounded->seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == element_identifier_anonymous_map_int32_t_BasicStruct_unbounded->_d() && EK_COMPLETE == element_identifier_anonymous_map_int32_t_BasicStruct_unbounded->array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == element_identifier_anonymous_map_int32_t_BasicStruct_unbounded->_d() && EK_COMPLETE == element_identifier_anonymous_map_int32_t_BasicStruct_unbounded->array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == element_identifier_anonymous_map_int32_t_BasicStruct_unbounded->_d() && (EK_COMPLETE == element_identifier_anonymous_map_int32_t_BasicStruct_unbounded->map_sdefn().key_identifier()->_d() || EK_COMPLETE == element_identifier_anonymous_map_int32_t_BasicStruct_unbounded->map_sdefn().header().equiv_kind())) || - (TI_PLAIN_MAP_LARGE == element_identifier_anonymous_map_int32_t_BasicStruct_unbounded->_d() && (EK_COMPLETE == element_identifier_anonymous_map_int32_t_BasicStruct_unbounded->map_ldefn().key_identifier()->_d() || EK_COMPLETE == element_identifier_anonymous_map_int32_t_BasicStruct_unbounded->map_ldefn().header().equiv_kind()))) - { - equiv_kind_anonymous_map_int32_t_BasicStruct_unbounded = EK_COMPLETE; - } - CollectionElementFlag element_flags_anonymous_map_int32_t_BasicStruct_unbounded = 0; - CollectionElementFlag key_flags_anonymous_map_int32_t_BasicStruct_unbounded = 0; - PlainCollectionHeader header_anonymous_map_int32_t_BasicStruct_unbounded = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_map_int32_t_BasicStruct_unbounded, element_flags_anonymous_map_int32_t_BasicStruct_unbounded); - std::string type_id_kind_anonymous_map_int32_t_BasicStruct_unbounded("TI_PLAIN_MAP_SMALL"); - if (type_id_kind_anonymous_map_int32_t_BasicStruct_unbounded == "TI_PLAIN_MAP_SMALL") - { - SBound bound = 0; - PlainMapSTypeDefn map_sdefn = TypeObjectUtils::build_plain_map_s_type_defn(header_anonymous_map_int32_t_BasicStruct_unbounded, bound, - eprosima::fastcdr::external(element_identifier_anonymous_map_int32_t_BasicStruct_unbounded), key_flags_anonymous_map_int32_t_BasicStruct_unbounded, - eprosima::fastcdr::external(key_identifier_anonymous_map_int32_t_BasicStruct_unbounded)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_s_map_type_identifier(map_sdefn, "anonymous_map_int32_t_BasicStruct_unbounded")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_BasicStruct_unbounded already registered in TypeObjectRegistry for a different type."); - } - } - else - { - LBound bound = 0; - PlainMapLTypeDefn map_ldefn = TypeObjectUtils::build_plain_map_l_type_defn(header_anonymous_map_int32_t_BasicStruct_unbounded, bound, - eprosima::fastcdr::external(element_identifier_anonymous_map_int32_t_BasicStruct_unbounded), key_flags_anonymous_map_int32_t_BasicStruct_unbounded, - eprosima::fastcdr::external(key_identifier_anonymous_map_int32_t_BasicStruct_unbounded)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_l_map_type_identifier(map_ldefn, "anonymous_map_int32_t_BasicStruct_unbounded")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_BasicStruct_unbounded already registered in TypeObjectRegistry for a different type."); - } - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_map_int32_t_BasicStruct_unbounded", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_BasicStruct_unbounded: Given Map TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_map_long_struct = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_map_long_struct; - MemberId member_id_my_map_long_struct = 0x0000000a; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_map_long_struct = TypeObjectUtils::build_common_struct_member(member_id_my_map_long_struct, member_flags_my_map_long_struct, type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_map_long_struct = TypeObjectUtils::build_common_struct_member(member_id_my_map_long_struct, member_flags_my_map_long_struct, type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_map_long_struct member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_map_long_struct = "my_map_long_struct"; - eprosima::fastcdr::optional member_ann_builtin_my_map_long_struct; - ann_custom_ComplexStruct.reset(); - CompleteMemberDetail detail_my_map_long_struct = TypeObjectUtils::build_complete_member_detail(name_my_map_long_struct, member_ann_builtin_my_map_long_struct, ann_custom_ComplexStruct); - CompleteStructMember member_my_map_long_struct = TypeObjectUtils::build_complete_struct_member(common_my_map_long_struct, detail_my_map_long_struct); - TypeObjectUtils::add_complete_struct_member(member_seq_ComplexStruct, member_my_map_long_struct); - } - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_sequence_uint8_t_unbounded", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_byte", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != 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_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_sequence_uint8_t_unbounded = new TypeIdentifier(type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_sequence_uint8_t_unbounded = new TypeIdentifier(type_ids_ComplexStruct.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_ComplexStruct.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_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_sequence_uint8_t_unbounded", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_sequence_uint8_t_unbounded: Given Sequence TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - TypeIdentifier* element_identifier_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded {nullptr}; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded = new TypeIdentifier(type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded = new TypeIdentifier(type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Sequence element TypeIdentifier inconsistent."); - return; - } - EquivalenceKind equiv_kind_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded = EK_COMPLETE; - if (TK_NONE == type_ids_ComplexStruct.type_identifier2()._d()) - { - equiv_kind_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded = EK_BOTH; - } - CollectionElementFlag element_flags_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded = 0; - PlainCollectionHeader header_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded, element_flags_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded); - std::string type_id_kind_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded("TI_PLAIN_SEQUENCE_SMALL"); - if (type_id_kind_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded == "TI_PLAIN_SEQUENCE_SMALL") - { - SBound bound = 0; - PlainSequenceSElemDefn seq_sdefn = TypeObjectUtils::build_plain_sequence_s_elem_defn(header_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded, bound, - eprosima::fastcdr::external(element_identifier_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_s_sequence_type_identifier(seq_sdefn, "anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_sequence_anonymous_sequence_uint8_t_unbounded_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_anonymous_sequence_uint8_t_unbounded_unbounded, bound, - eprosima::fastcdr::external(element_identifier_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_l_sequence_type_identifier(seq_ldefn, "anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded already registered in TypeObjectRegistry for a different type."); - } - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded: Given Sequence TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - TypeIdentifier* element_identifier_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded {nullptr}; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded = new TypeIdentifier(type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded = new TypeIdentifier(type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded inconsistent element TypeIdentifier."); - return; - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Map key TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - TypeIdentifier* key_identifier_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded {nullptr}; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - key_identifier_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded = new TypeIdentifier(type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - key_identifier_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded = new TypeIdentifier(type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded inconsistent key TypeIdentifier."); - return; - } - EquivalenceKind equiv_kind_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded = EK_BOTH; - if ((EK_COMPLETE == key_identifier_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded->_d() || EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded->_d()) || - (TI_PLAIN_SEQUENCE_SMALL == element_identifier_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded->_d() && EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded->seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == element_identifier_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded->_d() && EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded->seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == element_identifier_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded->_d() && EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded->array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == element_identifier_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded->_d() && EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded->array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == element_identifier_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded->_d() && (EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded->map_sdefn().key_identifier()->_d() || EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded->map_sdefn().header().equiv_kind())) || - (TI_PLAIN_MAP_LARGE == element_identifier_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded->_d() && (EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded->map_ldefn().key_identifier()->_d() || EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded->map_ldefn().header().equiv_kind()))) - { - equiv_kind_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded = EK_COMPLETE; - } - CollectionElementFlag element_flags_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded = 0; - CollectionElementFlag key_flags_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded = 0; - PlainCollectionHeader header_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded, element_flags_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded); - std::string type_id_kind_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded("TI_PLAIN_MAP_SMALL"); - if (type_id_kind_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded == "TI_PLAIN_MAP_SMALL") - { - SBound bound = 0; - PlainMapSTypeDefn map_sdefn = TypeObjectUtils::build_plain_map_s_type_defn(header_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded, bound, - eprosima::fastcdr::external(element_identifier_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded), key_flags_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded, - eprosima::fastcdr::external(key_identifier_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_s_map_type_identifier(map_sdefn, "anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded already registered in TypeObjectRegistry for a different type."); - } - } - else - { - LBound bound = 0; - PlainMapLTypeDefn map_ldefn = TypeObjectUtils::build_plain_map_l_type_defn(header_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded, bound, - eprosima::fastcdr::external(element_identifier_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded), key_flags_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded, - eprosima::fastcdr::external(key_identifier_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_l_map_type_identifier(map_ldefn, "anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded already registered in TypeObjectRegistry for a different type."); - } - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded: Given Map TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_map_long_seq_octet = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_map_long_seq_octet; - MemberId member_id_my_map_long_seq_octet = 0x0000000b; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_map_long_seq_octet = TypeObjectUtils::build_common_struct_member(member_id_my_map_long_seq_octet, member_flags_my_map_long_seq_octet, type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_map_long_seq_octet = TypeObjectUtils::build_common_struct_member(member_id_my_map_long_seq_octet, member_flags_my_map_long_seq_octet, type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_map_long_seq_octet member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_map_long_seq_octet = "my_map_long_seq_octet"; - eprosima::fastcdr::optional member_ann_builtin_my_map_long_seq_octet; - ann_custom_ComplexStruct.reset(); - CompleteMemberDetail detail_my_map_long_seq_octet = TypeObjectUtils::build_complete_member_detail(name_my_map_long_seq_octet, member_ann_builtin_my_map_long_seq_octet, ann_custom_ComplexStruct); - CompleteStructMember member_my_map_long_seq_octet = TypeObjectUtils::build_complete_struct_member(common_my_map_long_seq_octet, detail_my_map_long_seq_octet); - TypeObjectUtils::add_complete_struct_member(member_seq_ComplexStruct, member_my_map_long_seq_octet); - } - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyOctetArray500", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - AliasTypeFlag alias_flags_MyOctetArray500 = 0; - QualifiedTypeName type_name_MyOctetArray500 = "MyOctetArray500"; - eprosima::fastcdr::optional type_ann_builtin_MyOctetArray500; - eprosima::fastcdr::optional ann_custom_MyOctetArray500; - CompleteTypeDetail detail_MyOctetArray500 = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_MyOctetArray500, ann_custom_MyOctetArray500, type_name_MyOctetArray500.to_string()); - CompleteAliasHeader header_MyOctetArray500 = TypeObjectUtils::build_complete_alias_header(detail_MyOctetArray500); - AliasMemberFlag related_flags_MyOctetArray500 = 0; - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_array_uint8_t_500", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_byte", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Array element TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - TypeIdentifier* element_identifier_anonymous_array_uint8_t_500 {nullptr}; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_array_uint8_t_500 = new TypeIdentifier(type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_array_uint8_t_500 = new TypeIdentifier(type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Array element TypeIdentifier inconsistent."); - return; - } - EquivalenceKind equiv_kind_anonymous_array_uint8_t_500 = EK_COMPLETE; - if (TK_NONE == type_ids_ComplexStruct.type_identifier2()._d()) - { - equiv_kind_anonymous_array_uint8_t_500 = EK_BOTH; - } - CollectionElementFlag element_flags_anonymous_array_uint8_t_500 = 0; - PlainCollectionHeader header_anonymous_array_uint8_t_500 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_500, element_flags_anonymous_array_uint8_t_500); - std::string type_id_kind_anonymous_array_uint8_t_500("TI_PLAIN_ARRAY_LARGE"); - if (type_id_kind_anonymous_array_uint8_t_500 == "TI_PLAIN_ARRAY_SMALL") - { - SBoundSeq array_bound_seq; - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(500)); - - PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_500, array_bound_seq, - eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_500)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_500")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_uint8_t_500 already registered in TypeObjectRegistry for a different type."); - } - } - else - { - LBoundSeq array_bound_seq; - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(500)); - - PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_500, array_bound_seq, - eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_500)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_500")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_uint8_t_500 already registered in TypeObjectRegistry for a different type."); - } - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_array_uint8_t_500", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_uint8_t_500: Given Array TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - CommonAliasBody common_MyOctetArray500; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_MyOctetArray500 = TypeObjectUtils::build_common_alias_body(related_flags_MyOctetArray500, type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_MyOctetArray500 = TypeObjectUtils::build_common_alias_body(related_flags_MyOctetArray500, type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyOctetArray500 related TypeIdentifier inconsistent."); - return; - } - eprosima::fastcdr::optional member_ann_builtin_MyOctetArray500; - ann_custom_MyOctetArray500.reset(); - CompleteAliasBody body_MyOctetArray500 = TypeObjectUtils::build_complete_alias_body(common_MyOctetArray500, member_ann_builtin_MyOctetArray500, ann_custom_MyOctetArray500); - CompleteAliasType alias_type_MyOctetArray500 = TypeObjectUtils::build_complete_alias_type(alias_flags_MyOctetArray500, header_MyOctetArray500, body_MyOctetArray500); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_alias_type_object(alias_type_MyOctetArray500, type_name_MyOctetArray500.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyOctetArray500 already registered in TypeObjectRegistry for a different type."); - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyOctetArray500", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyOctetArray500: Given Alias TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - TypeIdentifier* element_identifier_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded {nullptr}; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded = new TypeIdentifier(type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded = new TypeIdentifier(type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded inconsistent element TypeIdentifier."); - return; - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Map key TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - TypeIdentifier* key_identifier_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded {nullptr}; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - key_identifier_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded = new TypeIdentifier(type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - key_identifier_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded = new TypeIdentifier(type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded inconsistent key TypeIdentifier."); - return; - } - EquivalenceKind equiv_kind_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded = EK_BOTH; - if ((EK_COMPLETE == key_identifier_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded->_d() || EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded->_d()) || - (TI_PLAIN_SEQUENCE_SMALL == element_identifier_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded->_d() && EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded->seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == element_identifier_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded->_d() && EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded->seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == element_identifier_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded->_d() && EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded->array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == element_identifier_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded->_d() && EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded->array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == element_identifier_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded->_d() && (EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded->map_sdefn().key_identifier()->_d() || EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded->map_sdefn().header().equiv_kind())) || - (TI_PLAIN_MAP_LARGE == element_identifier_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded->_d() && (EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded->map_ldefn().key_identifier()->_d() || EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded->map_ldefn().header().equiv_kind()))) - { - equiv_kind_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded = EK_COMPLETE; - } - CollectionElementFlag element_flags_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded = 0; - CollectionElementFlag key_flags_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded = 0; - PlainCollectionHeader header_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded, element_flags_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded); - std::string type_id_kind_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded("TI_PLAIN_MAP_SMALL"); - if (type_id_kind_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded == "TI_PLAIN_MAP_SMALL") - { - SBound bound = 0; - PlainMapSTypeDefn map_sdefn = TypeObjectUtils::build_plain_map_s_type_defn(header_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded, bound, - eprosima::fastcdr::external(element_identifier_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded), key_flags_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded, - eprosima::fastcdr::external(key_identifier_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_s_map_type_identifier(map_sdefn, "anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded already registered in TypeObjectRegistry for a different type."); - } - } - else - { - LBound bound = 0; - PlainMapLTypeDefn map_ldefn = TypeObjectUtils::build_plain_map_l_type_defn(header_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded, bound, - eprosima::fastcdr::external(element_identifier_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded), key_flags_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded, - eprosima::fastcdr::external(key_identifier_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_l_map_type_identifier(map_ldefn, "anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded already registered in TypeObjectRegistry for a different type."); - } - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded: Given Map TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_map_long_octet_array_500 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_map_long_octet_array_500; - MemberId member_id_my_map_long_octet_array_500 = 0x0000000c; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_map_long_octet_array_500 = TypeObjectUtils::build_common_struct_member(member_id_my_map_long_octet_array_500, member_flags_my_map_long_octet_array_500, type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_map_long_octet_array_500 = TypeObjectUtils::build_common_struct_member(member_id_my_map_long_octet_array_500, member_flags_my_map_long_octet_array_500, type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_map_long_octet_array_500 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_map_long_octet_array_500 = "my_map_long_octet_array_500"; - eprosima::fastcdr::optional member_ann_builtin_my_map_long_octet_array_500; - ann_custom_ComplexStruct.reset(); - CompleteMemberDetail detail_my_map_long_octet_array_500 = TypeObjectUtils::build_complete_member_detail(name_my_map_long_octet_array_500, member_ann_builtin_my_map_long_octet_array_500, ann_custom_ComplexStruct); - CompleteStructMember member_my_map_long_octet_array_500 = TypeObjectUtils::build_complete_struct_member(common_my_map_long_octet_array_500, detail_my_map_long_octet_array_500); - TypeObjectUtils::add_complete_struct_member(member_seq_ComplexStruct, member_my_map_long_octet_array_500); - } - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "BSAlias5", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - AliasTypeFlag alias_flags_BSAlias5 = 0; - QualifiedTypeName type_name_BSAlias5 = "BSAlias5"; - eprosima::fastcdr::optional type_ann_builtin_BSAlias5; - eprosima::fastcdr::optional ann_custom_BSAlias5; - CompleteTypeDetail detail_BSAlias5 = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_BSAlias5, ann_custom_BSAlias5, type_name_BSAlias5.to_string()); - CompleteAliasHeader header_BSAlias5 = TypeObjectUtils::build_complete_alias_header(detail_BSAlias5); - AliasMemberFlag related_flags_BSAlias5 = 0; - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_array_BasicStruct_5", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "BasicStruct", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - { - StructTypeFlag struct_flags_BasicStruct = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_BasicStruct; - TypeIdentifierPair type_ids_BasicStruct; - QualifiedTypeName type_name_BasicStruct = "BasicStruct"; - eprosima::fastcdr::optional type_ann_builtin_BasicStruct; - eprosima::fastcdr::optional ann_custom_BasicStruct; - CompleteTypeDetail detail_BasicStruct = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_BasicStruct, ann_custom_BasicStruct, type_name_BasicStruct.to_string()); - CompleteStructHeader header_BasicStruct; - header_BasicStruct = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_BasicStruct); - CompleteStructMemberSeq member_seq_BasicStruct; - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_bool", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_bool Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_bool = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_bool; - MemberId member_id_my_bool = 0x00000000; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_bool = TypeObjectUtils::build_common_struct_member(member_id_my_bool, member_flags_my_bool, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_bool = TypeObjectUtils::build_common_struct_member(member_id_my_bool, member_flags_my_bool, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_bool member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_bool = "my_bool"; - eprosima::fastcdr::optional member_ann_builtin_my_bool; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_bool = TypeObjectUtils::build_complete_member_detail(name_my_bool, member_ann_builtin_my_bool, ann_custom_BasicStruct); - CompleteStructMember member_my_bool = TypeObjectUtils::build_complete_struct_member(common_my_bool, detail_my_bool); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_bool); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_byte", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_octet Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_octet = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_octet; - MemberId member_id_my_octet = 0x00000001; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_octet = TypeObjectUtils::build_common_struct_member(member_id_my_octet, member_flags_my_octet, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_octet = TypeObjectUtils::build_common_struct_member(member_id_my_octet, member_flags_my_octet, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_octet member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_octet = "my_octet"; - eprosima::fastcdr::optional member_ann_builtin_my_octet; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_octet = TypeObjectUtils::build_complete_member_detail(name_my_octet, member_ann_builtin_my_octet, ann_custom_BasicStruct); - CompleteStructMember member_my_octet = TypeObjectUtils::build_complete_struct_member(common_my_octet, detail_my_octet); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_octet); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int16_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_int16 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_int16 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_int16; - MemberId member_id_my_int16 = 0x00000002; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_int16 = TypeObjectUtils::build_common_struct_member(member_id_my_int16, member_flags_my_int16, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_int16 = TypeObjectUtils::build_common_struct_member(member_id_my_int16, member_flags_my_int16, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_int16 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_int16 = "my_int16"; - eprosima::fastcdr::optional member_ann_builtin_my_int16; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_int16 = TypeObjectUtils::build_complete_member_detail(name_my_int16, member_ann_builtin_my_int16, ann_custom_BasicStruct); - CompleteStructMember member_my_int16 = TypeObjectUtils::build_complete_struct_member(common_my_int16, detail_my_int16); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_int16); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_int32 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_int32 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_int32; - MemberId member_id_my_int32 = 0x00000003; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_int32 = TypeObjectUtils::build_common_struct_member(member_id_my_int32, member_flags_my_int32, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_int32 = TypeObjectUtils::build_common_struct_member(member_id_my_int32, member_flags_my_int32, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_int32 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_int32 = "my_int32"; - eprosima::fastcdr::optional member_ann_builtin_my_int32; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_int32 = TypeObjectUtils::build_complete_member_detail(name_my_int32, member_ann_builtin_my_int32, ann_custom_BasicStruct); - CompleteStructMember member_my_int32 = TypeObjectUtils::build_complete_struct_member(common_my_int32, detail_my_int32); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_int32); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int64_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_int64 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_int64 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_int64; - MemberId member_id_my_int64 = 0x00000004; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_int64 = TypeObjectUtils::build_common_struct_member(member_id_my_int64, member_flags_my_int64, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_int64 = TypeObjectUtils::build_common_struct_member(member_id_my_int64, member_flags_my_int64, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_int64 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_int64 = "my_int64"; - eprosima::fastcdr::optional member_ann_builtin_my_int64; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_int64 = TypeObjectUtils::build_complete_member_detail(name_my_int64, member_ann_builtin_my_int64, ann_custom_BasicStruct); - CompleteStructMember member_my_int64 = TypeObjectUtils::build_complete_struct_member(common_my_int64, detail_my_int64); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_int64); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_uint16_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_uint16 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_uint16 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_uint16; - MemberId member_id_my_uint16 = 0x00000005; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_uint16 = TypeObjectUtils::build_common_struct_member(member_id_my_uint16, member_flags_my_uint16, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_uint16 = TypeObjectUtils::build_common_struct_member(member_id_my_uint16, member_flags_my_uint16, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_uint16 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_uint16 = "my_uint16"; - eprosima::fastcdr::optional member_ann_builtin_my_uint16; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_uint16 = TypeObjectUtils::build_complete_member_detail(name_my_uint16, member_ann_builtin_my_uint16, ann_custom_BasicStruct); - CompleteStructMember member_my_uint16 = TypeObjectUtils::build_complete_struct_member(common_my_uint16, detail_my_uint16); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_uint16); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_uint32_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_uint32 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_uint32 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_uint32; - MemberId member_id_my_uint32 = 0x00000006; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_uint32 = TypeObjectUtils::build_common_struct_member(member_id_my_uint32, member_flags_my_uint32, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_uint32 = TypeObjectUtils::build_common_struct_member(member_id_my_uint32, member_flags_my_uint32, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_uint32 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_uint32 = "my_uint32"; - eprosima::fastcdr::optional member_ann_builtin_my_uint32; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_uint32 = TypeObjectUtils::build_complete_member_detail(name_my_uint32, member_ann_builtin_my_uint32, ann_custom_BasicStruct); - CompleteStructMember member_my_uint32 = TypeObjectUtils::build_complete_struct_member(common_my_uint32, detail_my_uint32); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_uint32); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_uint64_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_uint64 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_uint64 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_uint64; - MemberId member_id_my_uint64 = 0x00000007; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_uint64 = TypeObjectUtils::build_common_struct_member(member_id_my_uint64, member_flags_my_uint64, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_uint64 = TypeObjectUtils::build_common_struct_member(member_id_my_uint64, member_flags_my_uint64, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_uint64 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_uint64 = "my_uint64"; - eprosima::fastcdr::optional member_ann_builtin_my_uint64; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_uint64 = TypeObjectUtils::build_complete_member_detail(name_my_uint64, member_ann_builtin_my_uint64, ann_custom_BasicStruct); - CompleteStructMember member_my_uint64 = TypeObjectUtils::build_complete_struct_member(common_my_uint64, detail_my_uint64); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_uint64); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_float", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_float32 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_float32 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_float32; - MemberId member_id_my_float32 = 0x00000008; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_float32 = TypeObjectUtils::build_common_struct_member(member_id_my_float32, member_flags_my_float32, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_float32 = TypeObjectUtils::build_common_struct_member(member_id_my_float32, member_flags_my_float32, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_float32 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_float32 = "my_float32"; - eprosima::fastcdr::optional member_ann_builtin_my_float32; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_float32 = TypeObjectUtils::build_complete_member_detail(name_my_float32, member_ann_builtin_my_float32, ann_custom_BasicStruct); - CompleteStructMember member_my_float32 = TypeObjectUtils::build_complete_struct_member(common_my_float32, detail_my_float32); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_float32); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_double", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_float64 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_float64 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_float64; - MemberId member_id_my_float64 = 0x00000009; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_float64 = TypeObjectUtils::build_common_struct_member(member_id_my_float64, member_flags_my_float64, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_float64 = TypeObjectUtils::build_common_struct_member(member_id_my_float64, member_flags_my_float64, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_float64 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_float64 = "my_float64"; - eprosima::fastcdr::optional member_ann_builtin_my_float64; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_float64 = TypeObjectUtils::build_complete_member_detail(name_my_float64, member_ann_builtin_my_float64, ann_custom_BasicStruct); - CompleteStructMember member_my_float64 = TypeObjectUtils::build_complete_struct_member(common_my_float64, detail_my_float64); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_float64); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_longdouble", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_float128 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_float128 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_float128; - MemberId member_id_my_float128 = 0x0000000a; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_float128 = TypeObjectUtils::build_common_struct_member(member_id_my_float128, member_flags_my_float128, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_float128 = TypeObjectUtils::build_common_struct_member(member_id_my_float128, member_flags_my_float128, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_float128 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_float128 = "my_float128"; - eprosima::fastcdr::optional member_ann_builtin_my_float128; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_float128 = TypeObjectUtils::build_complete_member_detail(name_my_float128, member_ann_builtin_my_float128, ann_custom_BasicStruct); - CompleteStructMember member_my_float128 = TypeObjectUtils::build_complete_struct_member(common_my_float128, detail_my_float128); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_float128); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_char", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_char Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_char = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_char; - MemberId member_id_my_char = 0x0000000b; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_char = TypeObjectUtils::build_common_struct_member(member_id_my_char, member_flags_my_char, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_char = TypeObjectUtils::build_common_struct_member(member_id_my_char, member_flags_my_char, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_char member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_char = "my_char"; - eprosima::fastcdr::optional member_ann_builtin_my_char; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_char = TypeObjectUtils::build_complete_member_detail(name_my_char, member_ann_builtin_my_char, ann_custom_BasicStruct); - CompleteStructMember member_my_char = TypeObjectUtils::build_complete_struct_member(common_my_char, detail_my_char); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_char); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_string_unbounded", type_ids_BasicStruct); - - if (return_code_BasicStruct != 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_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_string_unbounded", type_ids_BasicStruct); - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_string_unbounded: Given String TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_string = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_string; - MemberId member_id_my_string = 0x0000000c; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_string = TypeObjectUtils::build_common_struct_member(member_id_my_string, member_flags_my_string, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_string = TypeObjectUtils::build_common_struct_member(member_id_my_string, member_flags_my_string, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_string member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_string = "my_string"; - eprosima::fastcdr::optional member_ann_builtin_my_string; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_string = TypeObjectUtils::build_complete_member_detail(name_my_string, member_ann_builtin_my_string, ann_custom_BasicStruct); - CompleteStructMember member_my_string = TypeObjectUtils::build_complete_struct_member(common_my_string, detail_my_string); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_string); - } - CompleteStructType struct_type_BasicStruct = TypeObjectUtils::build_complete_struct_type(struct_flags_BasicStruct, header_BasicStruct, member_seq_BasicStruct); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_BasicStruct, type_name_BasicStruct.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "BasicStruct already registered in TypeObjectRegistry for a different type."); - } - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "BasicStruct", type_ids_BasicStruct); - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "BasicStruct: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - } - TypeIdentifier* element_identifier_anonymous_array_BasicStruct_5 {nullptr}; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_array_BasicStruct_5 = new TypeIdentifier(type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_array_BasicStruct_5 = new TypeIdentifier(type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Array element TypeIdentifier inconsistent."); - return; - } - EquivalenceKind equiv_kind_anonymous_array_BasicStruct_5 = EK_COMPLETE; - if (TK_NONE == type_ids_ComplexStruct.type_identifier2()._d()) - { - equiv_kind_anonymous_array_BasicStruct_5 = EK_BOTH; - } - CollectionElementFlag element_flags_anonymous_array_BasicStruct_5 = 0; - PlainCollectionHeader header_anonymous_array_BasicStruct_5 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_BasicStruct_5, element_flags_anonymous_array_BasicStruct_5); - std::string type_id_kind_anonymous_array_BasicStruct_5("TI_PLAIN_ARRAY_SMALL"); - if (type_id_kind_anonymous_array_BasicStruct_5 == "TI_PLAIN_ARRAY_SMALL") - { - SBoundSeq array_bound_seq; - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(5)); - - PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_BasicStruct_5, array_bound_seq, - eprosima::fastcdr::external(element_identifier_anonymous_array_BasicStruct_5)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_BasicStruct_5")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_BasicStruct_5 already registered in TypeObjectRegistry for a different type."); - } - } - else - { - LBoundSeq array_bound_seq; - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(5)); - - PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_BasicStruct_5, array_bound_seq, - eprosima::fastcdr::external(element_identifier_anonymous_array_BasicStruct_5)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_BasicStruct_5")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_BasicStruct_5 already registered in TypeObjectRegistry for a different type."); - } - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_array_BasicStruct_5", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_BasicStruct_5: Given Array TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - CommonAliasBody common_BSAlias5; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_BSAlias5 = TypeObjectUtils::build_common_alias_body(related_flags_BSAlias5, type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_BSAlias5 = TypeObjectUtils::build_common_alias_body(related_flags_BSAlias5, type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "BSAlias5 related TypeIdentifier inconsistent."); - return; - } - eprosima::fastcdr::optional member_ann_builtin_BSAlias5; - ann_custom_BSAlias5.reset(); - CompleteAliasBody body_BSAlias5 = TypeObjectUtils::build_complete_alias_body(common_BSAlias5, member_ann_builtin_BSAlias5, ann_custom_BSAlias5); - CompleteAliasType alias_type_BSAlias5 = TypeObjectUtils::build_complete_alias_type(alias_flags_BSAlias5, header_BSAlias5, body_BSAlias5); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_alias_type_object(alias_type_BSAlias5, type_name_BSAlias5.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "BSAlias5 already registered in TypeObjectRegistry for a different type."); - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "BSAlias5", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "BSAlias5: Given Alias TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - TypeIdentifier* element_identifier_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded {nullptr}; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded = new TypeIdentifier(type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded = new TypeIdentifier(type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded inconsistent element TypeIdentifier."); - return; - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_byte", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Map key TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - TypeIdentifier* key_identifier_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded {nullptr}; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - key_identifier_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded = new TypeIdentifier(type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - key_identifier_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded = new TypeIdentifier(type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded inconsistent key TypeIdentifier."); - return; - } - EquivalenceKind equiv_kind_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded = EK_BOTH; - if ((EK_COMPLETE == key_identifier_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded->_d() || EK_COMPLETE == element_identifier_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded->_d()) || - (TI_PLAIN_SEQUENCE_SMALL == element_identifier_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded->_d() && EK_COMPLETE == element_identifier_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded->seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == element_identifier_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded->_d() && EK_COMPLETE == element_identifier_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded->seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == element_identifier_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded->_d() && EK_COMPLETE == element_identifier_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded->array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == element_identifier_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded->_d() && EK_COMPLETE == element_identifier_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded->array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == element_identifier_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded->_d() && (EK_COMPLETE == element_identifier_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded->map_sdefn().key_identifier()->_d() || EK_COMPLETE == element_identifier_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded->map_sdefn().header().equiv_kind())) || - (TI_PLAIN_MAP_LARGE == element_identifier_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded->_d() && (EK_COMPLETE == element_identifier_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded->map_ldefn().key_identifier()->_d() || EK_COMPLETE == element_identifier_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded->map_ldefn().header().equiv_kind()))) - { - equiv_kind_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded = EK_COMPLETE; - } - CollectionElementFlag element_flags_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded = 0; - CollectionElementFlag key_flags_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded = 0; - PlainCollectionHeader header_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded, element_flags_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded); - std::string type_id_kind_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded("TI_PLAIN_MAP_SMALL"); - if (type_id_kind_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded == "TI_PLAIN_MAP_SMALL") - { - SBound bound = 0; - PlainMapSTypeDefn map_sdefn = TypeObjectUtils::build_plain_map_s_type_defn(header_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded, bound, - eprosima::fastcdr::external(element_identifier_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded), key_flags_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded, - eprosima::fastcdr::external(key_identifier_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_s_map_type_identifier(map_sdefn, "anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded already registered in TypeObjectRegistry for a different type."); - } - } - else - { - LBound bound = 0; - PlainMapLTypeDefn map_ldefn = TypeObjectUtils::build_plain_map_l_type_defn(header_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded, bound, - eprosima::fastcdr::external(element_identifier_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded), key_flags_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded, - eprosima::fastcdr::external(key_identifier_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_l_map_type_identifier(map_ldefn, "anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded already registered in TypeObjectRegistry for a different type."); - } - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded: Given Map TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - TypeIdentifier* element_identifier_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded {nullptr}; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded = new TypeIdentifier(type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded = new TypeIdentifier(type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded inconsistent element TypeIdentifier."); - return; - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Map key TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - TypeIdentifier* key_identifier_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded {nullptr}; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - key_identifier_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded = new TypeIdentifier(type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - key_identifier_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded = new TypeIdentifier(type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded inconsistent key TypeIdentifier."); - return; - } - EquivalenceKind equiv_kind_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded = EK_BOTH; - if ((EK_COMPLETE == key_identifier_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded->_d() || EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded->_d()) || - (TI_PLAIN_SEQUENCE_SMALL == element_identifier_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded->_d() && EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded->seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == element_identifier_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded->_d() && EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded->seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == element_identifier_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded->_d() && EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded->array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == element_identifier_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded->_d() && EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded->array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == element_identifier_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded->_d() && (EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded->map_sdefn().key_identifier()->_d() || EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded->map_sdefn().header().equiv_kind())) || - (TI_PLAIN_MAP_LARGE == element_identifier_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded->_d() && (EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded->map_ldefn().key_identifier()->_d() || EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded->map_ldefn().header().equiv_kind()))) - { - equiv_kind_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded = EK_COMPLETE; - } - CollectionElementFlag element_flags_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded = 0; - CollectionElementFlag key_flags_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded = 0; - PlainCollectionHeader header_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded, element_flags_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded); - std::string type_id_kind_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded("TI_PLAIN_MAP_SMALL"); - if (type_id_kind_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded == "TI_PLAIN_MAP_SMALL") - { - SBound bound = 0; - PlainMapSTypeDefn map_sdefn = TypeObjectUtils::build_plain_map_s_type_defn(header_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded, bound, - eprosima::fastcdr::external(element_identifier_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded), key_flags_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded, - eprosima::fastcdr::external(key_identifier_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_s_map_type_identifier(map_sdefn, "anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded already registered in TypeObjectRegistry for a different type."); - } - } - else - { - LBound bound = 0; - PlainMapLTypeDefn map_ldefn = TypeObjectUtils::build_plain_map_l_type_defn(header_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded, bound, - eprosima::fastcdr::external(element_identifier_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded), key_flags_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded, - eprosima::fastcdr::external(key_identifier_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_l_map_type_identifier(map_ldefn, "anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded already registered in TypeObjectRegistry for a different type."); - } - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded: Given Map TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_map_long_lol_type = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_map_long_lol_type; - MemberId member_id_my_map_long_lol_type = 0x0000000d; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_map_long_lol_type = TypeObjectUtils::build_common_struct_member(member_id_my_map_long_lol_type, member_flags_my_map_long_lol_type, type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_map_long_lol_type = TypeObjectUtils::build_common_struct_member(member_id_my_map_long_lol_type, member_flags_my_map_long_lol_type, type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_map_long_lol_type member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_map_long_lol_type = "my_map_long_lol_type"; - eprosima::fastcdr::optional member_ann_builtin_my_map_long_lol_type; - ann_custom_ComplexStruct.reset(); - CompleteMemberDetail detail_my_map_long_lol_type = TypeObjectUtils::build_complete_member_detail(name_my_map_long_lol_type, member_ann_builtin_my_map_long_lol_type, ann_custom_ComplexStruct); - CompleteStructMember member_my_map_long_lol_type = TypeObjectUtils::build_complete_struct_member(common_my_map_long_lol_type, detail_my_map_long_lol_type); - TypeObjectUtils::add_complete_struct_member(member_seq_ComplexStruct, member_my_map_long_lol_type); - } - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_string_128", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - std::string type_id_kind_anonymous_string_128("TI_STRING8_SMALL"); - if (type_id_kind_anonymous_string_128 == "TI_STRING8_SMALL") - { - SBound bound = static_cast(128); - 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_128")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_string_128 already registered in TypeObjectRegistry for a different type."); - } - } - else if (type_id_kind_anonymous_string_128 == "TI_STRING8_LARGE") - { - LBound bound = 128; - 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_128")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_string_128 already registered in TypeObjectRegistry for a different type."); - } - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_string_128: Unknown String kind."); - return; - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_string_128", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_string_128: Given String TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_small_string_8 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_small_string_8; - MemberId member_id_my_small_string_8 = 0x0000000e; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_small_string_8 = TypeObjectUtils::build_common_struct_member(member_id_my_small_string_8, member_flags_my_small_string_8, type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_small_string_8 = TypeObjectUtils::build_common_struct_member(member_id_my_small_string_8, member_flags_my_small_string_8, type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_small_string_8 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_small_string_8 = "my_small_string_8"; - eprosima::fastcdr::optional member_ann_builtin_my_small_string_8; - ann_custom_ComplexStruct.reset(); - CompleteMemberDetail detail_my_small_string_8 = TypeObjectUtils::build_complete_member_detail(name_my_small_string_8, member_ann_builtin_my_small_string_8, ann_custom_ComplexStruct); - CompleteStructMember member_my_small_string_8 = TypeObjectUtils::build_complete_struct_member(common_my_small_string_8, detail_my_small_string_8); - TypeObjectUtils::add_complete_struct_member(member_seq_ComplexStruct, member_my_small_string_8); - } - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_string_500", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - std::string type_id_kind_anonymous_string_500("TI_STRING8_LARGE"); - if (type_id_kind_anonymous_string_500 == "TI_STRING8_SMALL") - { - SBound bound = static_cast(500); - 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_500")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_string_500 already registered in TypeObjectRegistry for a different type."); - } - } - else if (type_id_kind_anonymous_string_500 == "TI_STRING8_LARGE") - { - LBound bound = 500; - 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_500")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_string_500 already registered in TypeObjectRegistry for a different type."); - } - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_string_500: Unknown String kind."); - return; - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_string_500", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_string_500: Given String TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_large_string_8 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_large_string_8; - MemberId member_id_my_large_string_8 = 0x0000000f; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_large_string_8 = TypeObjectUtils::build_common_struct_member(member_id_my_large_string_8, member_flags_my_large_string_8, type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_large_string_8 = TypeObjectUtils::build_common_struct_member(member_id_my_large_string_8, member_flags_my_large_string_8, type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_large_string_8 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_large_string_8 = "my_large_string_8"; - eprosima::fastcdr::optional member_ann_builtin_my_large_string_8; - ann_custom_ComplexStruct.reset(); - CompleteMemberDetail detail_my_large_string_8 = TypeObjectUtils::build_complete_member_detail(name_my_large_string_8, member_ann_builtin_my_large_string_8, ann_custom_ComplexStruct); - CompleteStructMember member_my_large_string_8 = TypeObjectUtils::build_complete_struct_member(common_my_large_string_8, detail_my_large_string_8); - TypeObjectUtils::add_complete_struct_member(member_seq_ComplexStruct, member_my_large_string_8); - } - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_array_anonymous_string_75_5_5", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_string_75", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - std::string type_id_kind_anonymous_string_75("TI_STRING8_SMALL"); - if (type_id_kind_anonymous_string_75 == "TI_STRING8_SMALL") - { - SBound bound = static_cast(75); - 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_75")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_string_75 already registered in TypeObjectRegistry for a different type."); - } - } - else if (type_id_kind_anonymous_string_75 == "TI_STRING8_LARGE") - { - LBound bound = 75; - 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_75")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_string_75 already registered in TypeObjectRegistry for a different type."); - } - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_string_75: Unknown String kind."); - return; - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_string_75", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_string_75: Given String TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - TypeIdentifier* element_identifier_anonymous_array_anonymous_string_75_5_5 {nullptr}; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_array_anonymous_string_75_5_5 = new TypeIdentifier(type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_array_anonymous_string_75_5_5 = new TypeIdentifier(type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Array element TypeIdentifier inconsistent."); - return; - } - EquivalenceKind equiv_kind_anonymous_array_anonymous_string_75_5_5 = EK_COMPLETE; - if (TK_NONE == type_ids_ComplexStruct.type_identifier2()._d()) - { - equiv_kind_anonymous_array_anonymous_string_75_5_5 = EK_BOTH; - } - CollectionElementFlag element_flags_anonymous_array_anonymous_string_75_5_5 = 0; - PlainCollectionHeader header_anonymous_array_anonymous_string_75_5_5 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_anonymous_string_75_5_5, element_flags_anonymous_array_anonymous_string_75_5_5); - std::string type_id_kind_anonymous_array_anonymous_string_75_5_5("TI_PLAIN_ARRAY_SMALL"); - if (type_id_kind_anonymous_array_anonymous_string_75_5_5 == "TI_PLAIN_ARRAY_SMALL") - { - SBoundSeq array_bound_seq; - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(5)); - - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(5)); - - PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_anonymous_string_75_5_5, array_bound_seq, - eprosima::fastcdr::external(element_identifier_anonymous_array_anonymous_string_75_5_5)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_anonymous_string_75_5_5")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_anonymous_string_75_5_5 already registered in TypeObjectRegistry for a different type."); - } - } - else - { - LBoundSeq array_bound_seq; - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(5)); - - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(5)); - - PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_anonymous_string_75_5_5, array_bound_seq, - eprosima::fastcdr::external(element_identifier_anonymous_array_anonymous_string_75_5_5)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_anonymous_string_75_5_5")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_anonymous_string_75_5_5 already registered in TypeObjectRegistry for a different type."); - } - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_array_anonymous_string_75_5_5", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_anonymous_string_75_5_5: Given Array TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_array_string = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_array_string; - MemberId member_id_my_array_string = 0x00000010; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_array_string = TypeObjectUtils::build_common_struct_member(member_id_my_array_string, member_flags_my_array_string, type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_array_string = TypeObjectUtils::build_common_struct_member(member_id_my_array_string, member_flags_my_array_string, type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_array_string member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_array_string = "my_array_string"; - eprosima::fastcdr::optional member_ann_builtin_my_array_string; - ann_custom_ComplexStruct.reset(); - CompleteMemberDetail detail_my_array_string = TypeObjectUtils::build_complete_member_detail(name_my_array_string, member_ann_builtin_my_array_string, ann_custom_ComplexStruct); - CompleteStructMember member_my_array_string = TypeObjectUtils::build_complete_struct_member(common_my_array_string, detail_my_array_string); - TypeObjectUtils::add_complete_struct_member(member_seq_ComplexStruct, member_my_array_string); - } - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MA3", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - AliasTypeFlag alias_flags_MA3 = 0; - QualifiedTypeName type_name_MA3 = "MA3"; - eprosima::fastcdr::optional type_ann_builtin_MA3; - eprosima::fastcdr::optional ann_custom_MA3; - CompleteTypeDetail detail_MA3 = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_MA3, ann_custom_MA3, type_name_MA3.to_string()); - CompleteAliasHeader header_MA3 = TypeObjectUtils::build_complete_alias_header(detail_MA3); - AliasMemberFlag related_flags_MA3 = 0; - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_array_MyAliasEnum3_42", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyAliasEnum3", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - AliasTypeFlag alias_flags_MyAliasEnum3 = 0; - QualifiedTypeName type_name_MyAliasEnum3 = "MyAliasEnum3"; - eprosima::fastcdr::optional type_ann_builtin_MyAliasEnum3; - eprosima::fastcdr::optional ann_custom_MyAliasEnum3; - CompleteTypeDetail detail_MyAliasEnum3 = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_MyAliasEnum3, ann_custom_MyAliasEnum3, type_name_MyAliasEnum3.to_string()); - CompleteAliasHeader header_MyAliasEnum3 = TypeObjectUtils::build_complete_alias_header(detail_MyAliasEnum3); - AliasMemberFlag related_flags_MyAliasEnum3 = 0; - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyAliasEnum2", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - AliasTypeFlag alias_flags_MyAliasEnum2 = 0; - QualifiedTypeName type_name_MyAliasEnum2 = "MyAliasEnum2"; - eprosima::fastcdr::optional type_ann_builtin_MyAliasEnum2; - eprosima::fastcdr::optional ann_custom_MyAliasEnum2; - CompleteTypeDetail detail_MyAliasEnum2 = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_MyAliasEnum2, ann_custom_MyAliasEnum2, type_name_MyAliasEnum2.to_string()); - CompleteAliasHeader header_MyAliasEnum2 = TypeObjectUtils::build_complete_alias_header(detail_MyAliasEnum2); - AliasMemberFlag related_flags_MyAliasEnum2 = 0; - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyAliasEnum", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - AliasTypeFlag alias_flags_MyAliasEnum = 0; - QualifiedTypeName type_name_MyAliasEnum = "MyAliasEnum"; - eprosima::fastcdr::optional type_ann_builtin_MyAliasEnum; - eprosima::fastcdr::optional ann_custom_MyAliasEnum; - CompleteTypeDetail detail_MyAliasEnum = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_MyAliasEnum, ann_custom_MyAliasEnum, type_name_MyAliasEnum.to_string()); - CompleteAliasHeader header_MyAliasEnum = TypeObjectUtils::build_complete_alias_header(detail_MyAliasEnum); - AliasMemberFlag related_flags_MyAliasEnum = 0; - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyEnum", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EnumTypeFlag enum_flags_MyEnum = 0; - BitBound bit_bound_MyEnum = 32; - CommonEnumeratedHeader common_MyEnum = TypeObjectUtils::build_common_enumerated_header(bit_bound_MyEnum); - QualifiedTypeName type_name_MyEnum = "MyEnum"; - eprosima::fastcdr::optional type_ann_builtin_MyEnum; - eprosima::fastcdr::optional ann_custom_MyEnum; - CompleteTypeDetail detail_MyEnum = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_MyEnum, ann_custom_MyEnum, type_name_MyEnum.to_string()); - CompleteEnumeratedHeader header_MyEnum = TypeObjectUtils::build_complete_enumerated_header(common_MyEnum, detail_MyEnum); - CompleteEnumeratedLiteralSeq literal_seq_MyEnum; - { - EnumeratedLiteralFlag flags_A = TypeObjectUtils::build_enumerated_literal_flag(false); - CommonEnumeratedLiteral common_A = TypeObjectUtils::build_common_enumerated_literal(0, flags_A); - eprosima::fastcdr::optional member_ann_builtin_A; - ann_custom_MyEnum.reset(); - MemberName name_A = "A"; - CompleteMemberDetail detail_A = TypeObjectUtils::build_complete_member_detail(name_A, member_ann_builtin_A, ann_custom_MyEnum); - CompleteEnumeratedLiteral literal_A = TypeObjectUtils::build_complete_enumerated_literal(common_A, detail_A); - TypeObjectUtils::add_complete_enumerated_literal(literal_seq_MyEnum, literal_A); - } - { - EnumeratedLiteralFlag flags_B = TypeObjectUtils::build_enumerated_literal_flag(false); - CommonEnumeratedLiteral common_B = TypeObjectUtils::build_common_enumerated_literal(1, flags_B); - eprosima::fastcdr::optional member_ann_builtin_B; - ann_custom_MyEnum.reset(); - MemberName name_B = "B"; - CompleteMemberDetail detail_B = TypeObjectUtils::build_complete_member_detail(name_B, member_ann_builtin_B, ann_custom_MyEnum); - CompleteEnumeratedLiteral literal_B = TypeObjectUtils::build_complete_enumerated_literal(common_B, detail_B); - TypeObjectUtils::add_complete_enumerated_literal(literal_seq_MyEnum, literal_B); - } - { - EnumeratedLiteralFlag flags_C = TypeObjectUtils::build_enumerated_literal_flag(false); - CommonEnumeratedLiteral common_C = TypeObjectUtils::build_common_enumerated_literal(2, flags_C); - eprosima::fastcdr::optional member_ann_builtin_C; - ann_custom_MyEnum.reset(); - MemberName name_C = "C"; - CompleteMemberDetail detail_C = TypeObjectUtils::build_complete_member_detail(name_C, member_ann_builtin_C, ann_custom_MyEnum); - CompleteEnumeratedLiteral literal_C = TypeObjectUtils::build_complete_enumerated_literal(common_C, detail_C); - TypeObjectUtils::add_complete_enumerated_literal(literal_seq_MyEnum, literal_C); - } - CompleteEnumeratedType enumerated_type_MyEnum = TypeObjectUtils::build_complete_enumerated_type(enum_flags_MyEnum, header_MyEnum, - literal_seq_MyEnum); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_enumerated_type_object(enumerated_type_MyEnum, type_name_MyEnum.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyEnum already registered in TypeObjectRegistry for a different type."); - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyEnum", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyEnum: Given Enum TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - CommonAliasBody common_MyAliasEnum; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_MyAliasEnum = TypeObjectUtils::build_common_alias_body(related_flags_MyAliasEnum, type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_MyAliasEnum = TypeObjectUtils::build_common_alias_body(related_flags_MyAliasEnum, type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyAliasEnum related TypeIdentifier inconsistent."); - return; - } - eprosima::fastcdr::optional member_ann_builtin_MyAliasEnum; - ann_custom_MyAliasEnum.reset(); - CompleteAliasBody body_MyAliasEnum = TypeObjectUtils::build_complete_alias_body(common_MyAliasEnum, member_ann_builtin_MyAliasEnum, ann_custom_MyAliasEnum); - CompleteAliasType alias_type_MyAliasEnum = TypeObjectUtils::build_complete_alias_type(alias_flags_MyAliasEnum, header_MyAliasEnum, body_MyAliasEnum); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_alias_type_object(alias_type_MyAliasEnum, type_name_MyAliasEnum.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyAliasEnum already registered in TypeObjectRegistry for a different type."); - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyAliasEnum", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyAliasEnum: Given Alias TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - CommonAliasBody common_MyAliasEnum2; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_MyAliasEnum2 = TypeObjectUtils::build_common_alias_body(related_flags_MyAliasEnum2, type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_MyAliasEnum2 = TypeObjectUtils::build_common_alias_body(related_flags_MyAliasEnum2, type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyAliasEnum2 related TypeIdentifier inconsistent."); - return; - } - eprosima::fastcdr::optional member_ann_builtin_MyAliasEnum2; - ann_custom_MyAliasEnum2.reset(); - CompleteAliasBody body_MyAliasEnum2 = TypeObjectUtils::build_complete_alias_body(common_MyAliasEnum2, member_ann_builtin_MyAliasEnum2, ann_custom_MyAliasEnum2); - CompleteAliasType alias_type_MyAliasEnum2 = TypeObjectUtils::build_complete_alias_type(alias_flags_MyAliasEnum2, header_MyAliasEnum2, body_MyAliasEnum2); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_alias_type_object(alias_type_MyAliasEnum2, type_name_MyAliasEnum2.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyAliasEnum2 already registered in TypeObjectRegistry for a different type."); - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyAliasEnum2", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyAliasEnum2: Given Alias TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - CommonAliasBody common_MyAliasEnum3; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_MyAliasEnum3 = TypeObjectUtils::build_common_alias_body(related_flags_MyAliasEnum3, type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_MyAliasEnum3 = TypeObjectUtils::build_common_alias_body(related_flags_MyAliasEnum3, type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyAliasEnum3 related TypeIdentifier inconsistent."); - return; - } - eprosima::fastcdr::optional member_ann_builtin_MyAliasEnum3; - ann_custom_MyAliasEnum3.reset(); - CompleteAliasBody body_MyAliasEnum3 = TypeObjectUtils::build_complete_alias_body(common_MyAliasEnum3, member_ann_builtin_MyAliasEnum3, ann_custom_MyAliasEnum3); - CompleteAliasType alias_type_MyAliasEnum3 = TypeObjectUtils::build_complete_alias_type(alias_flags_MyAliasEnum3, header_MyAliasEnum3, body_MyAliasEnum3); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_alias_type_object(alias_type_MyAliasEnum3, type_name_MyAliasEnum3.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyAliasEnum3 already registered in TypeObjectRegistry for a different type."); - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyAliasEnum3", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyAliasEnum3: Given Alias TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - TypeIdentifier* element_identifier_anonymous_array_MyAliasEnum3_42 {nullptr}; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_array_MyAliasEnum3_42 = new TypeIdentifier(type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_array_MyAliasEnum3_42 = new TypeIdentifier(type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Array element TypeIdentifier inconsistent."); - return; - } - EquivalenceKind equiv_kind_anonymous_array_MyAliasEnum3_42 = EK_COMPLETE; - if (TK_NONE == type_ids_ComplexStruct.type_identifier2()._d()) - { - equiv_kind_anonymous_array_MyAliasEnum3_42 = EK_BOTH; - } - CollectionElementFlag element_flags_anonymous_array_MyAliasEnum3_42 = 0; - PlainCollectionHeader header_anonymous_array_MyAliasEnum3_42 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_MyAliasEnum3_42, element_flags_anonymous_array_MyAliasEnum3_42); - std::string type_id_kind_anonymous_array_MyAliasEnum3_42("TI_PLAIN_ARRAY_SMALL"); - if (type_id_kind_anonymous_array_MyAliasEnum3_42 == "TI_PLAIN_ARRAY_SMALL") - { - SBoundSeq array_bound_seq; - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(42)); - - PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_MyAliasEnum3_42, array_bound_seq, - eprosima::fastcdr::external(element_identifier_anonymous_array_MyAliasEnum3_42)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_MyAliasEnum3_42")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_MyAliasEnum3_42 already registered in TypeObjectRegistry for a different type."); - } - } - else - { - LBoundSeq array_bound_seq; - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(42)); - - PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_MyAliasEnum3_42, array_bound_seq, - eprosima::fastcdr::external(element_identifier_anonymous_array_MyAliasEnum3_42)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_MyAliasEnum3_42")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_MyAliasEnum3_42 already registered in TypeObjectRegistry for a different type."); - } - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_array_MyAliasEnum3_42", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_MyAliasEnum3_42: Given Array TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - CommonAliasBody common_MA3; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_MA3 = TypeObjectUtils::build_common_alias_body(related_flags_MA3, type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_MA3 = TypeObjectUtils::build_common_alias_body(related_flags_MA3, type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MA3 related TypeIdentifier inconsistent."); - return; - } - eprosima::fastcdr::optional member_ann_builtin_MA3; - ann_custom_MA3.reset(); - CompleteAliasBody body_MA3 = TypeObjectUtils::build_complete_alias_body(common_MA3, member_ann_builtin_MA3, ann_custom_MA3); - CompleteAliasType alias_type_MA3 = TypeObjectUtils::build_complete_alias_type(alias_flags_MA3, header_MA3, body_MA3); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_alias_type_object(alias_type_MA3, type_name_MA3.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MA3 already registered in TypeObjectRegistry for a different type."); - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MA3", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MA3: Given Alias TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_multi_alias_array_42 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_multi_alias_array_42; - MemberId member_id_multi_alias_array_42 = 0x00000011; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_multi_alias_array_42 = TypeObjectUtils::build_common_struct_member(member_id_multi_alias_array_42, member_flags_multi_alias_array_42, type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_multi_alias_array_42 = TypeObjectUtils::build_common_struct_member(member_id_multi_alias_array_42, member_flags_multi_alias_array_42, type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure multi_alias_array_42 member TypeIdentifier inconsistent."); - return; - } - MemberName name_multi_alias_array_42 = "multi_alias_array_42"; - eprosima::fastcdr::optional member_ann_builtin_multi_alias_array_42; - ann_custom_ComplexStruct.reset(); - CompleteMemberDetail detail_multi_alias_array_42 = TypeObjectUtils::build_complete_member_detail(name_multi_alias_array_42, member_ann_builtin_multi_alias_array_42, ann_custom_ComplexStruct); - CompleteStructMember member_multi_alias_array_42 = TypeObjectUtils::build_complete_struct_member(common_multi_alias_array_42, detail_multi_alias_array_42); - TypeObjectUtils::add_complete_struct_member(member_seq_ComplexStruct, member_multi_alias_array_42); - } - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_array_anonymous_array_int32_t_2_5", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyMiniArray", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - AliasTypeFlag alias_flags_MyMiniArray = 0; - QualifiedTypeName type_name_MyMiniArray = "MyMiniArray"; - eprosima::fastcdr::optional type_ann_builtin_MyMiniArray; - eprosima::fastcdr::optional ann_custom_MyMiniArray; - CompleteTypeDetail detail_MyMiniArray = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_MyMiniArray, ann_custom_MyMiniArray, type_name_MyMiniArray.to_string()); - CompleteAliasHeader header_MyMiniArray = TypeObjectUtils::build_complete_alias_header(detail_MyMiniArray); - AliasMemberFlag related_flags_MyMiniArray = 0; - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_array_int32_t_2", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Array element TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - TypeIdentifier* element_identifier_anonymous_array_int32_t_2 {nullptr}; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_array_int32_t_2 = new TypeIdentifier(type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_array_int32_t_2 = new TypeIdentifier(type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Array element TypeIdentifier inconsistent."); - return; - } - EquivalenceKind equiv_kind_anonymous_array_int32_t_2 = EK_COMPLETE; - if (TK_NONE == type_ids_ComplexStruct.type_identifier2()._d()) - { - equiv_kind_anonymous_array_int32_t_2 = EK_BOTH; - } - CollectionElementFlag element_flags_anonymous_array_int32_t_2 = 0; - PlainCollectionHeader header_anonymous_array_int32_t_2 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_int32_t_2, element_flags_anonymous_array_int32_t_2); - std::string type_id_kind_anonymous_array_int32_t_2("TI_PLAIN_ARRAY_SMALL"); - if (type_id_kind_anonymous_array_int32_t_2 == "TI_PLAIN_ARRAY_SMALL") - { - SBoundSeq array_bound_seq; - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(2)); - - PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_int32_t_2, array_bound_seq, - eprosima::fastcdr::external(element_identifier_anonymous_array_int32_t_2)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_int32_t_2")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_int32_t_2 already registered in TypeObjectRegistry for a different type."); - } - } - else - { - LBoundSeq array_bound_seq; - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(2)); - - PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_int32_t_2, array_bound_seq, - eprosima::fastcdr::external(element_identifier_anonymous_array_int32_t_2)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_int32_t_2")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_int32_t_2 already registered in TypeObjectRegistry for a different type."); - } - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_array_int32_t_2", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_int32_t_2: Given Array TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - CommonAliasBody common_MyMiniArray; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_MyMiniArray = TypeObjectUtils::build_common_alias_body(related_flags_MyMiniArray, type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_MyMiniArray = TypeObjectUtils::build_common_alias_body(related_flags_MyMiniArray, type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyMiniArray related TypeIdentifier inconsistent."); - return; - } - eprosima::fastcdr::optional member_ann_builtin_MyMiniArray; - ann_custom_MyMiniArray.reset(); - CompleteAliasBody body_MyMiniArray = TypeObjectUtils::build_complete_alias_body(common_MyMiniArray, member_ann_builtin_MyMiniArray, ann_custom_MyMiniArray); - CompleteAliasType alias_type_MyMiniArray = TypeObjectUtils::build_complete_alias_type(alias_flags_MyMiniArray, header_MyMiniArray, body_MyMiniArray); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_alias_type_object(alias_type_MyMiniArray, type_name_MyMiniArray.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyMiniArray already registered in TypeObjectRegistry for a different type."); - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyMiniArray", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyMiniArray: Given Alias TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - TypeIdentifier* element_identifier_anonymous_array_anonymous_array_int32_t_2_5 {nullptr}; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_array_anonymous_array_int32_t_2_5 = new TypeIdentifier(type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_array_anonymous_array_int32_t_2_5 = new TypeIdentifier(type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Array element TypeIdentifier inconsistent."); - return; - } - EquivalenceKind equiv_kind_anonymous_array_anonymous_array_int32_t_2_5 = EK_COMPLETE; - if (TK_NONE == type_ids_ComplexStruct.type_identifier2()._d()) - { - equiv_kind_anonymous_array_anonymous_array_int32_t_2_5 = EK_BOTH; - } - CollectionElementFlag element_flags_anonymous_array_anonymous_array_int32_t_2_5 = 0; - PlainCollectionHeader header_anonymous_array_anonymous_array_int32_t_2_5 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_anonymous_array_int32_t_2_5, element_flags_anonymous_array_anonymous_array_int32_t_2_5); - std::string type_id_kind_anonymous_array_anonymous_array_int32_t_2_5("TI_PLAIN_ARRAY_SMALL"); - if (type_id_kind_anonymous_array_anonymous_array_int32_t_2_5 == "TI_PLAIN_ARRAY_SMALL") - { - SBoundSeq array_bound_seq; - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(5)); - - PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_anonymous_array_int32_t_2_5, array_bound_seq, - eprosima::fastcdr::external(element_identifier_anonymous_array_anonymous_array_int32_t_2_5)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_anonymous_array_int32_t_2_5")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_anonymous_array_int32_t_2_5 already registered in TypeObjectRegistry for a different type."); - } - } - else - { - LBoundSeq array_bound_seq; - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(5)); - - PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_anonymous_array_int32_t_2_5, array_bound_seq, - eprosima::fastcdr::external(element_identifier_anonymous_array_anonymous_array_int32_t_2_5)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_anonymous_array_int32_t_2_5")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_anonymous_array_int32_t_2_5 already registered in TypeObjectRegistry for a different type."); - } - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_array_anonymous_array_int32_t_2_5", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_anonymous_array_int32_t_2_5: Given Array TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_array_arrays = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_array_arrays; - MemberId member_id_my_array_arrays = 0x00000012; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_array_arrays = TypeObjectUtils::build_common_struct_member(member_id_my_array_arrays, member_flags_my_array_arrays, type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_array_arrays = TypeObjectUtils::build_common_struct_member(member_id_my_array_arrays, member_flags_my_array_arrays, type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_array_arrays member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_array_arrays = "my_array_arrays"; - eprosima::fastcdr::optional member_ann_builtin_my_array_arrays; - ann_custom_ComplexStruct.reset(); - CompleteMemberDetail detail_my_array_arrays = TypeObjectUtils::build_complete_member_detail(name_my_array_arrays, member_ann_builtin_my_array_arrays, ann_custom_ComplexStruct); - CompleteStructMember member_my_array_arrays = TypeObjectUtils::build_complete_struct_member(common_my_array_arrays, detail_my_array_arrays); - TypeObjectUtils::add_complete_struct_member(member_seq_ComplexStruct, member_my_array_arrays); - } - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_array_anonymous_sequence_int32_t_unbounded_23", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MySequenceLong", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - AliasTypeFlag alias_flags_MySequenceLong = 0; - QualifiedTypeName type_name_MySequenceLong = "MySequenceLong"; - eprosima::fastcdr::optional type_ann_builtin_MySequenceLong; - eprosima::fastcdr::optional ann_custom_MySequenceLong; - CompleteTypeDetail detail_MySequenceLong = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_MySequenceLong, ann_custom_MySequenceLong, type_name_MySequenceLong.to_string()); - CompleteAliasHeader header_MySequenceLong = TypeObjectUtils::build_complete_alias_header(detail_MySequenceLong); - AliasMemberFlag related_flags_MySequenceLong = 0; - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_sequence_int32_t_unbounded", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Sequence element TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - TypeIdentifier* element_identifier_anonymous_sequence_int32_t_unbounded {nullptr}; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_sequence_int32_t_unbounded = new TypeIdentifier(type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_sequence_int32_t_unbounded = new TypeIdentifier(type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Sequence element TypeIdentifier inconsistent."); - return; - } - EquivalenceKind equiv_kind_anonymous_sequence_int32_t_unbounded = EK_COMPLETE; - if (TK_NONE == type_ids_ComplexStruct.type_identifier2()._d()) - { - equiv_kind_anonymous_sequence_int32_t_unbounded = EK_BOTH; - } - CollectionElementFlag element_flags_anonymous_sequence_int32_t_unbounded = 0; - PlainCollectionHeader header_anonymous_sequence_int32_t_unbounded = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_sequence_int32_t_unbounded, element_flags_anonymous_sequence_int32_t_unbounded); - std::string type_id_kind_anonymous_sequence_int32_t_unbounded("TI_PLAIN_SEQUENCE_SMALL"); - if (type_id_kind_anonymous_sequence_int32_t_unbounded == "TI_PLAIN_SEQUENCE_SMALL") - { - SBound bound = 0; - PlainSequenceSElemDefn seq_sdefn = TypeObjectUtils::build_plain_sequence_s_elem_defn(header_anonymous_sequence_int32_t_unbounded, bound, - eprosima::fastcdr::external(element_identifier_anonymous_sequence_int32_t_unbounded)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_s_sequence_type_identifier(seq_sdefn, "anonymous_sequence_int32_t_unbounded")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_sequence_int32_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_int32_t_unbounded, bound, - eprosima::fastcdr::external(element_identifier_anonymous_sequence_int32_t_unbounded)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_l_sequence_type_identifier(seq_ldefn, "anonymous_sequence_int32_t_unbounded")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_sequence_int32_t_unbounded already registered in TypeObjectRegistry for a different type."); - } - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_sequence_int32_t_unbounded", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_sequence_int32_t_unbounded: Given Sequence TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - CommonAliasBody common_MySequenceLong; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_MySequenceLong = TypeObjectUtils::build_common_alias_body(related_flags_MySequenceLong, type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_MySequenceLong = TypeObjectUtils::build_common_alias_body(related_flags_MySequenceLong, type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MySequenceLong related TypeIdentifier inconsistent."); - return; - } - eprosima::fastcdr::optional member_ann_builtin_MySequenceLong; - ann_custom_MySequenceLong.reset(); - CompleteAliasBody body_MySequenceLong = TypeObjectUtils::build_complete_alias_body(common_MySequenceLong, member_ann_builtin_MySequenceLong, ann_custom_MySequenceLong); - CompleteAliasType alias_type_MySequenceLong = TypeObjectUtils::build_complete_alias_type(alias_flags_MySequenceLong, header_MySequenceLong, body_MySequenceLong); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_alias_type_object(alias_type_MySequenceLong, type_name_MySequenceLong.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MySequenceLong already registered in TypeObjectRegistry for a different type."); - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MySequenceLong", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MySequenceLong: Given Alias TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - TypeIdentifier* element_identifier_anonymous_array_anonymous_sequence_int32_t_unbounded_23 {nullptr}; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_array_anonymous_sequence_int32_t_unbounded_23 = new TypeIdentifier(type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_array_anonymous_sequence_int32_t_unbounded_23 = new TypeIdentifier(type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Array element TypeIdentifier inconsistent."); - return; - } - EquivalenceKind equiv_kind_anonymous_array_anonymous_sequence_int32_t_unbounded_23 = EK_COMPLETE; - if (TK_NONE == type_ids_ComplexStruct.type_identifier2()._d()) - { - equiv_kind_anonymous_array_anonymous_sequence_int32_t_unbounded_23 = EK_BOTH; - } - CollectionElementFlag element_flags_anonymous_array_anonymous_sequence_int32_t_unbounded_23 = 0; - PlainCollectionHeader header_anonymous_array_anonymous_sequence_int32_t_unbounded_23 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_anonymous_sequence_int32_t_unbounded_23, element_flags_anonymous_array_anonymous_sequence_int32_t_unbounded_23); - std::string type_id_kind_anonymous_array_anonymous_sequence_int32_t_unbounded_23("TI_PLAIN_ARRAY_SMALL"); - if (type_id_kind_anonymous_array_anonymous_sequence_int32_t_unbounded_23 == "TI_PLAIN_ARRAY_SMALL") - { - SBoundSeq array_bound_seq; - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(23)); - - PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_anonymous_sequence_int32_t_unbounded_23, array_bound_seq, - eprosima::fastcdr::external(element_identifier_anonymous_array_anonymous_sequence_int32_t_unbounded_23)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_anonymous_sequence_int32_t_unbounded_23")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_anonymous_sequence_int32_t_unbounded_23 already registered in TypeObjectRegistry for a different type."); - } - } - else - { - LBoundSeq array_bound_seq; - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(23)); - - PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_anonymous_sequence_int32_t_unbounded_23, array_bound_seq, - eprosima::fastcdr::external(element_identifier_anonymous_array_anonymous_sequence_int32_t_unbounded_23)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_anonymous_sequence_int32_t_unbounded_23")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_anonymous_sequence_int32_t_unbounded_23 already registered in TypeObjectRegistry for a different type."); - } - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_array_anonymous_sequence_int32_t_unbounded_23", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_anonymous_sequence_int32_t_unbounded_23: Given Array TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_sequences_array = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_sequences_array; - MemberId member_id_my_sequences_array = 0x00000013; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_sequences_array = TypeObjectUtils::build_common_struct_member(member_id_my_sequences_array, member_flags_my_sequences_array, type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_sequences_array = TypeObjectUtils::build_common_struct_member(member_id_my_sequences_array, member_flags_my_sequences_array, type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_sequences_array member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_sequences_array = "my_sequences_array"; - eprosima::fastcdr::optional member_ann_builtin_my_sequences_array; - ann_custom_ComplexStruct.reset(); - CompleteMemberDetail detail_my_sequences_array = TypeObjectUtils::build_complete_member_detail(name_my_sequences_array, member_ann_builtin_my_sequences_array, ann_custom_ComplexStruct); - CompleteStructMember member_my_sequences_array = TypeObjectUtils::build_complete_struct_member(common_my_sequences_array, detail_my_sequences_array); - TypeObjectUtils::add_complete_struct_member(member_seq_ComplexStruct, member_my_sequences_array); - } - CompleteStructType struct_type_ComplexStruct = TypeObjectUtils::build_complete_struct_type(struct_flags_ComplexStruct, header_ComplexStruct, member_seq_ComplexStruct); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_ComplexStruct, type_name_ComplexStruct.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "ComplexStruct already registered in TypeObjectRegistry for a different type."); - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "ComplexStruct", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "ComplexStruct: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } -} -void register_MyUnion_type_identifier() -{ - { - ReturnCode_t return_code_MyUnion; - TypeIdentifierPair type_ids_MyUnion; - UnionTypeFlag union_flags_MyUnion = TypeObjectUtils::build_union_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - QualifiedTypeName type_name_MyUnion = "MyUnion"; - eprosima::fastcdr::optional type_ann_builtin_MyUnion; - eprosima::fastcdr::optional ann_custom_MyUnion; - CompleteTypeDetail detail_MyUnion = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_MyUnion, ann_custom_MyUnion, type_name_MyUnion.to_string()); - CompleteUnionHeader header_MyUnion = TypeObjectUtils::build_complete_union_header(detail_MyUnion); - UnionDiscriminatorFlag member_flags_MyUnion = TypeObjectUtils::build_union_discriminator_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false); - return_code_MyUnion = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyEnum", type_ids_MyUnion); - - if (return_code_MyUnion != eprosima::fastdds::dds::RETCODE_OK) - { - EnumTypeFlag enum_flags_MyEnum = 0; - BitBound bit_bound_MyEnum = 32; - CommonEnumeratedHeader common_MyEnum = TypeObjectUtils::build_common_enumerated_header(bit_bound_MyEnum); - QualifiedTypeName type_name_MyEnum = "MyEnum"; - eprosima::fastcdr::optional type_ann_builtin_MyEnum; - eprosima::fastcdr::optional ann_custom_MyEnum; - CompleteTypeDetail detail_MyEnum = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_MyEnum, ann_custom_MyEnum, type_name_MyEnum.to_string()); - CompleteEnumeratedHeader header_MyEnum = TypeObjectUtils::build_complete_enumerated_header(common_MyEnum, detail_MyEnum); - CompleteEnumeratedLiteralSeq literal_seq_MyEnum; - { - EnumeratedLiteralFlag flags_A = TypeObjectUtils::build_enumerated_literal_flag(false); - CommonEnumeratedLiteral common_A = TypeObjectUtils::build_common_enumerated_literal(0, flags_A); - eprosima::fastcdr::optional member_ann_builtin_A; - ann_custom_MyEnum.reset(); - MemberName name_A = "A"; - CompleteMemberDetail detail_A = TypeObjectUtils::build_complete_member_detail(name_A, member_ann_builtin_A, ann_custom_MyEnum); - CompleteEnumeratedLiteral literal_A = TypeObjectUtils::build_complete_enumerated_literal(common_A, detail_A); - TypeObjectUtils::add_complete_enumerated_literal(literal_seq_MyEnum, literal_A); - } - { - EnumeratedLiteralFlag flags_B = TypeObjectUtils::build_enumerated_literal_flag(false); - CommonEnumeratedLiteral common_B = TypeObjectUtils::build_common_enumerated_literal(1, flags_B); - eprosima::fastcdr::optional member_ann_builtin_B; - ann_custom_MyEnum.reset(); - MemberName name_B = "B"; - CompleteMemberDetail detail_B = TypeObjectUtils::build_complete_member_detail(name_B, member_ann_builtin_B, ann_custom_MyEnum); - CompleteEnumeratedLiteral literal_B = TypeObjectUtils::build_complete_enumerated_literal(common_B, detail_B); - TypeObjectUtils::add_complete_enumerated_literal(literal_seq_MyEnum, literal_B); - } - { - EnumeratedLiteralFlag flags_C = TypeObjectUtils::build_enumerated_literal_flag(false); - CommonEnumeratedLiteral common_C = TypeObjectUtils::build_common_enumerated_literal(2, flags_C); - eprosima::fastcdr::optional member_ann_builtin_C; - ann_custom_MyEnum.reset(); - MemberName name_C = "C"; - CompleteMemberDetail detail_C = TypeObjectUtils::build_complete_member_detail(name_C, member_ann_builtin_C, ann_custom_MyEnum); - CompleteEnumeratedLiteral literal_C = TypeObjectUtils::build_complete_enumerated_literal(common_C, detail_C); - TypeObjectUtils::add_complete_enumerated_literal(literal_seq_MyEnum, literal_C); - } - CompleteEnumeratedType enumerated_type_MyEnum = TypeObjectUtils::build_complete_enumerated_type(enum_flags_MyEnum, header_MyEnum, - literal_seq_MyEnum); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_enumerated_type_object(enumerated_type_MyEnum, type_name_MyEnum.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyEnum already registered in TypeObjectRegistry for a different type."); - } - return_code_MyUnion = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyEnum", type_ids_MyUnion); - if (return_code_MyUnion != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyEnum: Given Enum TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - CommonDiscriminatorMember common_MyUnion; - if (EK_COMPLETE == type_ids_MyUnion.type_identifier1()._d() || TK_NONE == type_ids_MyUnion.type_identifier2()._d()) - { - common_MyUnion = TypeObjectUtils::build_common_discriminator_member(member_flags_MyUnion, type_ids_MyUnion.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_MyUnion.type_identifier2()._d()) - { - common_MyUnion = TypeObjectUtils::build_common_discriminator_member(member_flags_MyUnion, type_ids_MyUnion.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyUnion discriminator TypeIdentifier inconsistent."); - return; - } - type_ann_builtin_MyUnion.reset(); - ann_custom_MyUnion.reset(); - CompleteDiscriminatorMember discriminator_MyUnion = TypeObjectUtils::build_complete_discriminator_member(common_MyUnion, - type_ann_builtin_MyUnion, ann_custom_MyUnion); - CompleteUnionMemberSeq member_seq_MyUnion; - { - return_code_MyUnion = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "BasicStruct", type_ids_MyUnion); - - if (return_code_MyUnion != eprosima::fastdds::dds::RETCODE_OK) - { - { - StructTypeFlag struct_flags_BasicStruct = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_BasicStruct; - TypeIdentifierPair type_ids_BasicStruct; - QualifiedTypeName type_name_BasicStruct = "BasicStruct"; - eprosima::fastcdr::optional type_ann_builtin_BasicStruct; - eprosima::fastcdr::optional ann_custom_BasicStruct; - CompleteTypeDetail detail_BasicStruct = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_BasicStruct, ann_custom_BasicStruct, type_name_BasicStruct.to_string()); - CompleteStructHeader header_BasicStruct; - header_BasicStruct = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_BasicStruct); - CompleteStructMemberSeq member_seq_BasicStruct; - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_bool", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_bool Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_bool = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_bool; - MemberId member_id_my_bool = 0x00000000; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_bool = TypeObjectUtils::build_common_struct_member(member_id_my_bool, member_flags_my_bool, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_bool = TypeObjectUtils::build_common_struct_member(member_id_my_bool, member_flags_my_bool, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_bool member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_bool = "my_bool"; - eprosima::fastcdr::optional member_ann_builtin_my_bool; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_bool = TypeObjectUtils::build_complete_member_detail(name_my_bool, member_ann_builtin_my_bool, ann_custom_BasicStruct); - CompleteStructMember member_my_bool = TypeObjectUtils::build_complete_struct_member(common_my_bool, detail_my_bool); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_bool); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_byte", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_octet Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_octet = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_octet; - MemberId member_id_my_octet = 0x00000001; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_octet = TypeObjectUtils::build_common_struct_member(member_id_my_octet, member_flags_my_octet, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_octet = TypeObjectUtils::build_common_struct_member(member_id_my_octet, member_flags_my_octet, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_octet member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_octet = "my_octet"; - eprosima::fastcdr::optional member_ann_builtin_my_octet; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_octet = TypeObjectUtils::build_complete_member_detail(name_my_octet, member_ann_builtin_my_octet, ann_custom_BasicStruct); - CompleteStructMember member_my_octet = TypeObjectUtils::build_complete_struct_member(common_my_octet, detail_my_octet); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_octet); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int16_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_int16 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_int16 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_int16; - MemberId member_id_my_int16 = 0x00000002; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_int16 = TypeObjectUtils::build_common_struct_member(member_id_my_int16, member_flags_my_int16, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_int16 = TypeObjectUtils::build_common_struct_member(member_id_my_int16, member_flags_my_int16, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_int16 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_int16 = "my_int16"; - eprosima::fastcdr::optional member_ann_builtin_my_int16; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_int16 = TypeObjectUtils::build_complete_member_detail(name_my_int16, member_ann_builtin_my_int16, ann_custom_BasicStruct); - CompleteStructMember member_my_int16 = TypeObjectUtils::build_complete_struct_member(common_my_int16, detail_my_int16); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_int16); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_int32 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_int32 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_int32; - MemberId member_id_my_int32 = 0x00000003; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_int32 = TypeObjectUtils::build_common_struct_member(member_id_my_int32, member_flags_my_int32, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_int32 = TypeObjectUtils::build_common_struct_member(member_id_my_int32, member_flags_my_int32, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_int32 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_int32 = "my_int32"; - eprosima::fastcdr::optional member_ann_builtin_my_int32; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_int32 = TypeObjectUtils::build_complete_member_detail(name_my_int32, member_ann_builtin_my_int32, ann_custom_BasicStruct); - CompleteStructMember member_my_int32 = TypeObjectUtils::build_complete_struct_member(common_my_int32, detail_my_int32); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_int32); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int64_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_int64 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_int64 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_int64; - MemberId member_id_my_int64 = 0x00000004; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_int64 = TypeObjectUtils::build_common_struct_member(member_id_my_int64, member_flags_my_int64, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_int64 = TypeObjectUtils::build_common_struct_member(member_id_my_int64, member_flags_my_int64, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_int64 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_int64 = "my_int64"; - eprosima::fastcdr::optional member_ann_builtin_my_int64; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_int64 = TypeObjectUtils::build_complete_member_detail(name_my_int64, member_ann_builtin_my_int64, ann_custom_BasicStruct); - CompleteStructMember member_my_int64 = TypeObjectUtils::build_complete_struct_member(common_my_int64, detail_my_int64); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_int64); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_uint16_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_uint16 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_uint16 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_uint16; - MemberId member_id_my_uint16 = 0x00000005; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_uint16 = TypeObjectUtils::build_common_struct_member(member_id_my_uint16, member_flags_my_uint16, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_uint16 = TypeObjectUtils::build_common_struct_member(member_id_my_uint16, member_flags_my_uint16, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_uint16 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_uint16 = "my_uint16"; - eprosima::fastcdr::optional member_ann_builtin_my_uint16; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_uint16 = TypeObjectUtils::build_complete_member_detail(name_my_uint16, member_ann_builtin_my_uint16, ann_custom_BasicStruct); - CompleteStructMember member_my_uint16 = TypeObjectUtils::build_complete_struct_member(common_my_uint16, detail_my_uint16); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_uint16); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_uint32_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_uint32 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_uint32 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_uint32; - MemberId member_id_my_uint32 = 0x00000006; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_uint32 = TypeObjectUtils::build_common_struct_member(member_id_my_uint32, member_flags_my_uint32, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_uint32 = TypeObjectUtils::build_common_struct_member(member_id_my_uint32, member_flags_my_uint32, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_uint32 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_uint32 = "my_uint32"; - eprosima::fastcdr::optional member_ann_builtin_my_uint32; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_uint32 = TypeObjectUtils::build_complete_member_detail(name_my_uint32, member_ann_builtin_my_uint32, ann_custom_BasicStruct); - CompleteStructMember member_my_uint32 = TypeObjectUtils::build_complete_struct_member(common_my_uint32, detail_my_uint32); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_uint32); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_uint64_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_uint64 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_uint64 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_uint64; - MemberId member_id_my_uint64 = 0x00000007; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_uint64 = TypeObjectUtils::build_common_struct_member(member_id_my_uint64, member_flags_my_uint64, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_uint64 = TypeObjectUtils::build_common_struct_member(member_id_my_uint64, member_flags_my_uint64, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_uint64 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_uint64 = "my_uint64"; - eprosima::fastcdr::optional member_ann_builtin_my_uint64; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_uint64 = TypeObjectUtils::build_complete_member_detail(name_my_uint64, member_ann_builtin_my_uint64, ann_custom_BasicStruct); - CompleteStructMember member_my_uint64 = TypeObjectUtils::build_complete_struct_member(common_my_uint64, detail_my_uint64); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_uint64); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_float", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_float32 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_float32 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_float32; - MemberId member_id_my_float32 = 0x00000008; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_float32 = TypeObjectUtils::build_common_struct_member(member_id_my_float32, member_flags_my_float32, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_float32 = TypeObjectUtils::build_common_struct_member(member_id_my_float32, member_flags_my_float32, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_float32 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_float32 = "my_float32"; - eprosima::fastcdr::optional member_ann_builtin_my_float32; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_float32 = TypeObjectUtils::build_complete_member_detail(name_my_float32, member_ann_builtin_my_float32, ann_custom_BasicStruct); - CompleteStructMember member_my_float32 = TypeObjectUtils::build_complete_struct_member(common_my_float32, detail_my_float32); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_float32); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_double", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_float64 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_float64 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_float64; - MemberId member_id_my_float64 = 0x00000009; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_float64 = TypeObjectUtils::build_common_struct_member(member_id_my_float64, member_flags_my_float64, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_float64 = TypeObjectUtils::build_common_struct_member(member_id_my_float64, member_flags_my_float64, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_float64 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_float64 = "my_float64"; - eprosima::fastcdr::optional member_ann_builtin_my_float64; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_float64 = TypeObjectUtils::build_complete_member_detail(name_my_float64, member_ann_builtin_my_float64, ann_custom_BasicStruct); - CompleteStructMember member_my_float64 = TypeObjectUtils::build_complete_struct_member(common_my_float64, detail_my_float64); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_float64); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_longdouble", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_float128 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_float128 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_float128; - MemberId member_id_my_float128 = 0x0000000a; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_float128 = TypeObjectUtils::build_common_struct_member(member_id_my_float128, member_flags_my_float128, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_float128 = TypeObjectUtils::build_common_struct_member(member_id_my_float128, member_flags_my_float128, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_float128 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_float128 = "my_float128"; - eprosima::fastcdr::optional member_ann_builtin_my_float128; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_float128 = TypeObjectUtils::build_complete_member_detail(name_my_float128, member_ann_builtin_my_float128, ann_custom_BasicStruct); - CompleteStructMember member_my_float128 = TypeObjectUtils::build_complete_struct_member(common_my_float128, detail_my_float128); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_float128); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_char", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_char Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_char = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_char; - MemberId member_id_my_char = 0x0000000b; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_char = TypeObjectUtils::build_common_struct_member(member_id_my_char, member_flags_my_char, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_char = TypeObjectUtils::build_common_struct_member(member_id_my_char, member_flags_my_char, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_char member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_char = "my_char"; - eprosima::fastcdr::optional member_ann_builtin_my_char; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_char = TypeObjectUtils::build_complete_member_detail(name_my_char, member_ann_builtin_my_char, ann_custom_BasicStruct); - CompleteStructMember member_my_char = TypeObjectUtils::build_complete_struct_member(common_my_char, detail_my_char); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_char); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_string_unbounded", type_ids_BasicStruct); - - if (return_code_BasicStruct != 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_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_string_unbounded", type_ids_BasicStruct); - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_string_unbounded: Given String TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_string = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_string; - MemberId member_id_my_string = 0x0000000c; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_string = TypeObjectUtils::build_common_struct_member(member_id_my_string, member_flags_my_string, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_string = TypeObjectUtils::build_common_struct_member(member_id_my_string, member_flags_my_string, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_string member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_string = "my_string"; - eprosima::fastcdr::optional member_ann_builtin_my_string; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_string = TypeObjectUtils::build_complete_member_detail(name_my_string, member_ann_builtin_my_string, ann_custom_BasicStruct); - CompleteStructMember member_my_string = TypeObjectUtils::build_complete_struct_member(common_my_string, detail_my_string); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_string); - } - CompleteStructType struct_type_BasicStruct = TypeObjectUtils::build_complete_struct_type(struct_flags_BasicStruct, header_BasicStruct, member_seq_BasicStruct); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_BasicStruct, type_name_BasicStruct.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "BasicStruct already registered in TypeObjectRegistry for a different type."); - } - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "BasicStruct", type_ids_BasicStruct); - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "BasicStruct: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - } - UnionMemberFlag member_flags_basic = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false); - UnionCaseLabelSeq label_seq_basic; - TypeObjectUtils::add_union_case_label(label_seq_basic, static_cast(MyEnum::A)); - CommonUnionMember common_basic; - MemberId member_id_basic = 0x00000001; - if (EK_COMPLETE == type_ids_MyUnion.type_identifier1()._d() || TK_NONE == type_ids_MyUnion.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_MyUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_MyUnion.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_MyUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_MyUnion.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_MyUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_MyUnion.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_MyUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_MyUnion.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_MyUnion.type_identifier1()._d() && - (EK_COMPLETE == type_ids_MyUnion.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MyUnion.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_MyUnion.type_identifier1()._d() && - (EK_COMPLETE == type_ids_MyUnion.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MyUnion.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_basic = TypeObjectUtils::build_common_union_member(member_id_basic, member_flags_basic, type_ids_MyUnion.type_identifier1(), - label_seq_basic); - } - else if (EK_COMPLETE == type_ids_MyUnion.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_MyUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_MyUnion.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_MyUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_MyUnion.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_MyUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_MyUnion.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_MyUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_MyUnion.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_MyUnion.type_identifier2()._d() && - (EK_COMPLETE == type_ids_MyUnion.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MyUnion.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_MyUnion.type_identifier2()._d() && - (EK_COMPLETE == type_ids_MyUnion.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MyUnion.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_basic = TypeObjectUtils::build_common_union_member(member_id_basic, member_flags_basic, type_ids_MyUnion.type_identifier2(), - label_seq_basic); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Union basic member TypeIdentifier inconsistent."); - return; - } - MemberName name_basic = "basic"; - eprosima::fastcdr::optional member_ann_builtin_basic; - ann_custom_MyUnion.reset(); - CompleteMemberDetail detail_basic = TypeObjectUtils::build_complete_member_detail(name_basic, member_ann_builtin_basic, ann_custom_MyUnion); - CompleteUnionMember member_basic = TypeObjectUtils::build_complete_union_member(common_basic, detail_basic); - TypeObjectUtils::add_complete_union_member(member_seq_MyUnion, member_basic); - } - { - return_code_MyUnion = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "ComplexStruct", type_ids_MyUnion); - - if (return_code_MyUnion != eprosima::fastdds::dds::RETCODE_OK) - { - { - StructTypeFlag struct_flags_ComplexStruct = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_ComplexStruct; - TypeIdentifierPair type_ids_ComplexStruct; - QualifiedTypeName type_name_ComplexStruct = "ComplexStruct"; - eprosima::fastcdr::optional type_ann_builtin_ComplexStruct; - eprosima::fastcdr::optional ann_custom_ComplexStruct; - CompleteTypeDetail detail_ComplexStruct = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_ComplexStruct, ann_custom_ComplexStruct, type_name_ComplexStruct.to_string()); - CompleteStructHeader header_ComplexStruct; - header_ComplexStruct = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_ComplexStruct); - CompleteStructMemberSeq member_seq_ComplexStruct; - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_byte", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_octet Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_octet = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_octet; - MemberId member_id_my_octet = 0x00000000; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_octet = TypeObjectUtils::build_common_struct_member(member_id_my_octet, member_flags_my_octet, type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_octet = TypeObjectUtils::build_common_struct_member(member_id_my_octet, member_flags_my_octet, type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_octet member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_octet = "my_octet"; - eprosima::fastcdr::optional member_ann_builtin_my_octet; - ann_custom_ComplexStruct.reset(); - CompleteMemberDetail detail_my_octet = TypeObjectUtils::build_complete_member_detail(name_my_octet, member_ann_builtin_my_octet, ann_custom_ComplexStruct); - CompleteStructMember member_my_octet = TypeObjectUtils::build_complete_struct_member(common_my_octet, detail_my_octet); - TypeObjectUtils::add_complete_struct_member(member_seq_ComplexStruct, member_my_octet); - } - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "BasicStruct", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - { - StructTypeFlag struct_flags_BasicStruct = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_BasicStruct; - TypeIdentifierPair type_ids_BasicStruct; - QualifiedTypeName type_name_BasicStruct = "BasicStruct"; - eprosima::fastcdr::optional type_ann_builtin_BasicStruct; - eprosima::fastcdr::optional ann_custom_BasicStruct; - CompleteTypeDetail detail_BasicStruct = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_BasicStruct, ann_custom_BasicStruct, type_name_BasicStruct.to_string()); - CompleteStructHeader header_BasicStruct; - header_BasicStruct = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_BasicStruct); - CompleteStructMemberSeq member_seq_BasicStruct; - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_bool", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_bool Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_bool = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_bool; - MemberId member_id_my_bool = 0x00000000; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_bool = TypeObjectUtils::build_common_struct_member(member_id_my_bool, member_flags_my_bool, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_bool = TypeObjectUtils::build_common_struct_member(member_id_my_bool, member_flags_my_bool, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_bool member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_bool = "my_bool"; - eprosima::fastcdr::optional member_ann_builtin_my_bool; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_bool = TypeObjectUtils::build_complete_member_detail(name_my_bool, member_ann_builtin_my_bool, ann_custom_BasicStruct); - CompleteStructMember member_my_bool = TypeObjectUtils::build_complete_struct_member(common_my_bool, detail_my_bool); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_bool); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_byte", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_octet Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_octet = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_octet; - MemberId member_id_my_octet = 0x00000001; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_octet = TypeObjectUtils::build_common_struct_member(member_id_my_octet, member_flags_my_octet, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_octet = TypeObjectUtils::build_common_struct_member(member_id_my_octet, member_flags_my_octet, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_octet member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_octet = "my_octet"; - eprosima::fastcdr::optional member_ann_builtin_my_octet; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_octet = TypeObjectUtils::build_complete_member_detail(name_my_octet, member_ann_builtin_my_octet, ann_custom_BasicStruct); - CompleteStructMember member_my_octet = TypeObjectUtils::build_complete_struct_member(common_my_octet, detail_my_octet); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_octet); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int16_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_int16 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_int16 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_int16; - MemberId member_id_my_int16 = 0x00000002; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_int16 = TypeObjectUtils::build_common_struct_member(member_id_my_int16, member_flags_my_int16, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_int16 = TypeObjectUtils::build_common_struct_member(member_id_my_int16, member_flags_my_int16, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_int16 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_int16 = "my_int16"; - eprosima::fastcdr::optional member_ann_builtin_my_int16; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_int16 = TypeObjectUtils::build_complete_member_detail(name_my_int16, member_ann_builtin_my_int16, ann_custom_BasicStruct); - CompleteStructMember member_my_int16 = TypeObjectUtils::build_complete_struct_member(common_my_int16, detail_my_int16); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_int16); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_int32 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_int32 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_int32; - MemberId member_id_my_int32 = 0x00000003; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_int32 = TypeObjectUtils::build_common_struct_member(member_id_my_int32, member_flags_my_int32, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_int32 = TypeObjectUtils::build_common_struct_member(member_id_my_int32, member_flags_my_int32, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_int32 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_int32 = "my_int32"; - eprosima::fastcdr::optional member_ann_builtin_my_int32; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_int32 = TypeObjectUtils::build_complete_member_detail(name_my_int32, member_ann_builtin_my_int32, ann_custom_BasicStruct); - CompleteStructMember member_my_int32 = TypeObjectUtils::build_complete_struct_member(common_my_int32, detail_my_int32); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_int32); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int64_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_int64 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_int64 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_int64; - MemberId member_id_my_int64 = 0x00000004; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_int64 = TypeObjectUtils::build_common_struct_member(member_id_my_int64, member_flags_my_int64, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_int64 = TypeObjectUtils::build_common_struct_member(member_id_my_int64, member_flags_my_int64, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_int64 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_int64 = "my_int64"; - eprosima::fastcdr::optional member_ann_builtin_my_int64; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_int64 = TypeObjectUtils::build_complete_member_detail(name_my_int64, member_ann_builtin_my_int64, ann_custom_BasicStruct); - CompleteStructMember member_my_int64 = TypeObjectUtils::build_complete_struct_member(common_my_int64, detail_my_int64); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_int64); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_uint16_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_uint16 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_uint16 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_uint16; - MemberId member_id_my_uint16 = 0x00000005; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_uint16 = TypeObjectUtils::build_common_struct_member(member_id_my_uint16, member_flags_my_uint16, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_uint16 = TypeObjectUtils::build_common_struct_member(member_id_my_uint16, member_flags_my_uint16, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_uint16 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_uint16 = "my_uint16"; - eprosima::fastcdr::optional member_ann_builtin_my_uint16; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_uint16 = TypeObjectUtils::build_complete_member_detail(name_my_uint16, member_ann_builtin_my_uint16, ann_custom_BasicStruct); - CompleteStructMember member_my_uint16 = TypeObjectUtils::build_complete_struct_member(common_my_uint16, detail_my_uint16); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_uint16); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_uint32_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_uint32 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_uint32 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_uint32; - MemberId member_id_my_uint32 = 0x00000006; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_uint32 = TypeObjectUtils::build_common_struct_member(member_id_my_uint32, member_flags_my_uint32, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_uint32 = TypeObjectUtils::build_common_struct_member(member_id_my_uint32, member_flags_my_uint32, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_uint32 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_uint32 = "my_uint32"; - eprosima::fastcdr::optional member_ann_builtin_my_uint32; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_uint32 = TypeObjectUtils::build_complete_member_detail(name_my_uint32, member_ann_builtin_my_uint32, ann_custom_BasicStruct); - CompleteStructMember member_my_uint32 = TypeObjectUtils::build_complete_struct_member(common_my_uint32, detail_my_uint32); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_uint32); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_uint64_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_uint64 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_uint64 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_uint64; - MemberId member_id_my_uint64 = 0x00000007; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_uint64 = TypeObjectUtils::build_common_struct_member(member_id_my_uint64, member_flags_my_uint64, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_uint64 = TypeObjectUtils::build_common_struct_member(member_id_my_uint64, member_flags_my_uint64, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_uint64 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_uint64 = "my_uint64"; - eprosima::fastcdr::optional member_ann_builtin_my_uint64; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_uint64 = TypeObjectUtils::build_complete_member_detail(name_my_uint64, member_ann_builtin_my_uint64, ann_custom_BasicStruct); - CompleteStructMember member_my_uint64 = TypeObjectUtils::build_complete_struct_member(common_my_uint64, detail_my_uint64); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_uint64); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_float", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_float32 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_float32 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_float32; - MemberId member_id_my_float32 = 0x00000008; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_float32 = TypeObjectUtils::build_common_struct_member(member_id_my_float32, member_flags_my_float32, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_float32 = TypeObjectUtils::build_common_struct_member(member_id_my_float32, member_flags_my_float32, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_float32 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_float32 = "my_float32"; - eprosima::fastcdr::optional member_ann_builtin_my_float32; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_float32 = TypeObjectUtils::build_complete_member_detail(name_my_float32, member_ann_builtin_my_float32, ann_custom_BasicStruct); - CompleteStructMember member_my_float32 = TypeObjectUtils::build_complete_struct_member(common_my_float32, detail_my_float32); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_float32); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_double", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_float64 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_float64 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_float64; - MemberId member_id_my_float64 = 0x00000009; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_float64 = TypeObjectUtils::build_common_struct_member(member_id_my_float64, member_flags_my_float64, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_float64 = TypeObjectUtils::build_common_struct_member(member_id_my_float64, member_flags_my_float64, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_float64 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_float64 = "my_float64"; - eprosima::fastcdr::optional member_ann_builtin_my_float64; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_float64 = TypeObjectUtils::build_complete_member_detail(name_my_float64, member_ann_builtin_my_float64, ann_custom_BasicStruct); - CompleteStructMember member_my_float64 = TypeObjectUtils::build_complete_struct_member(common_my_float64, detail_my_float64); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_float64); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_longdouble", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_float128 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_float128 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_float128; - MemberId member_id_my_float128 = 0x0000000a; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_float128 = TypeObjectUtils::build_common_struct_member(member_id_my_float128, member_flags_my_float128, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_float128 = TypeObjectUtils::build_common_struct_member(member_id_my_float128, member_flags_my_float128, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_float128 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_float128 = "my_float128"; - eprosima::fastcdr::optional member_ann_builtin_my_float128; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_float128 = TypeObjectUtils::build_complete_member_detail(name_my_float128, member_ann_builtin_my_float128, ann_custom_BasicStruct); - CompleteStructMember member_my_float128 = TypeObjectUtils::build_complete_struct_member(common_my_float128, detail_my_float128); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_float128); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_char", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_char Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_char = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_char; - MemberId member_id_my_char = 0x0000000b; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_char = TypeObjectUtils::build_common_struct_member(member_id_my_char, member_flags_my_char, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_char = TypeObjectUtils::build_common_struct_member(member_id_my_char, member_flags_my_char, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_char member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_char = "my_char"; - eprosima::fastcdr::optional member_ann_builtin_my_char; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_char = TypeObjectUtils::build_complete_member_detail(name_my_char, member_ann_builtin_my_char, ann_custom_BasicStruct); - CompleteStructMember member_my_char = TypeObjectUtils::build_complete_struct_member(common_my_char, detail_my_char); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_char); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_string_unbounded", type_ids_BasicStruct); - - if (return_code_BasicStruct != 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_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_string_unbounded", type_ids_BasicStruct); - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_string_unbounded: Given String TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_string = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_string; - MemberId member_id_my_string = 0x0000000c; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_string = TypeObjectUtils::build_common_struct_member(member_id_my_string, member_flags_my_string, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_string = TypeObjectUtils::build_common_struct_member(member_id_my_string, member_flags_my_string, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_string member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_string = "my_string"; - eprosima::fastcdr::optional member_ann_builtin_my_string; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_string = TypeObjectUtils::build_complete_member_detail(name_my_string, member_ann_builtin_my_string, ann_custom_BasicStruct); - CompleteStructMember member_my_string = TypeObjectUtils::build_complete_struct_member(common_my_string, detail_my_string); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_string); - } - CompleteStructType struct_type_BasicStruct = TypeObjectUtils::build_complete_struct_type(struct_flags_BasicStruct, header_BasicStruct, member_seq_BasicStruct); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_BasicStruct, type_name_BasicStruct.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "BasicStruct already registered in TypeObjectRegistry for a different type."); - } - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "BasicStruct", type_ids_BasicStruct); - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "BasicStruct: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - } - StructMemberFlag member_flags_my_basic_struct = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_basic_struct; - MemberId member_id_my_basic_struct = 0x00000001; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_basic_struct = TypeObjectUtils::build_common_struct_member(member_id_my_basic_struct, member_flags_my_basic_struct, type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_basic_struct = TypeObjectUtils::build_common_struct_member(member_id_my_basic_struct, member_flags_my_basic_struct, type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_basic_struct member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_basic_struct = "my_basic_struct"; - eprosima::fastcdr::optional member_ann_builtin_my_basic_struct; - ann_custom_ComplexStruct.reset(); - CompleteMemberDetail detail_my_basic_struct = TypeObjectUtils::build_complete_member_detail(name_my_basic_struct, member_ann_builtin_my_basic_struct, ann_custom_ComplexStruct); - CompleteStructMember member_my_basic_struct = TypeObjectUtils::build_complete_struct_member(common_my_basic_struct, detail_my_basic_struct); - TypeObjectUtils::add_complete_struct_member(member_seq_ComplexStruct, member_my_basic_struct); - } - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyAliasEnum", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - AliasTypeFlag alias_flags_MyAliasEnum = 0; - QualifiedTypeName type_name_MyAliasEnum = "MyAliasEnum"; - eprosima::fastcdr::optional type_ann_builtin_MyAliasEnum; - eprosima::fastcdr::optional ann_custom_MyAliasEnum; - CompleteTypeDetail detail_MyAliasEnum = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_MyAliasEnum, ann_custom_MyAliasEnum, type_name_MyAliasEnum.to_string()); - CompleteAliasHeader header_MyAliasEnum = TypeObjectUtils::build_complete_alias_header(detail_MyAliasEnum); - AliasMemberFlag related_flags_MyAliasEnum = 0; - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyEnum", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EnumTypeFlag enum_flags_MyEnum = 0; - BitBound bit_bound_MyEnum = 32; - CommonEnumeratedHeader common_MyEnum = TypeObjectUtils::build_common_enumerated_header(bit_bound_MyEnum); - QualifiedTypeName type_name_MyEnum = "MyEnum"; - eprosima::fastcdr::optional type_ann_builtin_MyEnum; - eprosima::fastcdr::optional ann_custom_MyEnum; - CompleteTypeDetail detail_MyEnum = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_MyEnum, ann_custom_MyEnum, type_name_MyEnum.to_string()); - CompleteEnumeratedHeader header_MyEnum = TypeObjectUtils::build_complete_enumerated_header(common_MyEnum, detail_MyEnum); - CompleteEnumeratedLiteralSeq literal_seq_MyEnum; - { - EnumeratedLiteralFlag flags_A = TypeObjectUtils::build_enumerated_literal_flag(false); - CommonEnumeratedLiteral common_A = TypeObjectUtils::build_common_enumerated_literal(0, flags_A); - eprosima::fastcdr::optional member_ann_builtin_A; - ann_custom_MyEnum.reset(); - MemberName name_A = "A"; - CompleteMemberDetail detail_A = TypeObjectUtils::build_complete_member_detail(name_A, member_ann_builtin_A, ann_custom_MyEnum); - CompleteEnumeratedLiteral literal_A = TypeObjectUtils::build_complete_enumerated_literal(common_A, detail_A); - TypeObjectUtils::add_complete_enumerated_literal(literal_seq_MyEnum, literal_A); - } - { - EnumeratedLiteralFlag flags_B = TypeObjectUtils::build_enumerated_literal_flag(false); - CommonEnumeratedLiteral common_B = TypeObjectUtils::build_common_enumerated_literal(1, flags_B); - eprosima::fastcdr::optional member_ann_builtin_B; - ann_custom_MyEnum.reset(); - MemberName name_B = "B"; - CompleteMemberDetail detail_B = TypeObjectUtils::build_complete_member_detail(name_B, member_ann_builtin_B, ann_custom_MyEnum); - CompleteEnumeratedLiteral literal_B = TypeObjectUtils::build_complete_enumerated_literal(common_B, detail_B); - TypeObjectUtils::add_complete_enumerated_literal(literal_seq_MyEnum, literal_B); - } - { - EnumeratedLiteralFlag flags_C = TypeObjectUtils::build_enumerated_literal_flag(false); - CommonEnumeratedLiteral common_C = TypeObjectUtils::build_common_enumerated_literal(2, flags_C); - eprosima::fastcdr::optional member_ann_builtin_C; - ann_custom_MyEnum.reset(); - MemberName name_C = "C"; - CompleteMemberDetail detail_C = TypeObjectUtils::build_complete_member_detail(name_C, member_ann_builtin_C, ann_custom_MyEnum); - CompleteEnumeratedLiteral literal_C = TypeObjectUtils::build_complete_enumerated_literal(common_C, detail_C); - TypeObjectUtils::add_complete_enumerated_literal(literal_seq_MyEnum, literal_C); - } - CompleteEnumeratedType enumerated_type_MyEnum = TypeObjectUtils::build_complete_enumerated_type(enum_flags_MyEnum, header_MyEnum, - literal_seq_MyEnum); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_enumerated_type_object(enumerated_type_MyEnum, type_name_MyEnum.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyEnum already registered in TypeObjectRegistry for a different type."); - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyEnum", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyEnum: Given Enum TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - CommonAliasBody common_MyAliasEnum; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_MyAliasEnum = TypeObjectUtils::build_common_alias_body(related_flags_MyAliasEnum, type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_MyAliasEnum = TypeObjectUtils::build_common_alias_body(related_flags_MyAliasEnum, type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyAliasEnum related TypeIdentifier inconsistent."); - return; - } - eprosima::fastcdr::optional member_ann_builtin_MyAliasEnum; - ann_custom_MyAliasEnum.reset(); - CompleteAliasBody body_MyAliasEnum = TypeObjectUtils::build_complete_alias_body(common_MyAliasEnum, member_ann_builtin_MyAliasEnum, ann_custom_MyAliasEnum); - CompleteAliasType alias_type_MyAliasEnum = TypeObjectUtils::build_complete_alias_type(alias_flags_MyAliasEnum, header_MyAliasEnum, body_MyAliasEnum); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_alias_type_object(alias_type_MyAliasEnum, type_name_MyAliasEnum.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyAliasEnum already registered in TypeObjectRegistry for a different type."); - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyAliasEnum", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyAliasEnum: Given Alias TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_alias_enum = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_alias_enum; - MemberId member_id_my_alias_enum = 0x00000002; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_alias_enum = TypeObjectUtils::build_common_struct_member(member_id_my_alias_enum, member_flags_my_alias_enum, type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_alias_enum = TypeObjectUtils::build_common_struct_member(member_id_my_alias_enum, member_flags_my_alias_enum, type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_alias_enum member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_alias_enum = "my_alias_enum"; - eprosima::fastcdr::optional member_ann_builtin_my_alias_enum; - ann_custom_ComplexStruct.reset(); - CompleteMemberDetail detail_my_alias_enum = TypeObjectUtils::build_complete_member_detail(name_my_alias_enum, member_ann_builtin_my_alias_enum, ann_custom_ComplexStruct); - CompleteStructMember member_my_alias_enum = TypeObjectUtils::build_complete_struct_member(common_my_alias_enum, detail_my_alias_enum); - TypeObjectUtils::add_complete_struct_member(member_seq_ComplexStruct, member_my_alias_enum); - } - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyEnum", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EnumTypeFlag enum_flags_MyEnum = 0; - BitBound bit_bound_MyEnum = 32; - CommonEnumeratedHeader common_MyEnum = TypeObjectUtils::build_common_enumerated_header(bit_bound_MyEnum); - QualifiedTypeName type_name_MyEnum = "MyEnum"; - eprosima::fastcdr::optional type_ann_builtin_MyEnum; - eprosima::fastcdr::optional ann_custom_MyEnum; - CompleteTypeDetail detail_MyEnum = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_MyEnum, ann_custom_MyEnum, type_name_MyEnum.to_string()); - CompleteEnumeratedHeader header_MyEnum = TypeObjectUtils::build_complete_enumerated_header(common_MyEnum, detail_MyEnum); - CompleteEnumeratedLiteralSeq literal_seq_MyEnum; - { - EnumeratedLiteralFlag flags_A = TypeObjectUtils::build_enumerated_literal_flag(false); - CommonEnumeratedLiteral common_A = TypeObjectUtils::build_common_enumerated_literal(0, flags_A); - eprosima::fastcdr::optional member_ann_builtin_A; - ann_custom_MyEnum.reset(); - MemberName name_A = "A"; - CompleteMemberDetail detail_A = TypeObjectUtils::build_complete_member_detail(name_A, member_ann_builtin_A, ann_custom_MyEnum); - CompleteEnumeratedLiteral literal_A = TypeObjectUtils::build_complete_enumerated_literal(common_A, detail_A); - TypeObjectUtils::add_complete_enumerated_literal(literal_seq_MyEnum, literal_A); - } - { - EnumeratedLiteralFlag flags_B = TypeObjectUtils::build_enumerated_literal_flag(false); - CommonEnumeratedLiteral common_B = TypeObjectUtils::build_common_enumerated_literal(1, flags_B); - eprosima::fastcdr::optional member_ann_builtin_B; - ann_custom_MyEnum.reset(); - MemberName name_B = "B"; - CompleteMemberDetail detail_B = TypeObjectUtils::build_complete_member_detail(name_B, member_ann_builtin_B, ann_custom_MyEnum); - CompleteEnumeratedLiteral literal_B = TypeObjectUtils::build_complete_enumerated_literal(common_B, detail_B); - TypeObjectUtils::add_complete_enumerated_literal(literal_seq_MyEnum, literal_B); - } - { - EnumeratedLiteralFlag flags_C = TypeObjectUtils::build_enumerated_literal_flag(false); - CommonEnumeratedLiteral common_C = TypeObjectUtils::build_common_enumerated_literal(2, flags_C); - eprosima::fastcdr::optional member_ann_builtin_C; - ann_custom_MyEnum.reset(); - MemberName name_C = "C"; - CompleteMemberDetail detail_C = TypeObjectUtils::build_complete_member_detail(name_C, member_ann_builtin_C, ann_custom_MyEnum); - CompleteEnumeratedLiteral literal_C = TypeObjectUtils::build_complete_enumerated_literal(common_C, detail_C); - TypeObjectUtils::add_complete_enumerated_literal(literal_seq_MyEnum, literal_C); - } - CompleteEnumeratedType enumerated_type_MyEnum = TypeObjectUtils::build_complete_enumerated_type(enum_flags_MyEnum, header_MyEnum, - literal_seq_MyEnum); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_enumerated_type_object(enumerated_type_MyEnum, type_name_MyEnum.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyEnum already registered in TypeObjectRegistry for a different type."); - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyEnum", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyEnum: Given Enum TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_enum = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_enum; - MemberId member_id_my_enum = 0x00000003; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_enum = TypeObjectUtils::build_common_struct_member(member_id_my_enum, member_flags_my_enum, type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_enum = TypeObjectUtils::build_common_struct_member(member_id_my_enum, member_flags_my_enum, type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_enum member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_enum = "my_enum"; - eprosima::fastcdr::optional member_ann_builtin_my_enum; - ann_custom_ComplexStruct.reset(); - CompleteMemberDetail detail_my_enum = TypeObjectUtils::build_complete_member_detail(name_my_enum, member_ann_builtin_my_enum, ann_custom_ComplexStruct); - CompleteStructMember member_my_enum = TypeObjectUtils::build_complete_struct_member(common_my_enum, detail_my_enum); - TypeObjectUtils::add_complete_struct_member(member_seq_ComplexStruct, member_my_enum); - } - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_sequence_uint8_t_55", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_byte", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != 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_55 {nullptr}; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_sequence_uint8_t_55 = new TypeIdentifier(type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_sequence_uint8_t_55 = new TypeIdentifier(type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Sequence element TypeIdentifier inconsistent."); - return; - } - EquivalenceKind equiv_kind_anonymous_sequence_uint8_t_55 = EK_COMPLETE; - if (TK_NONE == type_ids_ComplexStruct.type_identifier2()._d()) - { - equiv_kind_anonymous_sequence_uint8_t_55 = EK_BOTH; - } - CollectionElementFlag element_flags_anonymous_sequence_uint8_t_55 = 0; - PlainCollectionHeader header_anonymous_sequence_uint8_t_55 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_sequence_uint8_t_55, element_flags_anonymous_sequence_uint8_t_55); - std::string type_id_kind_anonymous_sequence_uint8_t_55("TI_PLAIN_SEQUENCE_SMALL"); - if (type_id_kind_anonymous_sequence_uint8_t_55 == "TI_PLAIN_SEQUENCE_SMALL") - { - SBound bound = static_cast(55); - PlainSequenceSElemDefn seq_sdefn = TypeObjectUtils::build_plain_sequence_s_elem_defn(header_anonymous_sequence_uint8_t_55, bound, - eprosima::fastcdr::external(element_identifier_anonymous_sequence_uint8_t_55)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_s_sequence_type_identifier(seq_sdefn, "anonymous_sequence_uint8_t_55")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_sequence_uint8_t_55 already registered in TypeObjectRegistry for a different type."); - } - } - else - { - LBound bound = 55; - PlainSequenceLElemDefn seq_ldefn = TypeObjectUtils::build_plain_sequence_l_elem_defn(header_anonymous_sequence_uint8_t_55, bound, - eprosima::fastcdr::external(element_identifier_anonymous_sequence_uint8_t_55)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_l_sequence_type_identifier(seq_ldefn, "anonymous_sequence_uint8_t_55")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_sequence_uint8_t_55 already registered in TypeObjectRegistry for a different type."); - } - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_sequence_uint8_t_55", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_sequence_uint8_t_55: Given Sequence TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_sequence_octet = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_sequence_octet; - MemberId member_id_my_sequence_octet = 0x00000004; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_sequence_octet = TypeObjectUtils::build_common_struct_member(member_id_my_sequence_octet, member_flags_my_sequence_octet, type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_sequence_octet = TypeObjectUtils::build_common_struct_member(member_id_my_sequence_octet, member_flags_my_sequence_octet, type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_sequence_octet member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_sequence_octet = "my_sequence_octet"; - eprosima::fastcdr::optional member_ann_builtin_my_sequence_octet; - ann_custom_ComplexStruct.reset(); - CompleteMemberDetail detail_my_sequence_octet = TypeObjectUtils::build_complete_member_detail(name_my_sequence_octet, member_ann_builtin_my_sequence_octet, ann_custom_ComplexStruct); - CompleteStructMember member_my_sequence_octet = TypeObjectUtils::build_complete_struct_member(common_my_sequence_octet, detail_my_sequence_octet); - TypeObjectUtils::add_complete_struct_member(member_seq_ComplexStruct, member_my_sequence_octet); - } - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_sequence_BasicStruct_unbounded", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "BasicStruct", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - { - StructTypeFlag struct_flags_BasicStruct = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_BasicStruct; - TypeIdentifierPair type_ids_BasicStruct; - QualifiedTypeName type_name_BasicStruct = "BasicStruct"; - eprosima::fastcdr::optional type_ann_builtin_BasicStruct; - eprosima::fastcdr::optional ann_custom_BasicStruct; - CompleteTypeDetail detail_BasicStruct = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_BasicStruct, ann_custom_BasicStruct, type_name_BasicStruct.to_string()); - CompleteStructHeader header_BasicStruct; - header_BasicStruct = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_BasicStruct); - CompleteStructMemberSeq member_seq_BasicStruct; - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_bool", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_bool Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_bool = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_bool; - MemberId member_id_my_bool = 0x00000000; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_bool = TypeObjectUtils::build_common_struct_member(member_id_my_bool, member_flags_my_bool, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_bool = TypeObjectUtils::build_common_struct_member(member_id_my_bool, member_flags_my_bool, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_bool member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_bool = "my_bool"; - eprosima::fastcdr::optional member_ann_builtin_my_bool; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_bool = TypeObjectUtils::build_complete_member_detail(name_my_bool, member_ann_builtin_my_bool, ann_custom_BasicStruct); - CompleteStructMember member_my_bool = TypeObjectUtils::build_complete_struct_member(common_my_bool, detail_my_bool); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_bool); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_byte", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_octet Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_octet = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_octet; - MemberId member_id_my_octet = 0x00000001; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_octet = TypeObjectUtils::build_common_struct_member(member_id_my_octet, member_flags_my_octet, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_octet = TypeObjectUtils::build_common_struct_member(member_id_my_octet, member_flags_my_octet, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_octet member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_octet = "my_octet"; - eprosima::fastcdr::optional member_ann_builtin_my_octet; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_octet = TypeObjectUtils::build_complete_member_detail(name_my_octet, member_ann_builtin_my_octet, ann_custom_BasicStruct); - CompleteStructMember member_my_octet = TypeObjectUtils::build_complete_struct_member(common_my_octet, detail_my_octet); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_octet); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int16_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_int16 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_int16 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_int16; - MemberId member_id_my_int16 = 0x00000002; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_int16 = TypeObjectUtils::build_common_struct_member(member_id_my_int16, member_flags_my_int16, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_int16 = TypeObjectUtils::build_common_struct_member(member_id_my_int16, member_flags_my_int16, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_int16 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_int16 = "my_int16"; - eprosima::fastcdr::optional member_ann_builtin_my_int16; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_int16 = TypeObjectUtils::build_complete_member_detail(name_my_int16, member_ann_builtin_my_int16, ann_custom_BasicStruct); - CompleteStructMember member_my_int16 = TypeObjectUtils::build_complete_struct_member(common_my_int16, detail_my_int16); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_int16); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_int32 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_int32 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_int32; - MemberId member_id_my_int32 = 0x00000003; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_int32 = TypeObjectUtils::build_common_struct_member(member_id_my_int32, member_flags_my_int32, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_int32 = TypeObjectUtils::build_common_struct_member(member_id_my_int32, member_flags_my_int32, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_int32 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_int32 = "my_int32"; - eprosima::fastcdr::optional member_ann_builtin_my_int32; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_int32 = TypeObjectUtils::build_complete_member_detail(name_my_int32, member_ann_builtin_my_int32, ann_custom_BasicStruct); - CompleteStructMember member_my_int32 = TypeObjectUtils::build_complete_struct_member(common_my_int32, detail_my_int32); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_int32); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int64_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_int64 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_int64 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_int64; - MemberId member_id_my_int64 = 0x00000004; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_int64 = TypeObjectUtils::build_common_struct_member(member_id_my_int64, member_flags_my_int64, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_int64 = TypeObjectUtils::build_common_struct_member(member_id_my_int64, member_flags_my_int64, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_int64 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_int64 = "my_int64"; - eprosima::fastcdr::optional member_ann_builtin_my_int64; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_int64 = TypeObjectUtils::build_complete_member_detail(name_my_int64, member_ann_builtin_my_int64, ann_custom_BasicStruct); - CompleteStructMember member_my_int64 = TypeObjectUtils::build_complete_struct_member(common_my_int64, detail_my_int64); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_int64); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_uint16_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_uint16 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_uint16 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_uint16; - MemberId member_id_my_uint16 = 0x00000005; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_uint16 = TypeObjectUtils::build_common_struct_member(member_id_my_uint16, member_flags_my_uint16, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_uint16 = TypeObjectUtils::build_common_struct_member(member_id_my_uint16, member_flags_my_uint16, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_uint16 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_uint16 = "my_uint16"; - eprosima::fastcdr::optional member_ann_builtin_my_uint16; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_uint16 = TypeObjectUtils::build_complete_member_detail(name_my_uint16, member_ann_builtin_my_uint16, ann_custom_BasicStruct); - CompleteStructMember member_my_uint16 = TypeObjectUtils::build_complete_struct_member(common_my_uint16, detail_my_uint16); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_uint16); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_uint32_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_uint32 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_uint32 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_uint32; - MemberId member_id_my_uint32 = 0x00000006; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_uint32 = TypeObjectUtils::build_common_struct_member(member_id_my_uint32, member_flags_my_uint32, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_uint32 = TypeObjectUtils::build_common_struct_member(member_id_my_uint32, member_flags_my_uint32, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_uint32 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_uint32 = "my_uint32"; - eprosima::fastcdr::optional member_ann_builtin_my_uint32; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_uint32 = TypeObjectUtils::build_complete_member_detail(name_my_uint32, member_ann_builtin_my_uint32, ann_custom_BasicStruct); - CompleteStructMember member_my_uint32 = TypeObjectUtils::build_complete_struct_member(common_my_uint32, detail_my_uint32); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_uint32); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_uint64_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_uint64 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_uint64 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_uint64; - MemberId member_id_my_uint64 = 0x00000007; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_uint64 = TypeObjectUtils::build_common_struct_member(member_id_my_uint64, member_flags_my_uint64, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_uint64 = TypeObjectUtils::build_common_struct_member(member_id_my_uint64, member_flags_my_uint64, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_uint64 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_uint64 = "my_uint64"; - eprosima::fastcdr::optional member_ann_builtin_my_uint64; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_uint64 = TypeObjectUtils::build_complete_member_detail(name_my_uint64, member_ann_builtin_my_uint64, ann_custom_BasicStruct); - CompleteStructMember member_my_uint64 = TypeObjectUtils::build_complete_struct_member(common_my_uint64, detail_my_uint64); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_uint64); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_float", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_float32 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_float32 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_float32; - MemberId member_id_my_float32 = 0x00000008; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_float32 = TypeObjectUtils::build_common_struct_member(member_id_my_float32, member_flags_my_float32, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_float32 = TypeObjectUtils::build_common_struct_member(member_id_my_float32, member_flags_my_float32, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_float32 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_float32 = "my_float32"; - eprosima::fastcdr::optional member_ann_builtin_my_float32; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_float32 = TypeObjectUtils::build_complete_member_detail(name_my_float32, member_ann_builtin_my_float32, ann_custom_BasicStruct); - CompleteStructMember member_my_float32 = TypeObjectUtils::build_complete_struct_member(common_my_float32, detail_my_float32); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_float32); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_double", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_float64 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_float64 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_float64; - MemberId member_id_my_float64 = 0x00000009; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_float64 = TypeObjectUtils::build_common_struct_member(member_id_my_float64, member_flags_my_float64, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_float64 = TypeObjectUtils::build_common_struct_member(member_id_my_float64, member_flags_my_float64, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_float64 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_float64 = "my_float64"; - eprosima::fastcdr::optional member_ann_builtin_my_float64; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_float64 = TypeObjectUtils::build_complete_member_detail(name_my_float64, member_ann_builtin_my_float64, ann_custom_BasicStruct); - CompleteStructMember member_my_float64 = TypeObjectUtils::build_complete_struct_member(common_my_float64, detail_my_float64); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_float64); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_longdouble", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_float128 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_float128 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_float128; - MemberId member_id_my_float128 = 0x0000000a; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_float128 = TypeObjectUtils::build_common_struct_member(member_id_my_float128, member_flags_my_float128, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_float128 = TypeObjectUtils::build_common_struct_member(member_id_my_float128, member_flags_my_float128, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_float128 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_float128 = "my_float128"; - eprosima::fastcdr::optional member_ann_builtin_my_float128; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_float128 = TypeObjectUtils::build_complete_member_detail(name_my_float128, member_ann_builtin_my_float128, ann_custom_BasicStruct); - CompleteStructMember member_my_float128 = TypeObjectUtils::build_complete_struct_member(common_my_float128, detail_my_float128); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_float128); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_char", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_char Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_char = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_char; - MemberId member_id_my_char = 0x0000000b; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_char = TypeObjectUtils::build_common_struct_member(member_id_my_char, member_flags_my_char, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_char = TypeObjectUtils::build_common_struct_member(member_id_my_char, member_flags_my_char, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_char member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_char = "my_char"; - eprosima::fastcdr::optional member_ann_builtin_my_char; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_char = TypeObjectUtils::build_complete_member_detail(name_my_char, member_ann_builtin_my_char, ann_custom_BasicStruct); - CompleteStructMember member_my_char = TypeObjectUtils::build_complete_struct_member(common_my_char, detail_my_char); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_char); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_string_unbounded", type_ids_BasicStruct); - - if (return_code_BasicStruct != 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_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_string_unbounded", type_ids_BasicStruct); - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_string_unbounded: Given String TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_string = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_string; - MemberId member_id_my_string = 0x0000000c; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_string = TypeObjectUtils::build_common_struct_member(member_id_my_string, member_flags_my_string, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_string = TypeObjectUtils::build_common_struct_member(member_id_my_string, member_flags_my_string, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_string member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_string = "my_string"; - eprosima::fastcdr::optional member_ann_builtin_my_string; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_string = TypeObjectUtils::build_complete_member_detail(name_my_string, member_ann_builtin_my_string, ann_custom_BasicStruct); - CompleteStructMember member_my_string = TypeObjectUtils::build_complete_struct_member(common_my_string, detail_my_string); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_string); - } - CompleteStructType struct_type_BasicStruct = TypeObjectUtils::build_complete_struct_type(struct_flags_BasicStruct, header_BasicStruct, member_seq_BasicStruct); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_BasicStruct, type_name_BasicStruct.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "BasicStruct already registered in TypeObjectRegistry for a different type."); - } - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "BasicStruct", type_ids_BasicStruct); - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "BasicStruct: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - } - TypeIdentifier* element_identifier_anonymous_sequence_BasicStruct_unbounded {nullptr}; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_sequence_BasicStruct_unbounded = new TypeIdentifier(type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_sequence_BasicStruct_unbounded = new TypeIdentifier(type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Sequence element TypeIdentifier inconsistent."); - return; - } - EquivalenceKind equiv_kind_anonymous_sequence_BasicStruct_unbounded = EK_COMPLETE; - if (TK_NONE == type_ids_ComplexStruct.type_identifier2()._d()) - { - equiv_kind_anonymous_sequence_BasicStruct_unbounded = EK_BOTH; - } - CollectionElementFlag element_flags_anonymous_sequence_BasicStruct_unbounded = 0; - PlainCollectionHeader header_anonymous_sequence_BasicStruct_unbounded = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_sequence_BasicStruct_unbounded, element_flags_anonymous_sequence_BasicStruct_unbounded); - std::string type_id_kind_anonymous_sequence_BasicStruct_unbounded("TI_PLAIN_SEQUENCE_SMALL"); - if (type_id_kind_anonymous_sequence_BasicStruct_unbounded == "TI_PLAIN_SEQUENCE_SMALL") - { - SBound bound = 0; - PlainSequenceSElemDefn seq_sdefn = TypeObjectUtils::build_plain_sequence_s_elem_defn(header_anonymous_sequence_BasicStruct_unbounded, bound, - eprosima::fastcdr::external(element_identifier_anonymous_sequence_BasicStruct_unbounded)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_s_sequence_type_identifier(seq_sdefn, "anonymous_sequence_BasicStruct_unbounded")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_sequence_BasicStruct_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_BasicStruct_unbounded, bound, - eprosima::fastcdr::external(element_identifier_anonymous_sequence_BasicStruct_unbounded)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_l_sequence_type_identifier(seq_ldefn, "anonymous_sequence_BasicStruct_unbounded")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_sequence_BasicStruct_unbounded already registered in TypeObjectRegistry for a different type."); - } - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_sequence_BasicStruct_unbounded", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_sequence_BasicStruct_unbounded: Given Sequence TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_sequence_struct = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_sequence_struct; - MemberId member_id_my_sequence_struct = 0x00000005; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_sequence_struct = TypeObjectUtils::build_common_struct_member(member_id_my_sequence_struct, member_flags_my_sequence_struct, type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_sequence_struct = TypeObjectUtils::build_common_struct_member(member_id_my_sequence_struct, member_flags_my_sequence_struct, type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_sequence_struct member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_sequence_struct = "my_sequence_struct"; - eprosima::fastcdr::optional member_ann_builtin_my_sequence_struct; - ann_custom_ComplexStruct.reset(); - CompleteMemberDetail detail_my_sequence_struct = TypeObjectUtils::build_complete_member_detail(name_my_sequence_struct, member_ann_builtin_my_sequence_struct, ann_custom_ComplexStruct); - CompleteStructMember member_my_sequence_struct = TypeObjectUtils::build_complete_struct_member(common_my_sequence_struct, detail_my_sequence_struct); - TypeObjectUtils::add_complete_struct_member(member_seq_ComplexStruct, member_my_sequence_struct); - } - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_array_char_500_5_4", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_char", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Array element TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - TypeIdentifier* element_identifier_anonymous_array_char_500_5_4 {nullptr}; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_array_char_500_5_4 = new TypeIdentifier(type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_array_char_500_5_4 = new TypeIdentifier(type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Array element TypeIdentifier inconsistent."); - return; - } - EquivalenceKind equiv_kind_anonymous_array_char_500_5_4 = EK_COMPLETE; - if (TK_NONE == type_ids_ComplexStruct.type_identifier2()._d()) - { - equiv_kind_anonymous_array_char_500_5_4 = EK_BOTH; - } - CollectionElementFlag element_flags_anonymous_array_char_500_5_4 = 0; - PlainCollectionHeader header_anonymous_array_char_500_5_4 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_char_500_5_4, element_flags_anonymous_array_char_500_5_4); - std::string type_id_kind_anonymous_array_char_500_5_4("TI_PLAIN_ARRAY_LARGE"); - if (type_id_kind_anonymous_array_char_500_5_4 == "TI_PLAIN_ARRAY_SMALL") - { - SBoundSeq array_bound_seq; - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(500)); - - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(5)); - - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); - - PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_char_500_5_4, array_bound_seq, - eprosima::fastcdr::external(element_identifier_anonymous_array_char_500_5_4)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_char_500_5_4")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_char_500_5_4 already registered in TypeObjectRegistry for a different type."); - } - } - else - { - LBoundSeq array_bound_seq; - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(500)); - - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(5)); - - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); - - PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_char_500_5_4, array_bound_seq, - eprosima::fastcdr::external(element_identifier_anonymous_array_char_500_5_4)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_char_500_5_4")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_char_500_5_4 already registered in TypeObjectRegistry for a different type."); - } - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_array_char_500_5_4", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_char_500_5_4: Given Array TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_array_octet = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_array_octet; - MemberId member_id_my_array_octet = 0x00000006; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_array_octet = TypeObjectUtils::build_common_struct_member(member_id_my_array_octet, member_flags_my_array_octet, type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_array_octet = TypeObjectUtils::build_common_struct_member(member_id_my_array_octet, member_flags_my_array_octet, type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_array_octet member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_array_octet = "my_array_octet"; - eprosima::fastcdr::optional member_ann_builtin_my_array_octet; - ann_custom_ComplexStruct.reset(); - CompleteMemberDetail detail_my_array_octet = TypeObjectUtils::build_complete_member_detail(name_my_array_octet, member_ann_builtin_my_array_octet, ann_custom_ComplexStruct); - CompleteStructMember member_my_array_octet = TypeObjectUtils::build_complete_struct_member(common_my_array_octet, detail_my_array_octet); - TypeObjectUtils::add_complete_struct_member(member_seq_ComplexStruct, member_my_array_octet); - } - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyOctetArray500", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - AliasTypeFlag alias_flags_MyOctetArray500 = 0; - QualifiedTypeName type_name_MyOctetArray500 = "MyOctetArray500"; - eprosima::fastcdr::optional type_ann_builtin_MyOctetArray500; - eprosima::fastcdr::optional ann_custom_MyOctetArray500; - CompleteTypeDetail detail_MyOctetArray500 = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_MyOctetArray500, ann_custom_MyOctetArray500, type_name_MyOctetArray500.to_string()); - CompleteAliasHeader header_MyOctetArray500 = TypeObjectUtils::build_complete_alias_header(detail_MyOctetArray500); - AliasMemberFlag related_flags_MyOctetArray500 = 0; - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_array_uint8_t_500", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_byte", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Array element TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - TypeIdentifier* element_identifier_anonymous_array_uint8_t_500 {nullptr}; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_array_uint8_t_500 = new TypeIdentifier(type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_array_uint8_t_500 = new TypeIdentifier(type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Array element TypeIdentifier inconsistent."); - return; - } - EquivalenceKind equiv_kind_anonymous_array_uint8_t_500 = EK_COMPLETE; - if (TK_NONE == type_ids_ComplexStruct.type_identifier2()._d()) - { - equiv_kind_anonymous_array_uint8_t_500 = EK_BOTH; - } - CollectionElementFlag element_flags_anonymous_array_uint8_t_500 = 0; - PlainCollectionHeader header_anonymous_array_uint8_t_500 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_500, element_flags_anonymous_array_uint8_t_500); - std::string type_id_kind_anonymous_array_uint8_t_500("TI_PLAIN_ARRAY_LARGE"); - if (type_id_kind_anonymous_array_uint8_t_500 == "TI_PLAIN_ARRAY_SMALL") - { - SBoundSeq array_bound_seq; - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(500)); - - PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_500, array_bound_seq, - eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_500)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_500")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_uint8_t_500 already registered in TypeObjectRegistry for a different type."); - } - } - else - { - LBoundSeq array_bound_seq; - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(500)); - - PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_500, array_bound_seq, - eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_500)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_500")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_uint8_t_500 already registered in TypeObjectRegistry for a different type."); - } - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_array_uint8_t_500", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_uint8_t_500: Given Array TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - CommonAliasBody common_MyOctetArray500; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_MyOctetArray500 = TypeObjectUtils::build_common_alias_body(related_flags_MyOctetArray500, type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_MyOctetArray500 = TypeObjectUtils::build_common_alias_body(related_flags_MyOctetArray500, type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyOctetArray500 related TypeIdentifier inconsistent."); - return; - } - eprosima::fastcdr::optional member_ann_builtin_MyOctetArray500; - ann_custom_MyOctetArray500.reset(); - CompleteAliasBody body_MyOctetArray500 = TypeObjectUtils::build_complete_alias_body(common_MyOctetArray500, member_ann_builtin_MyOctetArray500, ann_custom_MyOctetArray500); - CompleteAliasType alias_type_MyOctetArray500 = TypeObjectUtils::build_complete_alias_type(alias_flags_MyOctetArray500, header_MyOctetArray500, body_MyOctetArray500); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_alias_type_object(alias_type_MyOctetArray500, type_name_MyOctetArray500.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyOctetArray500 already registered in TypeObjectRegistry for a different type."); - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyOctetArray500", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyOctetArray500: Given Alias TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_octet_array_500 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_octet_array_500; - MemberId member_id_my_octet_array_500 = 0x00000007; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_octet_array_500 = TypeObjectUtils::build_common_struct_member(member_id_my_octet_array_500, member_flags_my_octet_array_500, type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_octet_array_500 = TypeObjectUtils::build_common_struct_member(member_id_my_octet_array_500, member_flags_my_octet_array_500, type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_octet_array_500 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_octet_array_500 = "my_octet_array_500"; - eprosima::fastcdr::optional member_ann_builtin_my_octet_array_500; - ann_custom_ComplexStruct.reset(); - CompleteMemberDetail detail_my_octet_array_500 = TypeObjectUtils::build_complete_member_detail(name_my_octet_array_500, member_ann_builtin_my_octet_array_500, ann_custom_ComplexStruct); - CompleteStructMember member_my_octet_array_500 = TypeObjectUtils::build_complete_struct_member(common_my_octet_array_500, detail_my_octet_array_500); - TypeObjectUtils::add_complete_struct_member(member_seq_ComplexStruct, member_my_octet_array_500); - } - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_array_BasicStruct_5", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "BasicStruct", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - { - StructTypeFlag struct_flags_BasicStruct = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_BasicStruct; - TypeIdentifierPair type_ids_BasicStruct; - QualifiedTypeName type_name_BasicStruct = "BasicStruct"; - eprosima::fastcdr::optional type_ann_builtin_BasicStruct; - eprosima::fastcdr::optional ann_custom_BasicStruct; - CompleteTypeDetail detail_BasicStruct = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_BasicStruct, ann_custom_BasicStruct, type_name_BasicStruct.to_string()); - CompleteStructHeader header_BasicStruct; - header_BasicStruct = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_BasicStruct); - CompleteStructMemberSeq member_seq_BasicStruct; - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_bool", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_bool Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_bool = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_bool; - MemberId member_id_my_bool = 0x00000000; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_bool = TypeObjectUtils::build_common_struct_member(member_id_my_bool, member_flags_my_bool, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_bool = TypeObjectUtils::build_common_struct_member(member_id_my_bool, member_flags_my_bool, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_bool member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_bool = "my_bool"; - eprosima::fastcdr::optional member_ann_builtin_my_bool; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_bool = TypeObjectUtils::build_complete_member_detail(name_my_bool, member_ann_builtin_my_bool, ann_custom_BasicStruct); - CompleteStructMember member_my_bool = TypeObjectUtils::build_complete_struct_member(common_my_bool, detail_my_bool); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_bool); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_byte", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_octet Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_octet = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_octet; - MemberId member_id_my_octet = 0x00000001; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_octet = TypeObjectUtils::build_common_struct_member(member_id_my_octet, member_flags_my_octet, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_octet = TypeObjectUtils::build_common_struct_member(member_id_my_octet, member_flags_my_octet, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_octet member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_octet = "my_octet"; - eprosima::fastcdr::optional member_ann_builtin_my_octet; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_octet = TypeObjectUtils::build_complete_member_detail(name_my_octet, member_ann_builtin_my_octet, ann_custom_BasicStruct); - CompleteStructMember member_my_octet = TypeObjectUtils::build_complete_struct_member(common_my_octet, detail_my_octet); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_octet); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int16_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_int16 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_int16 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_int16; - MemberId member_id_my_int16 = 0x00000002; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_int16 = TypeObjectUtils::build_common_struct_member(member_id_my_int16, member_flags_my_int16, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_int16 = TypeObjectUtils::build_common_struct_member(member_id_my_int16, member_flags_my_int16, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_int16 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_int16 = "my_int16"; - eprosima::fastcdr::optional member_ann_builtin_my_int16; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_int16 = TypeObjectUtils::build_complete_member_detail(name_my_int16, member_ann_builtin_my_int16, ann_custom_BasicStruct); - CompleteStructMember member_my_int16 = TypeObjectUtils::build_complete_struct_member(common_my_int16, detail_my_int16); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_int16); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_int32 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_int32 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_int32; - MemberId member_id_my_int32 = 0x00000003; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_int32 = TypeObjectUtils::build_common_struct_member(member_id_my_int32, member_flags_my_int32, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_int32 = TypeObjectUtils::build_common_struct_member(member_id_my_int32, member_flags_my_int32, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_int32 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_int32 = "my_int32"; - eprosima::fastcdr::optional member_ann_builtin_my_int32; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_int32 = TypeObjectUtils::build_complete_member_detail(name_my_int32, member_ann_builtin_my_int32, ann_custom_BasicStruct); - CompleteStructMember member_my_int32 = TypeObjectUtils::build_complete_struct_member(common_my_int32, detail_my_int32); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_int32); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int64_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_int64 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_int64 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_int64; - MemberId member_id_my_int64 = 0x00000004; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_int64 = TypeObjectUtils::build_common_struct_member(member_id_my_int64, member_flags_my_int64, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_int64 = TypeObjectUtils::build_common_struct_member(member_id_my_int64, member_flags_my_int64, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_int64 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_int64 = "my_int64"; - eprosima::fastcdr::optional member_ann_builtin_my_int64; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_int64 = TypeObjectUtils::build_complete_member_detail(name_my_int64, member_ann_builtin_my_int64, ann_custom_BasicStruct); - CompleteStructMember member_my_int64 = TypeObjectUtils::build_complete_struct_member(common_my_int64, detail_my_int64); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_int64); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_uint16_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_uint16 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_uint16 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_uint16; - MemberId member_id_my_uint16 = 0x00000005; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_uint16 = TypeObjectUtils::build_common_struct_member(member_id_my_uint16, member_flags_my_uint16, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_uint16 = TypeObjectUtils::build_common_struct_member(member_id_my_uint16, member_flags_my_uint16, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_uint16 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_uint16 = "my_uint16"; - eprosima::fastcdr::optional member_ann_builtin_my_uint16; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_uint16 = TypeObjectUtils::build_complete_member_detail(name_my_uint16, member_ann_builtin_my_uint16, ann_custom_BasicStruct); - CompleteStructMember member_my_uint16 = TypeObjectUtils::build_complete_struct_member(common_my_uint16, detail_my_uint16); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_uint16); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_uint32_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_uint32 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_uint32 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_uint32; - MemberId member_id_my_uint32 = 0x00000006; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_uint32 = TypeObjectUtils::build_common_struct_member(member_id_my_uint32, member_flags_my_uint32, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_uint32 = TypeObjectUtils::build_common_struct_member(member_id_my_uint32, member_flags_my_uint32, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_uint32 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_uint32 = "my_uint32"; - eprosima::fastcdr::optional member_ann_builtin_my_uint32; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_uint32 = TypeObjectUtils::build_complete_member_detail(name_my_uint32, member_ann_builtin_my_uint32, ann_custom_BasicStruct); - CompleteStructMember member_my_uint32 = TypeObjectUtils::build_complete_struct_member(common_my_uint32, detail_my_uint32); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_uint32); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_uint64_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_uint64 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_uint64 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_uint64; - MemberId member_id_my_uint64 = 0x00000007; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_uint64 = TypeObjectUtils::build_common_struct_member(member_id_my_uint64, member_flags_my_uint64, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_uint64 = TypeObjectUtils::build_common_struct_member(member_id_my_uint64, member_flags_my_uint64, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_uint64 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_uint64 = "my_uint64"; - eprosima::fastcdr::optional member_ann_builtin_my_uint64; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_uint64 = TypeObjectUtils::build_complete_member_detail(name_my_uint64, member_ann_builtin_my_uint64, ann_custom_BasicStruct); - CompleteStructMember member_my_uint64 = TypeObjectUtils::build_complete_struct_member(common_my_uint64, detail_my_uint64); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_uint64); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_float", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_float32 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_float32 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_float32; - MemberId member_id_my_float32 = 0x00000008; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_float32 = TypeObjectUtils::build_common_struct_member(member_id_my_float32, member_flags_my_float32, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_float32 = TypeObjectUtils::build_common_struct_member(member_id_my_float32, member_flags_my_float32, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_float32 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_float32 = "my_float32"; - eprosima::fastcdr::optional member_ann_builtin_my_float32; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_float32 = TypeObjectUtils::build_complete_member_detail(name_my_float32, member_ann_builtin_my_float32, ann_custom_BasicStruct); - CompleteStructMember member_my_float32 = TypeObjectUtils::build_complete_struct_member(common_my_float32, detail_my_float32); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_float32); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_double", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_float64 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_float64 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_float64; - MemberId member_id_my_float64 = 0x00000009; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_float64 = TypeObjectUtils::build_common_struct_member(member_id_my_float64, member_flags_my_float64, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_float64 = TypeObjectUtils::build_common_struct_member(member_id_my_float64, member_flags_my_float64, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_float64 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_float64 = "my_float64"; - eprosima::fastcdr::optional member_ann_builtin_my_float64; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_float64 = TypeObjectUtils::build_complete_member_detail(name_my_float64, member_ann_builtin_my_float64, ann_custom_BasicStruct); - CompleteStructMember member_my_float64 = TypeObjectUtils::build_complete_struct_member(common_my_float64, detail_my_float64); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_float64); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_longdouble", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_float128 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_float128 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_float128; - MemberId member_id_my_float128 = 0x0000000a; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_float128 = TypeObjectUtils::build_common_struct_member(member_id_my_float128, member_flags_my_float128, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_float128 = TypeObjectUtils::build_common_struct_member(member_id_my_float128, member_flags_my_float128, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_float128 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_float128 = "my_float128"; - eprosima::fastcdr::optional member_ann_builtin_my_float128; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_float128 = TypeObjectUtils::build_complete_member_detail(name_my_float128, member_ann_builtin_my_float128, ann_custom_BasicStruct); - CompleteStructMember member_my_float128 = TypeObjectUtils::build_complete_struct_member(common_my_float128, detail_my_float128); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_float128); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_char", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_char Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_char = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_char; - MemberId member_id_my_char = 0x0000000b; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_char = TypeObjectUtils::build_common_struct_member(member_id_my_char, member_flags_my_char, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_char = TypeObjectUtils::build_common_struct_member(member_id_my_char, member_flags_my_char, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_char member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_char = "my_char"; - eprosima::fastcdr::optional member_ann_builtin_my_char; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_char = TypeObjectUtils::build_complete_member_detail(name_my_char, member_ann_builtin_my_char, ann_custom_BasicStruct); - CompleteStructMember member_my_char = TypeObjectUtils::build_complete_struct_member(common_my_char, detail_my_char); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_char); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_string_unbounded", type_ids_BasicStruct); - - if (return_code_BasicStruct != 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_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_string_unbounded", type_ids_BasicStruct); - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_string_unbounded: Given String TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_string = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_string; - MemberId member_id_my_string = 0x0000000c; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_string = TypeObjectUtils::build_common_struct_member(member_id_my_string, member_flags_my_string, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_string = TypeObjectUtils::build_common_struct_member(member_id_my_string, member_flags_my_string, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_string member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_string = "my_string"; - eprosima::fastcdr::optional member_ann_builtin_my_string; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_string = TypeObjectUtils::build_complete_member_detail(name_my_string, member_ann_builtin_my_string, ann_custom_BasicStruct); - CompleteStructMember member_my_string = TypeObjectUtils::build_complete_struct_member(common_my_string, detail_my_string); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_string); - } - CompleteStructType struct_type_BasicStruct = TypeObjectUtils::build_complete_struct_type(struct_flags_BasicStruct, header_BasicStruct, member_seq_BasicStruct); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_BasicStruct, type_name_BasicStruct.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "BasicStruct already registered in TypeObjectRegistry for a different type."); - } - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "BasicStruct", type_ids_BasicStruct); - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "BasicStruct: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - } - TypeIdentifier* element_identifier_anonymous_array_BasicStruct_5 {nullptr}; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_array_BasicStruct_5 = new TypeIdentifier(type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_array_BasicStruct_5 = new TypeIdentifier(type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Array element TypeIdentifier inconsistent."); - return; - } - EquivalenceKind equiv_kind_anonymous_array_BasicStruct_5 = EK_COMPLETE; - if (TK_NONE == type_ids_ComplexStruct.type_identifier2()._d()) - { - equiv_kind_anonymous_array_BasicStruct_5 = EK_BOTH; - } - CollectionElementFlag element_flags_anonymous_array_BasicStruct_5 = 0; - PlainCollectionHeader header_anonymous_array_BasicStruct_5 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_BasicStruct_5, element_flags_anonymous_array_BasicStruct_5); - std::string type_id_kind_anonymous_array_BasicStruct_5("TI_PLAIN_ARRAY_SMALL"); - if (type_id_kind_anonymous_array_BasicStruct_5 == "TI_PLAIN_ARRAY_SMALL") - { - SBoundSeq array_bound_seq; - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(5)); - - PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_BasicStruct_5, array_bound_seq, - eprosima::fastcdr::external(element_identifier_anonymous_array_BasicStruct_5)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_BasicStruct_5")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_BasicStruct_5 already registered in TypeObjectRegistry for a different type."); - } - } - else - { - LBoundSeq array_bound_seq; - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(5)); - - PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_BasicStruct_5, array_bound_seq, - eprosima::fastcdr::external(element_identifier_anonymous_array_BasicStruct_5)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_BasicStruct_5")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_BasicStruct_5 already registered in TypeObjectRegistry for a different type."); - } - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_array_BasicStruct_5", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_BasicStruct_5: Given Array TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_array_struct = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_array_struct; - MemberId member_id_my_array_struct = 0x00000008; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_array_struct = TypeObjectUtils::build_common_struct_member(member_id_my_array_struct, member_flags_my_array_struct, type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_array_struct = TypeObjectUtils::build_common_struct_member(member_id_my_array_struct, member_flags_my_array_struct, type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_array_struct member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_array_struct = "my_array_struct"; - eprosima::fastcdr::optional member_ann_builtin_my_array_struct; - ann_custom_ComplexStruct.reset(); - CompleteMemberDetail detail_my_array_struct = TypeObjectUtils::build_complete_member_detail(name_my_array_struct, member_ann_builtin_my_array_struct, ann_custom_ComplexStruct); - CompleteStructMember member_my_array_struct = TypeObjectUtils::build_complete_struct_member(common_my_array_struct, detail_my_array_struct); - TypeObjectUtils::add_complete_struct_member(member_seq_ComplexStruct, member_my_array_struct); - } - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_map_uint8_t_int16_t_unbounded", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int16_t", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Map element TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - TypeIdentifier* element_identifier_anonymous_map_uint8_t_int16_t_unbounded {nullptr}; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_map_uint8_t_int16_t_unbounded = new TypeIdentifier(type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_map_uint8_t_int16_t_unbounded = new TypeIdentifier(type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_uint8_t_int16_t_unbounded inconsistent element TypeIdentifier."); - return; - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_byte", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Map key TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - TypeIdentifier* key_identifier_anonymous_map_uint8_t_int16_t_unbounded {nullptr}; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - key_identifier_anonymous_map_uint8_t_int16_t_unbounded = new TypeIdentifier(type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - key_identifier_anonymous_map_uint8_t_int16_t_unbounded = new TypeIdentifier(type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_uint8_t_int16_t_unbounded inconsistent key TypeIdentifier."); - return; - } - EquivalenceKind equiv_kind_anonymous_map_uint8_t_int16_t_unbounded = EK_BOTH; - if ((EK_COMPLETE == key_identifier_anonymous_map_uint8_t_int16_t_unbounded->_d() || EK_COMPLETE == element_identifier_anonymous_map_uint8_t_int16_t_unbounded->_d()) || - (TI_PLAIN_SEQUENCE_SMALL == element_identifier_anonymous_map_uint8_t_int16_t_unbounded->_d() && EK_COMPLETE == element_identifier_anonymous_map_uint8_t_int16_t_unbounded->seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == element_identifier_anonymous_map_uint8_t_int16_t_unbounded->_d() && EK_COMPLETE == element_identifier_anonymous_map_uint8_t_int16_t_unbounded->seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == element_identifier_anonymous_map_uint8_t_int16_t_unbounded->_d() && EK_COMPLETE == element_identifier_anonymous_map_uint8_t_int16_t_unbounded->array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == element_identifier_anonymous_map_uint8_t_int16_t_unbounded->_d() && EK_COMPLETE == element_identifier_anonymous_map_uint8_t_int16_t_unbounded->array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == element_identifier_anonymous_map_uint8_t_int16_t_unbounded->_d() && (EK_COMPLETE == element_identifier_anonymous_map_uint8_t_int16_t_unbounded->map_sdefn().key_identifier()->_d() || EK_COMPLETE == element_identifier_anonymous_map_uint8_t_int16_t_unbounded->map_sdefn().header().equiv_kind())) || - (TI_PLAIN_MAP_LARGE == element_identifier_anonymous_map_uint8_t_int16_t_unbounded->_d() && (EK_COMPLETE == element_identifier_anonymous_map_uint8_t_int16_t_unbounded->map_ldefn().key_identifier()->_d() || EK_COMPLETE == element_identifier_anonymous_map_uint8_t_int16_t_unbounded->map_ldefn().header().equiv_kind()))) - { - equiv_kind_anonymous_map_uint8_t_int16_t_unbounded = EK_COMPLETE; - } - CollectionElementFlag element_flags_anonymous_map_uint8_t_int16_t_unbounded = 0; - CollectionElementFlag key_flags_anonymous_map_uint8_t_int16_t_unbounded = 0; - PlainCollectionHeader header_anonymous_map_uint8_t_int16_t_unbounded = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_map_uint8_t_int16_t_unbounded, element_flags_anonymous_map_uint8_t_int16_t_unbounded); - std::string type_id_kind_anonymous_map_uint8_t_int16_t_unbounded("TI_PLAIN_MAP_SMALL"); - if (type_id_kind_anonymous_map_uint8_t_int16_t_unbounded == "TI_PLAIN_MAP_SMALL") - { - SBound bound = 0; - PlainMapSTypeDefn map_sdefn = TypeObjectUtils::build_plain_map_s_type_defn(header_anonymous_map_uint8_t_int16_t_unbounded, bound, - eprosima::fastcdr::external(element_identifier_anonymous_map_uint8_t_int16_t_unbounded), key_flags_anonymous_map_uint8_t_int16_t_unbounded, - eprosima::fastcdr::external(key_identifier_anonymous_map_uint8_t_int16_t_unbounded)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_s_map_type_identifier(map_sdefn, "anonymous_map_uint8_t_int16_t_unbounded")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_uint8_t_int16_t_unbounded already registered in TypeObjectRegistry for a different type."); - } - } - else - { - LBound bound = 0; - PlainMapLTypeDefn map_ldefn = TypeObjectUtils::build_plain_map_l_type_defn(header_anonymous_map_uint8_t_int16_t_unbounded, bound, - eprosima::fastcdr::external(element_identifier_anonymous_map_uint8_t_int16_t_unbounded), key_flags_anonymous_map_uint8_t_int16_t_unbounded, - eprosima::fastcdr::external(key_identifier_anonymous_map_uint8_t_int16_t_unbounded)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_l_map_type_identifier(map_ldefn, "anonymous_map_uint8_t_int16_t_unbounded")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_uint8_t_int16_t_unbounded already registered in TypeObjectRegistry for a different type."); - } - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_map_uint8_t_int16_t_unbounded", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_uint8_t_int16_t_unbounded: Given Map TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_map_octet_short = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_map_octet_short; - MemberId member_id_my_map_octet_short = 0x00000009; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_map_octet_short = TypeObjectUtils::build_common_struct_member(member_id_my_map_octet_short, member_flags_my_map_octet_short, type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_map_octet_short = TypeObjectUtils::build_common_struct_member(member_id_my_map_octet_short, member_flags_my_map_octet_short, type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_map_octet_short member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_map_octet_short = "my_map_octet_short"; - eprosima::fastcdr::optional member_ann_builtin_my_map_octet_short; - ann_custom_ComplexStruct.reset(); - CompleteMemberDetail detail_my_map_octet_short = TypeObjectUtils::build_complete_member_detail(name_my_map_octet_short, member_ann_builtin_my_map_octet_short, ann_custom_ComplexStruct); - CompleteStructMember member_my_map_octet_short = TypeObjectUtils::build_complete_struct_member(common_my_map_octet_short, detail_my_map_octet_short); - TypeObjectUtils::add_complete_struct_member(member_seq_ComplexStruct, member_my_map_octet_short); - } - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_map_int32_t_BasicStruct_unbounded", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "BasicStruct", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - { - StructTypeFlag struct_flags_BasicStruct = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_BasicStruct; - TypeIdentifierPair type_ids_BasicStruct; - QualifiedTypeName type_name_BasicStruct = "BasicStruct"; - eprosima::fastcdr::optional type_ann_builtin_BasicStruct; - eprosima::fastcdr::optional ann_custom_BasicStruct; - CompleteTypeDetail detail_BasicStruct = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_BasicStruct, ann_custom_BasicStruct, type_name_BasicStruct.to_string()); - CompleteStructHeader header_BasicStruct; - header_BasicStruct = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_BasicStruct); - CompleteStructMemberSeq member_seq_BasicStruct; - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_bool", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_bool Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_bool = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_bool; - MemberId member_id_my_bool = 0x00000000; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_bool = TypeObjectUtils::build_common_struct_member(member_id_my_bool, member_flags_my_bool, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_bool = TypeObjectUtils::build_common_struct_member(member_id_my_bool, member_flags_my_bool, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_bool member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_bool = "my_bool"; - eprosima::fastcdr::optional member_ann_builtin_my_bool; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_bool = TypeObjectUtils::build_complete_member_detail(name_my_bool, member_ann_builtin_my_bool, ann_custom_BasicStruct); - CompleteStructMember member_my_bool = TypeObjectUtils::build_complete_struct_member(common_my_bool, detail_my_bool); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_bool); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_byte", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_octet Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_octet = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_octet; - MemberId member_id_my_octet = 0x00000001; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_octet = TypeObjectUtils::build_common_struct_member(member_id_my_octet, member_flags_my_octet, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_octet = TypeObjectUtils::build_common_struct_member(member_id_my_octet, member_flags_my_octet, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_octet member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_octet = "my_octet"; - eprosima::fastcdr::optional member_ann_builtin_my_octet; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_octet = TypeObjectUtils::build_complete_member_detail(name_my_octet, member_ann_builtin_my_octet, ann_custom_BasicStruct); - CompleteStructMember member_my_octet = TypeObjectUtils::build_complete_struct_member(common_my_octet, detail_my_octet); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_octet); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int16_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_int16 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_int16 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_int16; - MemberId member_id_my_int16 = 0x00000002; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_int16 = TypeObjectUtils::build_common_struct_member(member_id_my_int16, member_flags_my_int16, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_int16 = TypeObjectUtils::build_common_struct_member(member_id_my_int16, member_flags_my_int16, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_int16 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_int16 = "my_int16"; - eprosima::fastcdr::optional member_ann_builtin_my_int16; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_int16 = TypeObjectUtils::build_complete_member_detail(name_my_int16, member_ann_builtin_my_int16, ann_custom_BasicStruct); - CompleteStructMember member_my_int16 = TypeObjectUtils::build_complete_struct_member(common_my_int16, detail_my_int16); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_int16); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_int32 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_int32 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_int32; - MemberId member_id_my_int32 = 0x00000003; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_int32 = TypeObjectUtils::build_common_struct_member(member_id_my_int32, member_flags_my_int32, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_int32 = TypeObjectUtils::build_common_struct_member(member_id_my_int32, member_flags_my_int32, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_int32 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_int32 = "my_int32"; - eprosima::fastcdr::optional member_ann_builtin_my_int32; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_int32 = TypeObjectUtils::build_complete_member_detail(name_my_int32, member_ann_builtin_my_int32, ann_custom_BasicStruct); - CompleteStructMember member_my_int32 = TypeObjectUtils::build_complete_struct_member(common_my_int32, detail_my_int32); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_int32); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int64_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_int64 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_int64 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_int64; - MemberId member_id_my_int64 = 0x00000004; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_int64 = TypeObjectUtils::build_common_struct_member(member_id_my_int64, member_flags_my_int64, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_int64 = TypeObjectUtils::build_common_struct_member(member_id_my_int64, member_flags_my_int64, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_int64 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_int64 = "my_int64"; - eprosima::fastcdr::optional member_ann_builtin_my_int64; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_int64 = TypeObjectUtils::build_complete_member_detail(name_my_int64, member_ann_builtin_my_int64, ann_custom_BasicStruct); - CompleteStructMember member_my_int64 = TypeObjectUtils::build_complete_struct_member(common_my_int64, detail_my_int64); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_int64); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_uint16_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_uint16 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_uint16 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_uint16; - MemberId member_id_my_uint16 = 0x00000005; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_uint16 = TypeObjectUtils::build_common_struct_member(member_id_my_uint16, member_flags_my_uint16, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_uint16 = TypeObjectUtils::build_common_struct_member(member_id_my_uint16, member_flags_my_uint16, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_uint16 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_uint16 = "my_uint16"; - eprosima::fastcdr::optional member_ann_builtin_my_uint16; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_uint16 = TypeObjectUtils::build_complete_member_detail(name_my_uint16, member_ann_builtin_my_uint16, ann_custom_BasicStruct); - CompleteStructMember member_my_uint16 = TypeObjectUtils::build_complete_struct_member(common_my_uint16, detail_my_uint16); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_uint16); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_uint32_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_uint32 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_uint32 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_uint32; - MemberId member_id_my_uint32 = 0x00000006; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_uint32 = TypeObjectUtils::build_common_struct_member(member_id_my_uint32, member_flags_my_uint32, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_uint32 = TypeObjectUtils::build_common_struct_member(member_id_my_uint32, member_flags_my_uint32, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_uint32 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_uint32 = "my_uint32"; - eprosima::fastcdr::optional member_ann_builtin_my_uint32; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_uint32 = TypeObjectUtils::build_complete_member_detail(name_my_uint32, member_ann_builtin_my_uint32, ann_custom_BasicStruct); - CompleteStructMember member_my_uint32 = TypeObjectUtils::build_complete_struct_member(common_my_uint32, detail_my_uint32); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_uint32); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_uint64_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_uint64 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_uint64 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_uint64; - MemberId member_id_my_uint64 = 0x00000007; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_uint64 = TypeObjectUtils::build_common_struct_member(member_id_my_uint64, member_flags_my_uint64, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_uint64 = TypeObjectUtils::build_common_struct_member(member_id_my_uint64, member_flags_my_uint64, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_uint64 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_uint64 = "my_uint64"; - eprosima::fastcdr::optional member_ann_builtin_my_uint64; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_uint64 = TypeObjectUtils::build_complete_member_detail(name_my_uint64, member_ann_builtin_my_uint64, ann_custom_BasicStruct); - CompleteStructMember member_my_uint64 = TypeObjectUtils::build_complete_struct_member(common_my_uint64, detail_my_uint64); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_uint64); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_float", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_float32 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_float32 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_float32; - MemberId member_id_my_float32 = 0x00000008; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_float32 = TypeObjectUtils::build_common_struct_member(member_id_my_float32, member_flags_my_float32, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_float32 = TypeObjectUtils::build_common_struct_member(member_id_my_float32, member_flags_my_float32, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_float32 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_float32 = "my_float32"; - eprosima::fastcdr::optional member_ann_builtin_my_float32; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_float32 = TypeObjectUtils::build_complete_member_detail(name_my_float32, member_ann_builtin_my_float32, ann_custom_BasicStruct); - CompleteStructMember member_my_float32 = TypeObjectUtils::build_complete_struct_member(common_my_float32, detail_my_float32); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_float32); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_double", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_float64 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_float64 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_float64; - MemberId member_id_my_float64 = 0x00000009; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_float64 = TypeObjectUtils::build_common_struct_member(member_id_my_float64, member_flags_my_float64, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_float64 = TypeObjectUtils::build_common_struct_member(member_id_my_float64, member_flags_my_float64, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_float64 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_float64 = "my_float64"; - eprosima::fastcdr::optional member_ann_builtin_my_float64; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_float64 = TypeObjectUtils::build_complete_member_detail(name_my_float64, member_ann_builtin_my_float64, ann_custom_BasicStruct); - CompleteStructMember member_my_float64 = TypeObjectUtils::build_complete_struct_member(common_my_float64, detail_my_float64); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_float64); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_longdouble", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_float128 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_float128 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_float128; - MemberId member_id_my_float128 = 0x0000000a; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_float128 = TypeObjectUtils::build_common_struct_member(member_id_my_float128, member_flags_my_float128, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_float128 = TypeObjectUtils::build_common_struct_member(member_id_my_float128, member_flags_my_float128, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_float128 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_float128 = "my_float128"; - eprosima::fastcdr::optional member_ann_builtin_my_float128; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_float128 = TypeObjectUtils::build_complete_member_detail(name_my_float128, member_ann_builtin_my_float128, ann_custom_BasicStruct); - CompleteStructMember member_my_float128 = TypeObjectUtils::build_complete_struct_member(common_my_float128, detail_my_float128); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_float128); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_char", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_char Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_char = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_char; - MemberId member_id_my_char = 0x0000000b; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_char = TypeObjectUtils::build_common_struct_member(member_id_my_char, member_flags_my_char, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_char = TypeObjectUtils::build_common_struct_member(member_id_my_char, member_flags_my_char, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_char member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_char = "my_char"; - eprosima::fastcdr::optional member_ann_builtin_my_char; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_char = TypeObjectUtils::build_complete_member_detail(name_my_char, member_ann_builtin_my_char, ann_custom_BasicStruct); - CompleteStructMember member_my_char = TypeObjectUtils::build_complete_struct_member(common_my_char, detail_my_char); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_char); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_string_unbounded", type_ids_BasicStruct); - - if (return_code_BasicStruct != 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_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_string_unbounded", type_ids_BasicStruct); - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_string_unbounded: Given String TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_string = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_string; - MemberId member_id_my_string = 0x0000000c; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_string = TypeObjectUtils::build_common_struct_member(member_id_my_string, member_flags_my_string, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_string = TypeObjectUtils::build_common_struct_member(member_id_my_string, member_flags_my_string, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_string member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_string = "my_string"; - eprosima::fastcdr::optional member_ann_builtin_my_string; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_string = TypeObjectUtils::build_complete_member_detail(name_my_string, member_ann_builtin_my_string, ann_custom_BasicStruct); - CompleteStructMember member_my_string = TypeObjectUtils::build_complete_struct_member(common_my_string, detail_my_string); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_string); - } - CompleteStructType struct_type_BasicStruct = TypeObjectUtils::build_complete_struct_type(struct_flags_BasicStruct, header_BasicStruct, member_seq_BasicStruct); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_BasicStruct, type_name_BasicStruct.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "BasicStruct already registered in TypeObjectRegistry for a different type."); - } - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "BasicStruct", type_ids_BasicStruct); - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "BasicStruct: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - } - TypeIdentifier* element_identifier_anonymous_map_int32_t_BasicStruct_unbounded {nullptr}; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_map_int32_t_BasicStruct_unbounded = new TypeIdentifier(type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_map_int32_t_BasicStruct_unbounded = new TypeIdentifier(type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_BasicStruct_unbounded inconsistent element TypeIdentifier."); - return; - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Map key TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - TypeIdentifier* key_identifier_anonymous_map_int32_t_BasicStruct_unbounded {nullptr}; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - key_identifier_anonymous_map_int32_t_BasicStruct_unbounded = new TypeIdentifier(type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - key_identifier_anonymous_map_int32_t_BasicStruct_unbounded = new TypeIdentifier(type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_BasicStruct_unbounded inconsistent key TypeIdentifier."); - return; - } - EquivalenceKind equiv_kind_anonymous_map_int32_t_BasicStruct_unbounded = EK_BOTH; - if ((EK_COMPLETE == key_identifier_anonymous_map_int32_t_BasicStruct_unbounded->_d() || EK_COMPLETE == element_identifier_anonymous_map_int32_t_BasicStruct_unbounded->_d()) || - (TI_PLAIN_SEQUENCE_SMALL == element_identifier_anonymous_map_int32_t_BasicStruct_unbounded->_d() && EK_COMPLETE == element_identifier_anonymous_map_int32_t_BasicStruct_unbounded->seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == element_identifier_anonymous_map_int32_t_BasicStruct_unbounded->_d() && EK_COMPLETE == element_identifier_anonymous_map_int32_t_BasicStruct_unbounded->seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == element_identifier_anonymous_map_int32_t_BasicStruct_unbounded->_d() && EK_COMPLETE == element_identifier_anonymous_map_int32_t_BasicStruct_unbounded->array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == element_identifier_anonymous_map_int32_t_BasicStruct_unbounded->_d() && EK_COMPLETE == element_identifier_anonymous_map_int32_t_BasicStruct_unbounded->array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == element_identifier_anonymous_map_int32_t_BasicStruct_unbounded->_d() && (EK_COMPLETE == element_identifier_anonymous_map_int32_t_BasicStruct_unbounded->map_sdefn().key_identifier()->_d() || EK_COMPLETE == element_identifier_anonymous_map_int32_t_BasicStruct_unbounded->map_sdefn().header().equiv_kind())) || - (TI_PLAIN_MAP_LARGE == element_identifier_anonymous_map_int32_t_BasicStruct_unbounded->_d() && (EK_COMPLETE == element_identifier_anonymous_map_int32_t_BasicStruct_unbounded->map_ldefn().key_identifier()->_d() || EK_COMPLETE == element_identifier_anonymous_map_int32_t_BasicStruct_unbounded->map_ldefn().header().equiv_kind()))) - { - equiv_kind_anonymous_map_int32_t_BasicStruct_unbounded = EK_COMPLETE; - } - CollectionElementFlag element_flags_anonymous_map_int32_t_BasicStruct_unbounded = 0; - CollectionElementFlag key_flags_anonymous_map_int32_t_BasicStruct_unbounded = 0; - PlainCollectionHeader header_anonymous_map_int32_t_BasicStruct_unbounded = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_map_int32_t_BasicStruct_unbounded, element_flags_anonymous_map_int32_t_BasicStruct_unbounded); - std::string type_id_kind_anonymous_map_int32_t_BasicStruct_unbounded("TI_PLAIN_MAP_SMALL"); - if (type_id_kind_anonymous_map_int32_t_BasicStruct_unbounded == "TI_PLAIN_MAP_SMALL") - { - SBound bound = 0; - PlainMapSTypeDefn map_sdefn = TypeObjectUtils::build_plain_map_s_type_defn(header_anonymous_map_int32_t_BasicStruct_unbounded, bound, - eprosima::fastcdr::external(element_identifier_anonymous_map_int32_t_BasicStruct_unbounded), key_flags_anonymous_map_int32_t_BasicStruct_unbounded, - eprosima::fastcdr::external(key_identifier_anonymous_map_int32_t_BasicStruct_unbounded)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_s_map_type_identifier(map_sdefn, "anonymous_map_int32_t_BasicStruct_unbounded")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_BasicStruct_unbounded already registered in TypeObjectRegistry for a different type."); - } - } - else - { - LBound bound = 0; - PlainMapLTypeDefn map_ldefn = TypeObjectUtils::build_plain_map_l_type_defn(header_anonymous_map_int32_t_BasicStruct_unbounded, bound, - eprosima::fastcdr::external(element_identifier_anonymous_map_int32_t_BasicStruct_unbounded), key_flags_anonymous_map_int32_t_BasicStruct_unbounded, - eprosima::fastcdr::external(key_identifier_anonymous_map_int32_t_BasicStruct_unbounded)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_l_map_type_identifier(map_ldefn, "anonymous_map_int32_t_BasicStruct_unbounded")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_BasicStruct_unbounded already registered in TypeObjectRegistry for a different type."); - } - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_map_int32_t_BasicStruct_unbounded", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_BasicStruct_unbounded: Given Map TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_map_long_struct = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_map_long_struct; - MemberId member_id_my_map_long_struct = 0x0000000a; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_map_long_struct = TypeObjectUtils::build_common_struct_member(member_id_my_map_long_struct, member_flags_my_map_long_struct, type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_map_long_struct = TypeObjectUtils::build_common_struct_member(member_id_my_map_long_struct, member_flags_my_map_long_struct, type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_map_long_struct member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_map_long_struct = "my_map_long_struct"; - eprosima::fastcdr::optional member_ann_builtin_my_map_long_struct; - ann_custom_ComplexStruct.reset(); - CompleteMemberDetail detail_my_map_long_struct = TypeObjectUtils::build_complete_member_detail(name_my_map_long_struct, member_ann_builtin_my_map_long_struct, ann_custom_ComplexStruct); - CompleteStructMember member_my_map_long_struct = TypeObjectUtils::build_complete_struct_member(common_my_map_long_struct, detail_my_map_long_struct); - TypeObjectUtils::add_complete_struct_member(member_seq_ComplexStruct, member_my_map_long_struct); - } - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_sequence_uint8_t_unbounded", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_byte", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != 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_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_sequence_uint8_t_unbounded = new TypeIdentifier(type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_sequence_uint8_t_unbounded = new TypeIdentifier(type_ids_ComplexStruct.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_ComplexStruct.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_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_sequence_uint8_t_unbounded", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_sequence_uint8_t_unbounded: Given Sequence TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - TypeIdentifier* element_identifier_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded {nullptr}; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded = new TypeIdentifier(type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded = new TypeIdentifier(type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Sequence element TypeIdentifier inconsistent."); - return; - } - EquivalenceKind equiv_kind_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded = EK_COMPLETE; - if (TK_NONE == type_ids_ComplexStruct.type_identifier2()._d()) - { - equiv_kind_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded = EK_BOTH; - } - CollectionElementFlag element_flags_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded = 0; - PlainCollectionHeader header_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded, element_flags_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded); - std::string type_id_kind_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded("TI_PLAIN_SEQUENCE_SMALL"); - if (type_id_kind_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded == "TI_PLAIN_SEQUENCE_SMALL") - { - SBound bound = 0; - PlainSequenceSElemDefn seq_sdefn = TypeObjectUtils::build_plain_sequence_s_elem_defn(header_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded, bound, - eprosima::fastcdr::external(element_identifier_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_s_sequence_type_identifier(seq_sdefn, "anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_sequence_anonymous_sequence_uint8_t_unbounded_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_anonymous_sequence_uint8_t_unbounded_unbounded, bound, - eprosima::fastcdr::external(element_identifier_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_l_sequence_type_identifier(seq_ldefn, "anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded already registered in TypeObjectRegistry for a different type."); - } - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded: Given Sequence TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - TypeIdentifier* element_identifier_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded {nullptr}; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded = new TypeIdentifier(type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded = new TypeIdentifier(type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded inconsistent element TypeIdentifier."); - return; - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Map key TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - TypeIdentifier* key_identifier_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded {nullptr}; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - key_identifier_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded = new TypeIdentifier(type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - key_identifier_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded = new TypeIdentifier(type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded inconsistent key TypeIdentifier."); - return; - } - EquivalenceKind equiv_kind_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded = EK_BOTH; - if ((EK_COMPLETE == key_identifier_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded->_d() || EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded->_d()) || - (TI_PLAIN_SEQUENCE_SMALL == element_identifier_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded->_d() && EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded->seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == element_identifier_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded->_d() && EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded->seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == element_identifier_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded->_d() && EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded->array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == element_identifier_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded->_d() && EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded->array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == element_identifier_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded->_d() && (EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded->map_sdefn().key_identifier()->_d() || EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded->map_sdefn().header().equiv_kind())) || - (TI_PLAIN_MAP_LARGE == element_identifier_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded->_d() && (EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded->map_ldefn().key_identifier()->_d() || EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded->map_ldefn().header().equiv_kind()))) - { - equiv_kind_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded = EK_COMPLETE; - } - CollectionElementFlag element_flags_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded = 0; - CollectionElementFlag key_flags_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded = 0; - PlainCollectionHeader header_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded, element_flags_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded); - std::string type_id_kind_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded("TI_PLAIN_MAP_SMALL"); - if (type_id_kind_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded == "TI_PLAIN_MAP_SMALL") - { - SBound bound = 0; - PlainMapSTypeDefn map_sdefn = TypeObjectUtils::build_plain_map_s_type_defn(header_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded, bound, - eprosima::fastcdr::external(element_identifier_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded), key_flags_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded, - eprosima::fastcdr::external(key_identifier_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_s_map_type_identifier(map_sdefn, "anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded already registered in TypeObjectRegistry for a different type."); - } - } - else - { - LBound bound = 0; - PlainMapLTypeDefn map_ldefn = TypeObjectUtils::build_plain_map_l_type_defn(header_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded, bound, - eprosima::fastcdr::external(element_identifier_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded), key_flags_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded, - eprosima::fastcdr::external(key_identifier_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_l_map_type_identifier(map_ldefn, "anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded already registered in TypeObjectRegistry for a different type."); - } - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded: Given Map TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_map_long_seq_octet = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_map_long_seq_octet; - MemberId member_id_my_map_long_seq_octet = 0x0000000b; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_map_long_seq_octet = TypeObjectUtils::build_common_struct_member(member_id_my_map_long_seq_octet, member_flags_my_map_long_seq_octet, type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_map_long_seq_octet = TypeObjectUtils::build_common_struct_member(member_id_my_map_long_seq_octet, member_flags_my_map_long_seq_octet, type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_map_long_seq_octet member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_map_long_seq_octet = "my_map_long_seq_octet"; - eprosima::fastcdr::optional member_ann_builtin_my_map_long_seq_octet; - ann_custom_ComplexStruct.reset(); - CompleteMemberDetail detail_my_map_long_seq_octet = TypeObjectUtils::build_complete_member_detail(name_my_map_long_seq_octet, member_ann_builtin_my_map_long_seq_octet, ann_custom_ComplexStruct); - CompleteStructMember member_my_map_long_seq_octet = TypeObjectUtils::build_complete_struct_member(common_my_map_long_seq_octet, detail_my_map_long_seq_octet); - TypeObjectUtils::add_complete_struct_member(member_seq_ComplexStruct, member_my_map_long_seq_octet); - } - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyOctetArray500", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - AliasTypeFlag alias_flags_MyOctetArray500 = 0; - QualifiedTypeName type_name_MyOctetArray500 = "MyOctetArray500"; - eprosima::fastcdr::optional type_ann_builtin_MyOctetArray500; - eprosima::fastcdr::optional ann_custom_MyOctetArray500; - CompleteTypeDetail detail_MyOctetArray500 = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_MyOctetArray500, ann_custom_MyOctetArray500, type_name_MyOctetArray500.to_string()); - CompleteAliasHeader header_MyOctetArray500 = TypeObjectUtils::build_complete_alias_header(detail_MyOctetArray500); - AliasMemberFlag related_flags_MyOctetArray500 = 0; - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_array_uint8_t_500", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_byte", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Array element TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - TypeIdentifier* element_identifier_anonymous_array_uint8_t_500 {nullptr}; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_array_uint8_t_500 = new TypeIdentifier(type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_array_uint8_t_500 = new TypeIdentifier(type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Array element TypeIdentifier inconsistent."); - return; - } - EquivalenceKind equiv_kind_anonymous_array_uint8_t_500 = EK_COMPLETE; - if (TK_NONE == type_ids_ComplexStruct.type_identifier2()._d()) - { - equiv_kind_anonymous_array_uint8_t_500 = EK_BOTH; - } - CollectionElementFlag element_flags_anonymous_array_uint8_t_500 = 0; - PlainCollectionHeader header_anonymous_array_uint8_t_500 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_500, element_flags_anonymous_array_uint8_t_500); - std::string type_id_kind_anonymous_array_uint8_t_500("TI_PLAIN_ARRAY_LARGE"); - if (type_id_kind_anonymous_array_uint8_t_500 == "TI_PLAIN_ARRAY_SMALL") - { - SBoundSeq array_bound_seq; - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(500)); - - PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_500, array_bound_seq, - eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_500)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_500")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_uint8_t_500 already registered in TypeObjectRegistry for a different type."); - } - } - else - { - LBoundSeq array_bound_seq; - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(500)); - - PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_500, array_bound_seq, - eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_500)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_500")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_uint8_t_500 already registered in TypeObjectRegistry for a different type."); - } - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_array_uint8_t_500", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_uint8_t_500: Given Array TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - CommonAliasBody common_MyOctetArray500; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_MyOctetArray500 = TypeObjectUtils::build_common_alias_body(related_flags_MyOctetArray500, type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_MyOctetArray500 = TypeObjectUtils::build_common_alias_body(related_flags_MyOctetArray500, type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyOctetArray500 related TypeIdentifier inconsistent."); - return; - } - eprosima::fastcdr::optional member_ann_builtin_MyOctetArray500; - ann_custom_MyOctetArray500.reset(); - CompleteAliasBody body_MyOctetArray500 = TypeObjectUtils::build_complete_alias_body(common_MyOctetArray500, member_ann_builtin_MyOctetArray500, ann_custom_MyOctetArray500); - CompleteAliasType alias_type_MyOctetArray500 = TypeObjectUtils::build_complete_alias_type(alias_flags_MyOctetArray500, header_MyOctetArray500, body_MyOctetArray500); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_alias_type_object(alias_type_MyOctetArray500, type_name_MyOctetArray500.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyOctetArray500 already registered in TypeObjectRegistry for a different type."); - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyOctetArray500", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyOctetArray500: Given Alias TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - TypeIdentifier* element_identifier_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded {nullptr}; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded = new TypeIdentifier(type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded = new TypeIdentifier(type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded inconsistent element TypeIdentifier."); - return; - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Map key TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - TypeIdentifier* key_identifier_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded {nullptr}; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - key_identifier_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded = new TypeIdentifier(type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - key_identifier_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded = new TypeIdentifier(type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded inconsistent key TypeIdentifier."); - return; - } - EquivalenceKind equiv_kind_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded = EK_BOTH; - if ((EK_COMPLETE == key_identifier_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded->_d() || EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded->_d()) || - (TI_PLAIN_SEQUENCE_SMALL == element_identifier_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded->_d() && EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded->seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == element_identifier_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded->_d() && EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded->seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == element_identifier_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded->_d() && EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded->array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == element_identifier_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded->_d() && EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded->array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == element_identifier_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded->_d() && (EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded->map_sdefn().key_identifier()->_d() || EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded->map_sdefn().header().equiv_kind())) || - (TI_PLAIN_MAP_LARGE == element_identifier_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded->_d() && (EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded->map_ldefn().key_identifier()->_d() || EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded->map_ldefn().header().equiv_kind()))) - { - equiv_kind_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded = EK_COMPLETE; - } - CollectionElementFlag element_flags_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded = 0; - CollectionElementFlag key_flags_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded = 0; - PlainCollectionHeader header_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded, element_flags_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded); - std::string type_id_kind_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded("TI_PLAIN_MAP_SMALL"); - if (type_id_kind_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded == "TI_PLAIN_MAP_SMALL") - { - SBound bound = 0; - PlainMapSTypeDefn map_sdefn = TypeObjectUtils::build_plain_map_s_type_defn(header_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded, bound, - eprosima::fastcdr::external(element_identifier_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded), key_flags_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded, - eprosima::fastcdr::external(key_identifier_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_s_map_type_identifier(map_sdefn, "anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded already registered in TypeObjectRegistry for a different type."); - } - } - else - { - LBound bound = 0; - PlainMapLTypeDefn map_ldefn = TypeObjectUtils::build_plain_map_l_type_defn(header_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded, bound, - eprosima::fastcdr::external(element_identifier_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded), key_flags_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded, - eprosima::fastcdr::external(key_identifier_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_l_map_type_identifier(map_ldefn, "anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded already registered in TypeObjectRegistry for a different type."); - } - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded: Given Map TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_map_long_octet_array_500 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_map_long_octet_array_500; - MemberId member_id_my_map_long_octet_array_500 = 0x0000000c; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_map_long_octet_array_500 = TypeObjectUtils::build_common_struct_member(member_id_my_map_long_octet_array_500, member_flags_my_map_long_octet_array_500, type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_map_long_octet_array_500 = TypeObjectUtils::build_common_struct_member(member_id_my_map_long_octet_array_500, member_flags_my_map_long_octet_array_500, type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_map_long_octet_array_500 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_map_long_octet_array_500 = "my_map_long_octet_array_500"; - eprosima::fastcdr::optional member_ann_builtin_my_map_long_octet_array_500; - ann_custom_ComplexStruct.reset(); - CompleteMemberDetail detail_my_map_long_octet_array_500 = TypeObjectUtils::build_complete_member_detail(name_my_map_long_octet_array_500, member_ann_builtin_my_map_long_octet_array_500, ann_custom_ComplexStruct); - CompleteStructMember member_my_map_long_octet_array_500 = TypeObjectUtils::build_complete_struct_member(common_my_map_long_octet_array_500, detail_my_map_long_octet_array_500); - TypeObjectUtils::add_complete_struct_member(member_seq_ComplexStruct, member_my_map_long_octet_array_500); - } - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "BSAlias5", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - AliasTypeFlag alias_flags_BSAlias5 = 0; - QualifiedTypeName type_name_BSAlias5 = "BSAlias5"; - eprosima::fastcdr::optional type_ann_builtin_BSAlias5; - eprosima::fastcdr::optional ann_custom_BSAlias5; - CompleteTypeDetail detail_BSAlias5 = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_BSAlias5, ann_custom_BSAlias5, type_name_BSAlias5.to_string()); - CompleteAliasHeader header_BSAlias5 = TypeObjectUtils::build_complete_alias_header(detail_BSAlias5); - AliasMemberFlag related_flags_BSAlias5 = 0; - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_array_BasicStruct_5", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "BasicStruct", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - { - StructTypeFlag struct_flags_BasicStruct = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_BasicStruct; - TypeIdentifierPair type_ids_BasicStruct; - QualifiedTypeName type_name_BasicStruct = "BasicStruct"; - eprosima::fastcdr::optional type_ann_builtin_BasicStruct; - eprosima::fastcdr::optional ann_custom_BasicStruct; - CompleteTypeDetail detail_BasicStruct = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_BasicStruct, ann_custom_BasicStruct, type_name_BasicStruct.to_string()); - CompleteStructHeader header_BasicStruct; - header_BasicStruct = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_BasicStruct); - CompleteStructMemberSeq member_seq_BasicStruct; - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_bool", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_bool Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_bool = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_bool; - MemberId member_id_my_bool = 0x00000000; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_bool = TypeObjectUtils::build_common_struct_member(member_id_my_bool, member_flags_my_bool, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_bool = TypeObjectUtils::build_common_struct_member(member_id_my_bool, member_flags_my_bool, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_bool member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_bool = "my_bool"; - eprosima::fastcdr::optional member_ann_builtin_my_bool; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_bool = TypeObjectUtils::build_complete_member_detail(name_my_bool, member_ann_builtin_my_bool, ann_custom_BasicStruct); - CompleteStructMember member_my_bool = TypeObjectUtils::build_complete_struct_member(common_my_bool, detail_my_bool); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_bool); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_byte", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_octet Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_octet = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_octet; - MemberId member_id_my_octet = 0x00000001; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_octet = TypeObjectUtils::build_common_struct_member(member_id_my_octet, member_flags_my_octet, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_octet = TypeObjectUtils::build_common_struct_member(member_id_my_octet, member_flags_my_octet, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_octet member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_octet = "my_octet"; - eprosima::fastcdr::optional member_ann_builtin_my_octet; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_octet = TypeObjectUtils::build_complete_member_detail(name_my_octet, member_ann_builtin_my_octet, ann_custom_BasicStruct); - CompleteStructMember member_my_octet = TypeObjectUtils::build_complete_struct_member(common_my_octet, detail_my_octet); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_octet); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int16_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_int16 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_int16 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_int16; - MemberId member_id_my_int16 = 0x00000002; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_int16 = TypeObjectUtils::build_common_struct_member(member_id_my_int16, member_flags_my_int16, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_int16 = TypeObjectUtils::build_common_struct_member(member_id_my_int16, member_flags_my_int16, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_int16 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_int16 = "my_int16"; - eprosima::fastcdr::optional member_ann_builtin_my_int16; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_int16 = TypeObjectUtils::build_complete_member_detail(name_my_int16, member_ann_builtin_my_int16, ann_custom_BasicStruct); - CompleteStructMember member_my_int16 = TypeObjectUtils::build_complete_struct_member(common_my_int16, detail_my_int16); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_int16); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_int32 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_int32 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_int32; - MemberId member_id_my_int32 = 0x00000003; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_int32 = TypeObjectUtils::build_common_struct_member(member_id_my_int32, member_flags_my_int32, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_int32 = TypeObjectUtils::build_common_struct_member(member_id_my_int32, member_flags_my_int32, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_int32 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_int32 = "my_int32"; - eprosima::fastcdr::optional member_ann_builtin_my_int32; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_int32 = TypeObjectUtils::build_complete_member_detail(name_my_int32, member_ann_builtin_my_int32, ann_custom_BasicStruct); - CompleteStructMember member_my_int32 = TypeObjectUtils::build_complete_struct_member(common_my_int32, detail_my_int32); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_int32); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int64_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_int64 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_int64 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_int64; - MemberId member_id_my_int64 = 0x00000004; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_int64 = TypeObjectUtils::build_common_struct_member(member_id_my_int64, member_flags_my_int64, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_int64 = TypeObjectUtils::build_common_struct_member(member_id_my_int64, member_flags_my_int64, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_int64 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_int64 = "my_int64"; - eprosima::fastcdr::optional member_ann_builtin_my_int64; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_int64 = TypeObjectUtils::build_complete_member_detail(name_my_int64, member_ann_builtin_my_int64, ann_custom_BasicStruct); - CompleteStructMember member_my_int64 = TypeObjectUtils::build_complete_struct_member(common_my_int64, detail_my_int64); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_int64); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_uint16_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_uint16 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_uint16 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_uint16; - MemberId member_id_my_uint16 = 0x00000005; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_uint16 = TypeObjectUtils::build_common_struct_member(member_id_my_uint16, member_flags_my_uint16, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_uint16 = TypeObjectUtils::build_common_struct_member(member_id_my_uint16, member_flags_my_uint16, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_uint16 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_uint16 = "my_uint16"; - eprosima::fastcdr::optional member_ann_builtin_my_uint16; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_uint16 = TypeObjectUtils::build_complete_member_detail(name_my_uint16, member_ann_builtin_my_uint16, ann_custom_BasicStruct); - CompleteStructMember member_my_uint16 = TypeObjectUtils::build_complete_struct_member(common_my_uint16, detail_my_uint16); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_uint16); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_uint32_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_uint32 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_uint32 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_uint32; - MemberId member_id_my_uint32 = 0x00000006; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_uint32 = TypeObjectUtils::build_common_struct_member(member_id_my_uint32, member_flags_my_uint32, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_uint32 = TypeObjectUtils::build_common_struct_member(member_id_my_uint32, member_flags_my_uint32, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_uint32 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_uint32 = "my_uint32"; - eprosima::fastcdr::optional member_ann_builtin_my_uint32; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_uint32 = TypeObjectUtils::build_complete_member_detail(name_my_uint32, member_ann_builtin_my_uint32, ann_custom_BasicStruct); - CompleteStructMember member_my_uint32 = TypeObjectUtils::build_complete_struct_member(common_my_uint32, detail_my_uint32); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_uint32); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_uint64_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_uint64 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_uint64 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_uint64; - MemberId member_id_my_uint64 = 0x00000007; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_uint64 = TypeObjectUtils::build_common_struct_member(member_id_my_uint64, member_flags_my_uint64, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_uint64 = TypeObjectUtils::build_common_struct_member(member_id_my_uint64, member_flags_my_uint64, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_uint64 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_uint64 = "my_uint64"; - eprosima::fastcdr::optional member_ann_builtin_my_uint64; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_uint64 = TypeObjectUtils::build_complete_member_detail(name_my_uint64, member_ann_builtin_my_uint64, ann_custom_BasicStruct); - CompleteStructMember member_my_uint64 = TypeObjectUtils::build_complete_struct_member(common_my_uint64, detail_my_uint64); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_uint64); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_float", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_float32 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_float32 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_float32; - MemberId member_id_my_float32 = 0x00000008; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_float32 = TypeObjectUtils::build_common_struct_member(member_id_my_float32, member_flags_my_float32, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_float32 = TypeObjectUtils::build_common_struct_member(member_id_my_float32, member_flags_my_float32, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_float32 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_float32 = "my_float32"; - eprosima::fastcdr::optional member_ann_builtin_my_float32; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_float32 = TypeObjectUtils::build_complete_member_detail(name_my_float32, member_ann_builtin_my_float32, ann_custom_BasicStruct); - CompleteStructMember member_my_float32 = TypeObjectUtils::build_complete_struct_member(common_my_float32, detail_my_float32); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_float32); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_double", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_float64 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_float64 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_float64; - MemberId member_id_my_float64 = 0x00000009; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_float64 = TypeObjectUtils::build_common_struct_member(member_id_my_float64, member_flags_my_float64, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_float64 = TypeObjectUtils::build_common_struct_member(member_id_my_float64, member_flags_my_float64, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_float64 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_float64 = "my_float64"; - eprosima::fastcdr::optional member_ann_builtin_my_float64; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_float64 = TypeObjectUtils::build_complete_member_detail(name_my_float64, member_ann_builtin_my_float64, ann_custom_BasicStruct); - CompleteStructMember member_my_float64 = TypeObjectUtils::build_complete_struct_member(common_my_float64, detail_my_float64); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_float64); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_longdouble", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_float128 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_float128 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_float128; - MemberId member_id_my_float128 = 0x0000000a; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_float128 = TypeObjectUtils::build_common_struct_member(member_id_my_float128, member_flags_my_float128, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_float128 = TypeObjectUtils::build_common_struct_member(member_id_my_float128, member_flags_my_float128, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_float128 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_float128 = "my_float128"; - eprosima::fastcdr::optional member_ann_builtin_my_float128; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_float128 = TypeObjectUtils::build_complete_member_detail(name_my_float128, member_ann_builtin_my_float128, ann_custom_BasicStruct); - CompleteStructMember member_my_float128 = TypeObjectUtils::build_complete_struct_member(common_my_float128, detail_my_float128); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_float128); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_char", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_char Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_char = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_char; - MemberId member_id_my_char = 0x0000000b; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_char = TypeObjectUtils::build_common_struct_member(member_id_my_char, member_flags_my_char, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_char = TypeObjectUtils::build_common_struct_member(member_id_my_char, member_flags_my_char, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_char member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_char = "my_char"; - eprosima::fastcdr::optional member_ann_builtin_my_char; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_char = TypeObjectUtils::build_complete_member_detail(name_my_char, member_ann_builtin_my_char, ann_custom_BasicStruct); - CompleteStructMember member_my_char = TypeObjectUtils::build_complete_struct_member(common_my_char, detail_my_char); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_char); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_string_unbounded", type_ids_BasicStruct); - - if (return_code_BasicStruct != 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_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_string_unbounded", type_ids_BasicStruct); - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_string_unbounded: Given String TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_string = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_string; - MemberId member_id_my_string = 0x0000000c; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_string = TypeObjectUtils::build_common_struct_member(member_id_my_string, member_flags_my_string, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_string = TypeObjectUtils::build_common_struct_member(member_id_my_string, member_flags_my_string, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_string member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_string = "my_string"; - eprosima::fastcdr::optional member_ann_builtin_my_string; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_string = TypeObjectUtils::build_complete_member_detail(name_my_string, member_ann_builtin_my_string, ann_custom_BasicStruct); - CompleteStructMember member_my_string = TypeObjectUtils::build_complete_struct_member(common_my_string, detail_my_string); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_string); - } - CompleteStructType struct_type_BasicStruct = TypeObjectUtils::build_complete_struct_type(struct_flags_BasicStruct, header_BasicStruct, member_seq_BasicStruct); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_BasicStruct, type_name_BasicStruct.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "BasicStruct already registered in TypeObjectRegistry for a different type."); - } - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "BasicStruct", type_ids_BasicStruct); - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "BasicStruct: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - } - TypeIdentifier* element_identifier_anonymous_array_BasicStruct_5 {nullptr}; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_array_BasicStruct_5 = new TypeIdentifier(type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_array_BasicStruct_5 = new TypeIdentifier(type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Array element TypeIdentifier inconsistent."); - return; - } - EquivalenceKind equiv_kind_anonymous_array_BasicStruct_5 = EK_COMPLETE; - if (TK_NONE == type_ids_ComplexStruct.type_identifier2()._d()) - { - equiv_kind_anonymous_array_BasicStruct_5 = EK_BOTH; - } - CollectionElementFlag element_flags_anonymous_array_BasicStruct_5 = 0; - PlainCollectionHeader header_anonymous_array_BasicStruct_5 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_BasicStruct_5, element_flags_anonymous_array_BasicStruct_5); - std::string type_id_kind_anonymous_array_BasicStruct_5("TI_PLAIN_ARRAY_SMALL"); - if (type_id_kind_anonymous_array_BasicStruct_5 == "TI_PLAIN_ARRAY_SMALL") - { - SBoundSeq array_bound_seq; - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(5)); - - PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_BasicStruct_5, array_bound_seq, - eprosima::fastcdr::external(element_identifier_anonymous_array_BasicStruct_5)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_BasicStruct_5")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_BasicStruct_5 already registered in TypeObjectRegistry for a different type."); - } - } - else - { - LBoundSeq array_bound_seq; - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(5)); - - PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_BasicStruct_5, array_bound_seq, - eprosima::fastcdr::external(element_identifier_anonymous_array_BasicStruct_5)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_BasicStruct_5")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_BasicStruct_5 already registered in TypeObjectRegistry for a different type."); - } - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_array_BasicStruct_5", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_BasicStruct_5: Given Array TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - CommonAliasBody common_BSAlias5; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_BSAlias5 = TypeObjectUtils::build_common_alias_body(related_flags_BSAlias5, type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_BSAlias5 = TypeObjectUtils::build_common_alias_body(related_flags_BSAlias5, type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "BSAlias5 related TypeIdentifier inconsistent."); - return; - } - eprosima::fastcdr::optional member_ann_builtin_BSAlias5; - ann_custom_BSAlias5.reset(); - CompleteAliasBody body_BSAlias5 = TypeObjectUtils::build_complete_alias_body(common_BSAlias5, member_ann_builtin_BSAlias5, ann_custom_BSAlias5); - CompleteAliasType alias_type_BSAlias5 = TypeObjectUtils::build_complete_alias_type(alias_flags_BSAlias5, header_BSAlias5, body_BSAlias5); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_alias_type_object(alias_type_BSAlias5, type_name_BSAlias5.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "BSAlias5 already registered in TypeObjectRegistry for a different type."); - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "BSAlias5", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "BSAlias5: Given Alias TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - TypeIdentifier* element_identifier_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded {nullptr}; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded = new TypeIdentifier(type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded = new TypeIdentifier(type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded inconsistent element TypeIdentifier."); - return; - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_byte", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Map key TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - TypeIdentifier* key_identifier_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded {nullptr}; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - key_identifier_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded = new TypeIdentifier(type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - key_identifier_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded = new TypeIdentifier(type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded inconsistent key TypeIdentifier."); - return; - } - EquivalenceKind equiv_kind_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded = EK_BOTH; - if ((EK_COMPLETE == key_identifier_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded->_d() || EK_COMPLETE == element_identifier_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded->_d()) || - (TI_PLAIN_SEQUENCE_SMALL == element_identifier_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded->_d() && EK_COMPLETE == element_identifier_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded->seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == element_identifier_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded->_d() && EK_COMPLETE == element_identifier_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded->seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == element_identifier_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded->_d() && EK_COMPLETE == element_identifier_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded->array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == element_identifier_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded->_d() && EK_COMPLETE == element_identifier_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded->array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == element_identifier_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded->_d() && (EK_COMPLETE == element_identifier_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded->map_sdefn().key_identifier()->_d() || EK_COMPLETE == element_identifier_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded->map_sdefn().header().equiv_kind())) || - (TI_PLAIN_MAP_LARGE == element_identifier_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded->_d() && (EK_COMPLETE == element_identifier_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded->map_ldefn().key_identifier()->_d() || EK_COMPLETE == element_identifier_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded->map_ldefn().header().equiv_kind()))) - { - equiv_kind_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded = EK_COMPLETE; - } - CollectionElementFlag element_flags_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded = 0; - CollectionElementFlag key_flags_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded = 0; - PlainCollectionHeader header_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded, element_flags_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded); - std::string type_id_kind_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded("TI_PLAIN_MAP_SMALL"); - if (type_id_kind_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded == "TI_PLAIN_MAP_SMALL") - { - SBound bound = 0; - PlainMapSTypeDefn map_sdefn = TypeObjectUtils::build_plain_map_s_type_defn(header_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded, bound, - eprosima::fastcdr::external(element_identifier_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded), key_flags_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded, - eprosima::fastcdr::external(key_identifier_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_s_map_type_identifier(map_sdefn, "anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded already registered in TypeObjectRegistry for a different type."); - } - } - else - { - LBound bound = 0; - PlainMapLTypeDefn map_ldefn = TypeObjectUtils::build_plain_map_l_type_defn(header_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded, bound, - eprosima::fastcdr::external(element_identifier_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded), key_flags_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded, - eprosima::fastcdr::external(key_identifier_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_l_map_type_identifier(map_ldefn, "anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded already registered in TypeObjectRegistry for a different type."); - } - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded: Given Map TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - TypeIdentifier* element_identifier_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded {nullptr}; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded = new TypeIdentifier(type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded = new TypeIdentifier(type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded inconsistent element TypeIdentifier."); - return; - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Map key TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - TypeIdentifier* key_identifier_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded {nullptr}; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - key_identifier_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded = new TypeIdentifier(type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - key_identifier_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded = new TypeIdentifier(type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded inconsistent key TypeIdentifier."); - return; - } - EquivalenceKind equiv_kind_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded = EK_BOTH; - if ((EK_COMPLETE == key_identifier_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded->_d() || EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded->_d()) || - (TI_PLAIN_SEQUENCE_SMALL == element_identifier_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded->_d() && EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded->seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == element_identifier_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded->_d() && EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded->seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == element_identifier_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded->_d() && EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded->array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == element_identifier_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded->_d() && EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded->array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == element_identifier_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded->_d() && (EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded->map_sdefn().key_identifier()->_d() || EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded->map_sdefn().header().equiv_kind())) || - (TI_PLAIN_MAP_LARGE == element_identifier_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded->_d() && (EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded->map_ldefn().key_identifier()->_d() || EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded->map_ldefn().header().equiv_kind()))) - { - equiv_kind_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded = EK_COMPLETE; - } - CollectionElementFlag element_flags_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded = 0; - CollectionElementFlag key_flags_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded = 0; - PlainCollectionHeader header_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded, element_flags_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded); - std::string type_id_kind_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded("TI_PLAIN_MAP_SMALL"); - if (type_id_kind_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded == "TI_PLAIN_MAP_SMALL") - { - SBound bound = 0; - PlainMapSTypeDefn map_sdefn = TypeObjectUtils::build_plain_map_s_type_defn(header_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded, bound, - eprosima::fastcdr::external(element_identifier_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded), key_flags_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded, - eprosima::fastcdr::external(key_identifier_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_s_map_type_identifier(map_sdefn, "anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded already registered in TypeObjectRegistry for a different type."); - } - } - else - { - LBound bound = 0; - PlainMapLTypeDefn map_ldefn = TypeObjectUtils::build_plain_map_l_type_defn(header_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded, bound, - eprosima::fastcdr::external(element_identifier_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded), key_flags_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded, - eprosima::fastcdr::external(key_identifier_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_l_map_type_identifier(map_ldefn, "anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded already registered in TypeObjectRegistry for a different type."); - } - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded: Given Map TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_map_long_lol_type = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_map_long_lol_type; - MemberId member_id_my_map_long_lol_type = 0x0000000d; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_map_long_lol_type = TypeObjectUtils::build_common_struct_member(member_id_my_map_long_lol_type, member_flags_my_map_long_lol_type, type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_map_long_lol_type = TypeObjectUtils::build_common_struct_member(member_id_my_map_long_lol_type, member_flags_my_map_long_lol_type, type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_map_long_lol_type member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_map_long_lol_type = "my_map_long_lol_type"; - eprosima::fastcdr::optional member_ann_builtin_my_map_long_lol_type; - ann_custom_ComplexStruct.reset(); - CompleteMemberDetail detail_my_map_long_lol_type = TypeObjectUtils::build_complete_member_detail(name_my_map_long_lol_type, member_ann_builtin_my_map_long_lol_type, ann_custom_ComplexStruct); - CompleteStructMember member_my_map_long_lol_type = TypeObjectUtils::build_complete_struct_member(common_my_map_long_lol_type, detail_my_map_long_lol_type); - TypeObjectUtils::add_complete_struct_member(member_seq_ComplexStruct, member_my_map_long_lol_type); - } - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_string_128", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - std::string type_id_kind_anonymous_string_128("TI_STRING8_SMALL"); - if (type_id_kind_anonymous_string_128 == "TI_STRING8_SMALL") - { - SBound bound = static_cast(128); - 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_128")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_string_128 already registered in TypeObjectRegistry for a different type."); - } - } - else if (type_id_kind_anonymous_string_128 == "TI_STRING8_LARGE") - { - LBound bound = 128; - 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_128")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_string_128 already registered in TypeObjectRegistry for a different type."); - } - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_string_128: Unknown String kind."); - return; - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_string_128", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_string_128: Given String TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_small_string_8 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_small_string_8; - MemberId member_id_my_small_string_8 = 0x0000000e; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_small_string_8 = TypeObjectUtils::build_common_struct_member(member_id_my_small_string_8, member_flags_my_small_string_8, type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_small_string_8 = TypeObjectUtils::build_common_struct_member(member_id_my_small_string_8, member_flags_my_small_string_8, type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_small_string_8 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_small_string_8 = "my_small_string_8"; - eprosima::fastcdr::optional member_ann_builtin_my_small_string_8; - ann_custom_ComplexStruct.reset(); - CompleteMemberDetail detail_my_small_string_8 = TypeObjectUtils::build_complete_member_detail(name_my_small_string_8, member_ann_builtin_my_small_string_8, ann_custom_ComplexStruct); - CompleteStructMember member_my_small_string_8 = TypeObjectUtils::build_complete_struct_member(common_my_small_string_8, detail_my_small_string_8); - TypeObjectUtils::add_complete_struct_member(member_seq_ComplexStruct, member_my_small_string_8); - } - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_string_500", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - std::string type_id_kind_anonymous_string_500("TI_STRING8_LARGE"); - if (type_id_kind_anonymous_string_500 == "TI_STRING8_SMALL") - { - SBound bound = static_cast(500); - 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_500")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_string_500 already registered in TypeObjectRegistry for a different type."); - } - } - else if (type_id_kind_anonymous_string_500 == "TI_STRING8_LARGE") - { - LBound bound = 500; - 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_500")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_string_500 already registered in TypeObjectRegistry for a different type."); - } - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_string_500: Unknown String kind."); - return; - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_string_500", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_string_500: Given String TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_large_string_8 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_large_string_8; - MemberId member_id_my_large_string_8 = 0x0000000f; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_large_string_8 = TypeObjectUtils::build_common_struct_member(member_id_my_large_string_8, member_flags_my_large_string_8, type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_large_string_8 = TypeObjectUtils::build_common_struct_member(member_id_my_large_string_8, member_flags_my_large_string_8, type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_large_string_8 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_large_string_8 = "my_large_string_8"; - eprosima::fastcdr::optional member_ann_builtin_my_large_string_8; - ann_custom_ComplexStruct.reset(); - CompleteMemberDetail detail_my_large_string_8 = TypeObjectUtils::build_complete_member_detail(name_my_large_string_8, member_ann_builtin_my_large_string_8, ann_custom_ComplexStruct); - CompleteStructMember member_my_large_string_8 = TypeObjectUtils::build_complete_struct_member(common_my_large_string_8, detail_my_large_string_8); - TypeObjectUtils::add_complete_struct_member(member_seq_ComplexStruct, member_my_large_string_8); - } - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_array_anonymous_string_75_5_5", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_string_75", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - std::string type_id_kind_anonymous_string_75("TI_STRING8_SMALL"); - if (type_id_kind_anonymous_string_75 == "TI_STRING8_SMALL") - { - SBound bound = static_cast(75); - 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_75")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_string_75 already registered in TypeObjectRegistry for a different type."); - } - } - else if (type_id_kind_anonymous_string_75 == "TI_STRING8_LARGE") - { - LBound bound = 75; - 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_75")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_string_75 already registered in TypeObjectRegistry for a different type."); - } - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_string_75: Unknown String kind."); - return; - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_string_75", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_string_75: Given String TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - TypeIdentifier* element_identifier_anonymous_array_anonymous_string_75_5_5 {nullptr}; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_array_anonymous_string_75_5_5 = new TypeIdentifier(type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_array_anonymous_string_75_5_5 = new TypeIdentifier(type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Array element TypeIdentifier inconsistent."); - return; - } - EquivalenceKind equiv_kind_anonymous_array_anonymous_string_75_5_5 = EK_COMPLETE; - if (TK_NONE == type_ids_ComplexStruct.type_identifier2()._d()) - { - equiv_kind_anonymous_array_anonymous_string_75_5_5 = EK_BOTH; - } - CollectionElementFlag element_flags_anonymous_array_anonymous_string_75_5_5 = 0; - PlainCollectionHeader header_anonymous_array_anonymous_string_75_5_5 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_anonymous_string_75_5_5, element_flags_anonymous_array_anonymous_string_75_5_5); - std::string type_id_kind_anonymous_array_anonymous_string_75_5_5("TI_PLAIN_ARRAY_SMALL"); - if (type_id_kind_anonymous_array_anonymous_string_75_5_5 == "TI_PLAIN_ARRAY_SMALL") - { - SBoundSeq array_bound_seq; - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(5)); - - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(5)); - - PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_anonymous_string_75_5_5, array_bound_seq, - eprosima::fastcdr::external(element_identifier_anonymous_array_anonymous_string_75_5_5)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_anonymous_string_75_5_5")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_anonymous_string_75_5_5 already registered in TypeObjectRegistry for a different type."); - } - } - else - { - LBoundSeq array_bound_seq; - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(5)); - - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(5)); - - PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_anonymous_string_75_5_5, array_bound_seq, - eprosima::fastcdr::external(element_identifier_anonymous_array_anonymous_string_75_5_5)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_anonymous_string_75_5_5")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_anonymous_string_75_5_5 already registered in TypeObjectRegistry for a different type."); - } - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_array_anonymous_string_75_5_5", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_anonymous_string_75_5_5: Given Array TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_array_string = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_array_string; - MemberId member_id_my_array_string = 0x00000010; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_array_string = TypeObjectUtils::build_common_struct_member(member_id_my_array_string, member_flags_my_array_string, type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_array_string = TypeObjectUtils::build_common_struct_member(member_id_my_array_string, member_flags_my_array_string, type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_array_string member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_array_string = "my_array_string"; - eprosima::fastcdr::optional member_ann_builtin_my_array_string; - ann_custom_ComplexStruct.reset(); - CompleteMemberDetail detail_my_array_string = TypeObjectUtils::build_complete_member_detail(name_my_array_string, member_ann_builtin_my_array_string, ann_custom_ComplexStruct); - CompleteStructMember member_my_array_string = TypeObjectUtils::build_complete_struct_member(common_my_array_string, detail_my_array_string); - TypeObjectUtils::add_complete_struct_member(member_seq_ComplexStruct, member_my_array_string); - } - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MA3", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - AliasTypeFlag alias_flags_MA3 = 0; - QualifiedTypeName type_name_MA3 = "MA3"; - eprosima::fastcdr::optional type_ann_builtin_MA3; - eprosima::fastcdr::optional ann_custom_MA3; - CompleteTypeDetail detail_MA3 = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_MA3, ann_custom_MA3, type_name_MA3.to_string()); - CompleteAliasHeader header_MA3 = TypeObjectUtils::build_complete_alias_header(detail_MA3); - AliasMemberFlag related_flags_MA3 = 0; - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_array_MyAliasEnum3_42", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyAliasEnum3", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - AliasTypeFlag alias_flags_MyAliasEnum3 = 0; - QualifiedTypeName type_name_MyAliasEnum3 = "MyAliasEnum3"; - eprosima::fastcdr::optional type_ann_builtin_MyAliasEnum3; - eprosima::fastcdr::optional ann_custom_MyAliasEnum3; - CompleteTypeDetail detail_MyAliasEnum3 = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_MyAliasEnum3, ann_custom_MyAliasEnum3, type_name_MyAliasEnum3.to_string()); - CompleteAliasHeader header_MyAliasEnum3 = TypeObjectUtils::build_complete_alias_header(detail_MyAliasEnum3); - AliasMemberFlag related_flags_MyAliasEnum3 = 0; - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyAliasEnum2", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - AliasTypeFlag alias_flags_MyAliasEnum2 = 0; - QualifiedTypeName type_name_MyAliasEnum2 = "MyAliasEnum2"; - eprosima::fastcdr::optional type_ann_builtin_MyAliasEnum2; - eprosima::fastcdr::optional ann_custom_MyAliasEnum2; - CompleteTypeDetail detail_MyAliasEnum2 = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_MyAliasEnum2, ann_custom_MyAliasEnum2, type_name_MyAliasEnum2.to_string()); - CompleteAliasHeader header_MyAliasEnum2 = TypeObjectUtils::build_complete_alias_header(detail_MyAliasEnum2); - AliasMemberFlag related_flags_MyAliasEnum2 = 0; - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyAliasEnum", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - AliasTypeFlag alias_flags_MyAliasEnum = 0; - QualifiedTypeName type_name_MyAliasEnum = "MyAliasEnum"; - eprosima::fastcdr::optional type_ann_builtin_MyAliasEnum; - eprosima::fastcdr::optional ann_custom_MyAliasEnum; - CompleteTypeDetail detail_MyAliasEnum = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_MyAliasEnum, ann_custom_MyAliasEnum, type_name_MyAliasEnum.to_string()); - CompleteAliasHeader header_MyAliasEnum = TypeObjectUtils::build_complete_alias_header(detail_MyAliasEnum); - AliasMemberFlag related_flags_MyAliasEnum = 0; - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyEnum", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EnumTypeFlag enum_flags_MyEnum = 0; - BitBound bit_bound_MyEnum = 32; - CommonEnumeratedHeader common_MyEnum = TypeObjectUtils::build_common_enumerated_header(bit_bound_MyEnum); - QualifiedTypeName type_name_MyEnum = "MyEnum"; - eprosima::fastcdr::optional type_ann_builtin_MyEnum; - eprosima::fastcdr::optional ann_custom_MyEnum; - CompleteTypeDetail detail_MyEnum = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_MyEnum, ann_custom_MyEnum, type_name_MyEnum.to_string()); - CompleteEnumeratedHeader header_MyEnum = TypeObjectUtils::build_complete_enumerated_header(common_MyEnum, detail_MyEnum); - CompleteEnumeratedLiteralSeq literal_seq_MyEnum; - { - EnumeratedLiteralFlag flags_A = TypeObjectUtils::build_enumerated_literal_flag(false); - CommonEnumeratedLiteral common_A = TypeObjectUtils::build_common_enumerated_literal(0, flags_A); - eprosima::fastcdr::optional member_ann_builtin_A; - ann_custom_MyEnum.reset(); - MemberName name_A = "A"; - CompleteMemberDetail detail_A = TypeObjectUtils::build_complete_member_detail(name_A, member_ann_builtin_A, ann_custom_MyEnum); - CompleteEnumeratedLiteral literal_A = TypeObjectUtils::build_complete_enumerated_literal(common_A, detail_A); - TypeObjectUtils::add_complete_enumerated_literal(literal_seq_MyEnum, literal_A); - } - { - EnumeratedLiteralFlag flags_B = TypeObjectUtils::build_enumerated_literal_flag(false); - CommonEnumeratedLiteral common_B = TypeObjectUtils::build_common_enumerated_literal(1, flags_B); - eprosima::fastcdr::optional member_ann_builtin_B; - ann_custom_MyEnum.reset(); - MemberName name_B = "B"; - CompleteMemberDetail detail_B = TypeObjectUtils::build_complete_member_detail(name_B, member_ann_builtin_B, ann_custom_MyEnum); - CompleteEnumeratedLiteral literal_B = TypeObjectUtils::build_complete_enumerated_literal(common_B, detail_B); - TypeObjectUtils::add_complete_enumerated_literal(literal_seq_MyEnum, literal_B); - } - { - EnumeratedLiteralFlag flags_C = TypeObjectUtils::build_enumerated_literal_flag(false); - CommonEnumeratedLiteral common_C = TypeObjectUtils::build_common_enumerated_literal(2, flags_C); - eprosima::fastcdr::optional member_ann_builtin_C; - ann_custom_MyEnum.reset(); - MemberName name_C = "C"; - CompleteMemberDetail detail_C = TypeObjectUtils::build_complete_member_detail(name_C, member_ann_builtin_C, ann_custom_MyEnum); - CompleteEnumeratedLiteral literal_C = TypeObjectUtils::build_complete_enumerated_literal(common_C, detail_C); - TypeObjectUtils::add_complete_enumerated_literal(literal_seq_MyEnum, literal_C); - } - CompleteEnumeratedType enumerated_type_MyEnum = TypeObjectUtils::build_complete_enumerated_type(enum_flags_MyEnum, header_MyEnum, - literal_seq_MyEnum); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_enumerated_type_object(enumerated_type_MyEnum, type_name_MyEnum.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyEnum already registered in TypeObjectRegistry for a different type."); - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyEnum", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyEnum: Given Enum TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - CommonAliasBody common_MyAliasEnum; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_MyAliasEnum = TypeObjectUtils::build_common_alias_body(related_flags_MyAliasEnum, type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_MyAliasEnum = TypeObjectUtils::build_common_alias_body(related_flags_MyAliasEnum, type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyAliasEnum related TypeIdentifier inconsistent."); - return; - } - eprosima::fastcdr::optional member_ann_builtin_MyAliasEnum; - ann_custom_MyAliasEnum.reset(); - CompleteAliasBody body_MyAliasEnum = TypeObjectUtils::build_complete_alias_body(common_MyAliasEnum, member_ann_builtin_MyAliasEnum, ann_custom_MyAliasEnum); - CompleteAliasType alias_type_MyAliasEnum = TypeObjectUtils::build_complete_alias_type(alias_flags_MyAliasEnum, header_MyAliasEnum, body_MyAliasEnum); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_alias_type_object(alias_type_MyAliasEnum, type_name_MyAliasEnum.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyAliasEnum already registered in TypeObjectRegistry for a different type."); - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyAliasEnum", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyAliasEnum: Given Alias TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - CommonAliasBody common_MyAliasEnum2; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_MyAliasEnum2 = TypeObjectUtils::build_common_alias_body(related_flags_MyAliasEnum2, type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_MyAliasEnum2 = TypeObjectUtils::build_common_alias_body(related_flags_MyAliasEnum2, type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyAliasEnum2 related TypeIdentifier inconsistent."); - return; - } - eprosima::fastcdr::optional member_ann_builtin_MyAliasEnum2; - ann_custom_MyAliasEnum2.reset(); - CompleteAliasBody body_MyAliasEnum2 = TypeObjectUtils::build_complete_alias_body(common_MyAliasEnum2, member_ann_builtin_MyAliasEnum2, ann_custom_MyAliasEnum2); - CompleteAliasType alias_type_MyAliasEnum2 = TypeObjectUtils::build_complete_alias_type(alias_flags_MyAliasEnum2, header_MyAliasEnum2, body_MyAliasEnum2); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_alias_type_object(alias_type_MyAliasEnum2, type_name_MyAliasEnum2.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyAliasEnum2 already registered in TypeObjectRegistry for a different type."); - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyAliasEnum2", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyAliasEnum2: Given Alias TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - CommonAliasBody common_MyAliasEnum3; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_MyAliasEnum3 = TypeObjectUtils::build_common_alias_body(related_flags_MyAliasEnum3, type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_MyAliasEnum3 = TypeObjectUtils::build_common_alias_body(related_flags_MyAliasEnum3, type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyAliasEnum3 related TypeIdentifier inconsistent."); - return; - } - eprosima::fastcdr::optional member_ann_builtin_MyAliasEnum3; - ann_custom_MyAliasEnum3.reset(); - CompleteAliasBody body_MyAliasEnum3 = TypeObjectUtils::build_complete_alias_body(common_MyAliasEnum3, member_ann_builtin_MyAliasEnum3, ann_custom_MyAliasEnum3); - CompleteAliasType alias_type_MyAliasEnum3 = TypeObjectUtils::build_complete_alias_type(alias_flags_MyAliasEnum3, header_MyAliasEnum3, body_MyAliasEnum3); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_alias_type_object(alias_type_MyAliasEnum3, type_name_MyAliasEnum3.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyAliasEnum3 already registered in TypeObjectRegistry for a different type."); - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyAliasEnum3", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyAliasEnum3: Given Alias TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - TypeIdentifier* element_identifier_anonymous_array_MyAliasEnum3_42 {nullptr}; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_array_MyAliasEnum3_42 = new TypeIdentifier(type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_array_MyAliasEnum3_42 = new TypeIdentifier(type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Array element TypeIdentifier inconsistent."); - return; - } - EquivalenceKind equiv_kind_anonymous_array_MyAliasEnum3_42 = EK_COMPLETE; - if (TK_NONE == type_ids_ComplexStruct.type_identifier2()._d()) - { - equiv_kind_anonymous_array_MyAliasEnum3_42 = EK_BOTH; - } - CollectionElementFlag element_flags_anonymous_array_MyAliasEnum3_42 = 0; - PlainCollectionHeader header_anonymous_array_MyAliasEnum3_42 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_MyAliasEnum3_42, element_flags_anonymous_array_MyAliasEnum3_42); - std::string type_id_kind_anonymous_array_MyAliasEnum3_42("TI_PLAIN_ARRAY_SMALL"); - if (type_id_kind_anonymous_array_MyAliasEnum3_42 == "TI_PLAIN_ARRAY_SMALL") - { - SBoundSeq array_bound_seq; - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(42)); - - PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_MyAliasEnum3_42, array_bound_seq, - eprosima::fastcdr::external(element_identifier_anonymous_array_MyAliasEnum3_42)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_MyAliasEnum3_42")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_MyAliasEnum3_42 already registered in TypeObjectRegistry for a different type."); - } - } - else - { - LBoundSeq array_bound_seq; - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(42)); - - PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_MyAliasEnum3_42, array_bound_seq, - eprosima::fastcdr::external(element_identifier_anonymous_array_MyAliasEnum3_42)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_MyAliasEnum3_42")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_MyAliasEnum3_42 already registered in TypeObjectRegistry for a different type."); - } - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_array_MyAliasEnum3_42", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_MyAliasEnum3_42: Given Array TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - CommonAliasBody common_MA3; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_MA3 = TypeObjectUtils::build_common_alias_body(related_flags_MA3, type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_MA3 = TypeObjectUtils::build_common_alias_body(related_flags_MA3, type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MA3 related TypeIdentifier inconsistent."); - return; - } - eprosima::fastcdr::optional member_ann_builtin_MA3; - ann_custom_MA3.reset(); - CompleteAliasBody body_MA3 = TypeObjectUtils::build_complete_alias_body(common_MA3, member_ann_builtin_MA3, ann_custom_MA3); - CompleteAliasType alias_type_MA3 = TypeObjectUtils::build_complete_alias_type(alias_flags_MA3, header_MA3, body_MA3); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_alias_type_object(alias_type_MA3, type_name_MA3.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MA3 already registered in TypeObjectRegistry for a different type."); - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MA3", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MA3: Given Alias TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_multi_alias_array_42 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_multi_alias_array_42; - MemberId member_id_multi_alias_array_42 = 0x00000011; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_multi_alias_array_42 = TypeObjectUtils::build_common_struct_member(member_id_multi_alias_array_42, member_flags_multi_alias_array_42, type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_multi_alias_array_42 = TypeObjectUtils::build_common_struct_member(member_id_multi_alias_array_42, member_flags_multi_alias_array_42, type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure multi_alias_array_42 member TypeIdentifier inconsistent."); - return; - } - MemberName name_multi_alias_array_42 = "multi_alias_array_42"; - eprosima::fastcdr::optional member_ann_builtin_multi_alias_array_42; - ann_custom_ComplexStruct.reset(); - CompleteMemberDetail detail_multi_alias_array_42 = TypeObjectUtils::build_complete_member_detail(name_multi_alias_array_42, member_ann_builtin_multi_alias_array_42, ann_custom_ComplexStruct); - CompleteStructMember member_multi_alias_array_42 = TypeObjectUtils::build_complete_struct_member(common_multi_alias_array_42, detail_multi_alias_array_42); - TypeObjectUtils::add_complete_struct_member(member_seq_ComplexStruct, member_multi_alias_array_42); - } - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_array_anonymous_array_int32_t_2_5", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyMiniArray", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - AliasTypeFlag alias_flags_MyMiniArray = 0; - QualifiedTypeName type_name_MyMiniArray = "MyMiniArray"; - eprosima::fastcdr::optional type_ann_builtin_MyMiniArray; - eprosima::fastcdr::optional ann_custom_MyMiniArray; - CompleteTypeDetail detail_MyMiniArray = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_MyMiniArray, ann_custom_MyMiniArray, type_name_MyMiniArray.to_string()); - CompleteAliasHeader header_MyMiniArray = TypeObjectUtils::build_complete_alias_header(detail_MyMiniArray); - AliasMemberFlag related_flags_MyMiniArray = 0; - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_array_int32_t_2", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Array element TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - TypeIdentifier* element_identifier_anonymous_array_int32_t_2 {nullptr}; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_array_int32_t_2 = new TypeIdentifier(type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_array_int32_t_2 = new TypeIdentifier(type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Array element TypeIdentifier inconsistent."); - return; - } - EquivalenceKind equiv_kind_anonymous_array_int32_t_2 = EK_COMPLETE; - if (TK_NONE == type_ids_ComplexStruct.type_identifier2()._d()) - { - equiv_kind_anonymous_array_int32_t_2 = EK_BOTH; - } - CollectionElementFlag element_flags_anonymous_array_int32_t_2 = 0; - PlainCollectionHeader header_anonymous_array_int32_t_2 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_int32_t_2, element_flags_anonymous_array_int32_t_2); - std::string type_id_kind_anonymous_array_int32_t_2("TI_PLAIN_ARRAY_SMALL"); - if (type_id_kind_anonymous_array_int32_t_2 == "TI_PLAIN_ARRAY_SMALL") - { - SBoundSeq array_bound_seq; - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(2)); - - PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_int32_t_2, array_bound_seq, - eprosima::fastcdr::external(element_identifier_anonymous_array_int32_t_2)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_int32_t_2")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_int32_t_2 already registered in TypeObjectRegistry for a different type."); - } - } - else - { - LBoundSeq array_bound_seq; - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(2)); - - PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_int32_t_2, array_bound_seq, - eprosima::fastcdr::external(element_identifier_anonymous_array_int32_t_2)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_int32_t_2")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_int32_t_2 already registered in TypeObjectRegistry for a different type."); - } - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_array_int32_t_2", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_int32_t_2: Given Array TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - CommonAliasBody common_MyMiniArray; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_MyMiniArray = TypeObjectUtils::build_common_alias_body(related_flags_MyMiniArray, type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_MyMiniArray = TypeObjectUtils::build_common_alias_body(related_flags_MyMiniArray, type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyMiniArray related TypeIdentifier inconsistent."); - return; - } - eprosima::fastcdr::optional member_ann_builtin_MyMiniArray; - ann_custom_MyMiniArray.reset(); - CompleteAliasBody body_MyMiniArray = TypeObjectUtils::build_complete_alias_body(common_MyMiniArray, member_ann_builtin_MyMiniArray, ann_custom_MyMiniArray); - CompleteAliasType alias_type_MyMiniArray = TypeObjectUtils::build_complete_alias_type(alias_flags_MyMiniArray, header_MyMiniArray, body_MyMiniArray); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_alias_type_object(alias_type_MyMiniArray, type_name_MyMiniArray.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyMiniArray already registered in TypeObjectRegistry for a different type."); - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyMiniArray", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyMiniArray: Given Alias TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - TypeIdentifier* element_identifier_anonymous_array_anonymous_array_int32_t_2_5 {nullptr}; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_array_anonymous_array_int32_t_2_5 = new TypeIdentifier(type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_array_anonymous_array_int32_t_2_5 = new TypeIdentifier(type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Array element TypeIdentifier inconsistent."); - return; - } - EquivalenceKind equiv_kind_anonymous_array_anonymous_array_int32_t_2_5 = EK_COMPLETE; - if (TK_NONE == type_ids_ComplexStruct.type_identifier2()._d()) - { - equiv_kind_anonymous_array_anonymous_array_int32_t_2_5 = EK_BOTH; - } - CollectionElementFlag element_flags_anonymous_array_anonymous_array_int32_t_2_5 = 0; - PlainCollectionHeader header_anonymous_array_anonymous_array_int32_t_2_5 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_anonymous_array_int32_t_2_5, element_flags_anonymous_array_anonymous_array_int32_t_2_5); - std::string type_id_kind_anonymous_array_anonymous_array_int32_t_2_5("TI_PLAIN_ARRAY_SMALL"); - if (type_id_kind_anonymous_array_anonymous_array_int32_t_2_5 == "TI_PLAIN_ARRAY_SMALL") - { - SBoundSeq array_bound_seq; - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(5)); - - PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_anonymous_array_int32_t_2_5, array_bound_seq, - eprosima::fastcdr::external(element_identifier_anonymous_array_anonymous_array_int32_t_2_5)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_anonymous_array_int32_t_2_5")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_anonymous_array_int32_t_2_5 already registered in TypeObjectRegistry for a different type."); - } - } - else - { - LBoundSeq array_bound_seq; - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(5)); - - PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_anonymous_array_int32_t_2_5, array_bound_seq, - eprosima::fastcdr::external(element_identifier_anonymous_array_anonymous_array_int32_t_2_5)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_anonymous_array_int32_t_2_5")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_anonymous_array_int32_t_2_5 already registered in TypeObjectRegistry for a different type."); - } - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_array_anonymous_array_int32_t_2_5", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_anonymous_array_int32_t_2_5: Given Array TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_array_arrays = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_array_arrays; - MemberId member_id_my_array_arrays = 0x00000012; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_array_arrays = TypeObjectUtils::build_common_struct_member(member_id_my_array_arrays, member_flags_my_array_arrays, type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_array_arrays = TypeObjectUtils::build_common_struct_member(member_id_my_array_arrays, member_flags_my_array_arrays, type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_array_arrays member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_array_arrays = "my_array_arrays"; - eprosima::fastcdr::optional member_ann_builtin_my_array_arrays; - ann_custom_ComplexStruct.reset(); - CompleteMemberDetail detail_my_array_arrays = TypeObjectUtils::build_complete_member_detail(name_my_array_arrays, member_ann_builtin_my_array_arrays, ann_custom_ComplexStruct); - CompleteStructMember member_my_array_arrays = TypeObjectUtils::build_complete_struct_member(common_my_array_arrays, detail_my_array_arrays); - TypeObjectUtils::add_complete_struct_member(member_seq_ComplexStruct, member_my_array_arrays); - } - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_array_anonymous_sequence_int32_t_unbounded_23", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MySequenceLong", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - AliasTypeFlag alias_flags_MySequenceLong = 0; - QualifiedTypeName type_name_MySequenceLong = "MySequenceLong"; - eprosima::fastcdr::optional type_ann_builtin_MySequenceLong; - eprosima::fastcdr::optional ann_custom_MySequenceLong; - CompleteTypeDetail detail_MySequenceLong = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_MySequenceLong, ann_custom_MySequenceLong, type_name_MySequenceLong.to_string()); - CompleteAliasHeader header_MySequenceLong = TypeObjectUtils::build_complete_alias_header(detail_MySequenceLong); - AliasMemberFlag related_flags_MySequenceLong = 0; - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_sequence_int32_t_unbounded", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Sequence element TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - TypeIdentifier* element_identifier_anonymous_sequence_int32_t_unbounded {nullptr}; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_sequence_int32_t_unbounded = new TypeIdentifier(type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_sequence_int32_t_unbounded = new TypeIdentifier(type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Sequence element TypeIdentifier inconsistent."); - return; - } - EquivalenceKind equiv_kind_anonymous_sequence_int32_t_unbounded = EK_COMPLETE; - if (TK_NONE == type_ids_ComplexStruct.type_identifier2()._d()) - { - equiv_kind_anonymous_sequence_int32_t_unbounded = EK_BOTH; - } - CollectionElementFlag element_flags_anonymous_sequence_int32_t_unbounded = 0; - PlainCollectionHeader header_anonymous_sequence_int32_t_unbounded = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_sequence_int32_t_unbounded, element_flags_anonymous_sequence_int32_t_unbounded); - std::string type_id_kind_anonymous_sequence_int32_t_unbounded("TI_PLAIN_SEQUENCE_SMALL"); - if (type_id_kind_anonymous_sequence_int32_t_unbounded == "TI_PLAIN_SEQUENCE_SMALL") - { - SBound bound = 0; - PlainSequenceSElemDefn seq_sdefn = TypeObjectUtils::build_plain_sequence_s_elem_defn(header_anonymous_sequence_int32_t_unbounded, bound, - eprosima::fastcdr::external(element_identifier_anonymous_sequence_int32_t_unbounded)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_s_sequence_type_identifier(seq_sdefn, "anonymous_sequence_int32_t_unbounded")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_sequence_int32_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_int32_t_unbounded, bound, - eprosima::fastcdr::external(element_identifier_anonymous_sequence_int32_t_unbounded)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_l_sequence_type_identifier(seq_ldefn, "anonymous_sequence_int32_t_unbounded")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_sequence_int32_t_unbounded already registered in TypeObjectRegistry for a different type."); - } - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_sequence_int32_t_unbounded", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_sequence_int32_t_unbounded: Given Sequence TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - CommonAliasBody common_MySequenceLong; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_MySequenceLong = TypeObjectUtils::build_common_alias_body(related_flags_MySequenceLong, type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_MySequenceLong = TypeObjectUtils::build_common_alias_body(related_flags_MySequenceLong, type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MySequenceLong related TypeIdentifier inconsistent."); - return; - } - eprosima::fastcdr::optional member_ann_builtin_MySequenceLong; - ann_custom_MySequenceLong.reset(); - CompleteAliasBody body_MySequenceLong = TypeObjectUtils::build_complete_alias_body(common_MySequenceLong, member_ann_builtin_MySequenceLong, ann_custom_MySequenceLong); - CompleteAliasType alias_type_MySequenceLong = TypeObjectUtils::build_complete_alias_type(alias_flags_MySequenceLong, header_MySequenceLong, body_MySequenceLong); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_alias_type_object(alias_type_MySequenceLong, type_name_MySequenceLong.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MySequenceLong already registered in TypeObjectRegistry for a different type."); - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MySequenceLong", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MySequenceLong: Given Alias TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - TypeIdentifier* element_identifier_anonymous_array_anonymous_sequence_int32_t_unbounded_23 {nullptr}; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_array_anonymous_sequence_int32_t_unbounded_23 = new TypeIdentifier(type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_array_anonymous_sequence_int32_t_unbounded_23 = new TypeIdentifier(type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Array element TypeIdentifier inconsistent."); - return; - } - EquivalenceKind equiv_kind_anonymous_array_anonymous_sequence_int32_t_unbounded_23 = EK_COMPLETE; - if (TK_NONE == type_ids_ComplexStruct.type_identifier2()._d()) - { - equiv_kind_anonymous_array_anonymous_sequence_int32_t_unbounded_23 = EK_BOTH; - } - CollectionElementFlag element_flags_anonymous_array_anonymous_sequence_int32_t_unbounded_23 = 0; - PlainCollectionHeader header_anonymous_array_anonymous_sequence_int32_t_unbounded_23 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_anonymous_sequence_int32_t_unbounded_23, element_flags_anonymous_array_anonymous_sequence_int32_t_unbounded_23); - std::string type_id_kind_anonymous_array_anonymous_sequence_int32_t_unbounded_23("TI_PLAIN_ARRAY_SMALL"); - if (type_id_kind_anonymous_array_anonymous_sequence_int32_t_unbounded_23 == "TI_PLAIN_ARRAY_SMALL") - { - SBoundSeq array_bound_seq; - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(23)); - - PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_anonymous_sequence_int32_t_unbounded_23, array_bound_seq, - eprosima::fastcdr::external(element_identifier_anonymous_array_anonymous_sequence_int32_t_unbounded_23)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_anonymous_sequence_int32_t_unbounded_23")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_anonymous_sequence_int32_t_unbounded_23 already registered in TypeObjectRegistry for a different type."); - } - } - else - { - LBoundSeq array_bound_seq; - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(23)); - - PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_anonymous_sequence_int32_t_unbounded_23, array_bound_seq, - eprosima::fastcdr::external(element_identifier_anonymous_array_anonymous_sequence_int32_t_unbounded_23)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_anonymous_sequence_int32_t_unbounded_23")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_anonymous_sequence_int32_t_unbounded_23 already registered in TypeObjectRegistry for a different type."); - } - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_array_anonymous_sequence_int32_t_unbounded_23", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_anonymous_sequence_int32_t_unbounded_23: Given Array TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_sequences_array = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_sequences_array; - MemberId member_id_my_sequences_array = 0x00000013; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_sequences_array = TypeObjectUtils::build_common_struct_member(member_id_my_sequences_array, member_flags_my_sequences_array, type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_sequences_array = TypeObjectUtils::build_common_struct_member(member_id_my_sequences_array, member_flags_my_sequences_array, type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_sequences_array member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_sequences_array = "my_sequences_array"; - eprosima::fastcdr::optional member_ann_builtin_my_sequences_array; - ann_custom_ComplexStruct.reset(); - CompleteMemberDetail detail_my_sequences_array = TypeObjectUtils::build_complete_member_detail(name_my_sequences_array, member_ann_builtin_my_sequences_array, ann_custom_ComplexStruct); - CompleteStructMember member_my_sequences_array = TypeObjectUtils::build_complete_struct_member(common_my_sequences_array, detail_my_sequences_array); - TypeObjectUtils::add_complete_struct_member(member_seq_ComplexStruct, member_my_sequences_array); - } - CompleteStructType struct_type_ComplexStruct = TypeObjectUtils::build_complete_struct_type(struct_flags_ComplexStruct, header_ComplexStruct, member_seq_ComplexStruct); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_ComplexStruct, type_name_ComplexStruct.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "ComplexStruct already registered in TypeObjectRegistry for a different type."); - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "ComplexStruct", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "ComplexStruct: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - } - UnionMemberFlag member_flags_complex = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false); - UnionCaseLabelSeq label_seq_complex; - TypeObjectUtils::add_union_case_label(label_seq_complex, static_cast(MyEnum::B)); - TypeObjectUtils::add_union_case_label(label_seq_complex, static_cast(MyEnum::C)); - CommonUnionMember common_complex; - MemberId member_id_complex = 0x00000002; - if (EK_COMPLETE == type_ids_MyUnion.type_identifier1()._d() || TK_NONE == type_ids_MyUnion.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_MyUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_MyUnion.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_MyUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_MyUnion.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_MyUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_MyUnion.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_MyUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_MyUnion.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_MyUnion.type_identifier1()._d() && - (EK_COMPLETE == type_ids_MyUnion.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MyUnion.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_MyUnion.type_identifier1()._d() && - (EK_COMPLETE == type_ids_MyUnion.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MyUnion.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_complex = TypeObjectUtils::build_common_union_member(member_id_complex, member_flags_complex, type_ids_MyUnion.type_identifier1(), - label_seq_complex); - } - else if (EK_COMPLETE == type_ids_MyUnion.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_MyUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_MyUnion.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_MyUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_MyUnion.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_MyUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_MyUnion.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_MyUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_MyUnion.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_MyUnion.type_identifier2()._d() && - (EK_COMPLETE == type_ids_MyUnion.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MyUnion.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_MyUnion.type_identifier2()._d() && - (EK_COMPLETE == type_ids_MyUnion.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MyUnion.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_complex = TypeObjectUtils::build_common_union_member(member_id_complex, member_flags_complex, type_ids_MyUnion.type_identifier2(), - label_seq_complex); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Union complex member TypeIdentifier inconsistent."); - return; - } - MemberName name_complex = "complex"; - eprosima::fastcdr::optional member_ann_builtin_complex; - ann_custom_MyUnion.reset(); - CompleteMemberDetail detail_complex = TypeObjectUtils::build_complete_member_detail(name_complex, member_ann_builtin_complex, ann_custom_MyUnion); - CompleteUnionMember member_complex = TypeObjectUtils::build_complete_union_member(common_complex, detail_complex); - TypeObjectUtils::add_complete_union_member(member_seq_MyUnion, member_complex); - } - CompleteUnionType union_type_MyUnion = TypeObjectUtils::build_complete_union_type(union_flags_MyUnion, header_MyUnion, discriminator_MyUnion, - member_seq_MyUnion); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_union_type_object(union_type_MyUnion, type_name_MyUnion.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyUnion already registered in TypeObjectRegistry for a different type."); - } - return_code_MyUnion = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyUnion", type_ids_MyUnion); - if (return_code_MyUnion != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyUnion: Given Union TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } -} -void register_MyUnion2_type_identifier() -{ - { - ReturnCode_t return_code_MyUnion2; - TypeIdentifierPair type_ids_MyUnion2; - UnionTypeFlag union_flags_MyUnion2 = TypeObjectUtils::build_union_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - QualifiedTypeName type_name_MyUnion2 = "MyUnion2"; - eprosima::fastcdr::optional type_ann_builtin_MyUnion2; - eprosima::fastcdr::optional ann_custom_MyUnion2; - CompleteTypeDetail detail_MyUnion2 = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_MyUnion2, ann_custom_MyUnion2, type_name_MyUnion2.to_string()); - CompleteUnionHeader header_MyUnion2 = TypeObjectUtils::build_complete_union_header(detail_MyUnion2); - UnionDiscriminatorFlag member_flags_MyUnion2 = TypeObjectUtils::build_union_discriminator_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false); - return_code_MyUnion2 = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_byte", type_ids_MyUnion2); - - if (return_code_MyUnion2 != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Union discriminator TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - CommonDiscriminatorMember common_MyUnion2; - if (EK_COMPLETE == type_ids_MyUnion2.type_identifier1()._d() || TK_NONE == type_ids_MyUnion2.type_identifier2()._d()) - { - common_MyUnion2 = TypeObjectUtils::build_common_discriminator_member(member_flags_MyUnion2, type_ids_MyUnion2.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_MyUnion2.type_identifier2()._d()) - { - common_MyUnion2 = TypeObjectUtils::build_common_discriminator_member(member_flags_MyUnion2, type_ids_MyUnion2.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyUnion2 discriminator TypeIdentifier inconsistent."); - return; - } - type_ann_builtin_MyUnion2.reset(); - ann_custom_MyUnion2.reset(); - CompleteDiscriminatorMember discriminator_MyUnion2 = TypeObjectUtils::build_complete_discriminator_member(common_MyUnion2, - type_ann_builtin_MyUnion2, ann_custom_MyUnion2); - CompleteUnionMemberSeq member_seq_MyUnion2; - { - return_code_MyUnion2 = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_MyUnion2); - - if (return_code_MyUnion2 != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "uno Union member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - UnionMemberFlag member_flags_uno = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false); - UnionCaseLabelSeq label_seq_uno; - TypeObjectUtils::add_union_case_label(label_seq_uno, static_cast(0)); - CommonUnionMember common_uno; - MemberId member_id_uno = 0x00000001; - if (EK_COMPLETE == type_ids_MyUnion2.type_identifier1()._d() || TK_NONE == type_ids_MyUnion2.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_MyUnion2.type_identifier1()._d() && - EK_COMPLETE == type_ids_MyUnion2.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_MyUnion2.type_identifier1()._d() && - EK_COMPLETE == type_ids_MyUnion2.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_MyUnion2.type_identifier1()._d() && - EK_COMPLETE == type_ids_MyUnion2.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_MyUnion2.type_identifier1()._d() && - EK_COMPLETE == type_ids_MyUnion2.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_MyUnion2.type_identifier1()._d() && - (EK_COMPLETE == type_ids_MyUnion2.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MyUnion2.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_MyUnion2.type_identifier1()._d() && - (EK_COMPLETE == type_ids_MyUnion2.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MyUnion2.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_uno = TypeObjectUtils::build_common_union_member(member_id_uno, member_flags_uno, type_ids_MyUnion2.type_identifier1(), - label_seq_uno); - } - else if (EK_COMPLETE == type_ids_MyUnion2.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_MyUnion2.type_identifier2()._d() && - EK_COMPLETE == type_ids_MyUnion2.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_MyUnion2.type_identifier2()._d() && - EK_COMPLETE == type_ids_MyUnion2.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_MyUnion2.type_identifier2()._d() && - EK_COMPLETE == type_ids_MyUnion2.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_MyUnion2.type_identifier2()._d() && - EK_COMPLETE == type_ids_MyUnion2.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_MyUnion2.type_identifier2()._d() && - (EK_COMPLETE == type_ids_MyUnion2.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MyUnion2.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_MyUnion2.type_identifier2()._d() && - (EK_COMPLETE == type_ids_MyUnion2.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MyUnion2.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_uno = TypeObjectUtils::build_common_union_member(member_id_uno, member_flags_uno, type_ids_MyUnion2.type_identifier2(), - label_seq_uno); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Union uno member TypeIdentifier inconsistent."); - return; - } - MemberName name_uno = "uno"; - eprosima::fastcdr::optional member_ann_builtin_uno; - ann_custom_MyUnion2.reset(); - CompleteMemberDetail detail_uno = TypeObjectUtils::build_complete_member_detail(name_uno, member_ann_builtin_uno, ann_custom_MyUnion2); - CompleteUnionMember member_uno = TypeObjectUtils::build_complete_union_member(common_uno, detail_uno); - TypeObjectUtils::add_complete_union_member(member_seq_MyUnion2, member_uno); - } - { - return_code_MyUnion2 = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_string_unbounded", type_ids_MyUnion2); - - if (return_code_MyUnion2 != 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_MyUnion2 = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_string_unbounded", type_ids_MyUnion2); - if (return_code_MyUnion2 != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_string_unbounded: Given String TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - UnionMemberFlag member_flags_imString = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false); - UnionCaseLabelSeq label_seq_imString; - TypeObjectUtils::add_union_case_label(label_seq_imString, static_cast(1)); - CommonUnionMember common_imString; - MemberId member_id_imString = 0x00000002; - if (EK_COMPLETE == type_ids_MyUnion2.type_identifier1()._d() || TK_NONE == type_ids_MyUnion2.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_MyUnion2.type_identifier1()._d() && - EK_COMPLETE == type_ids_MyUnion2.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_MyUnion2.type_identifier1()._d() && - EK_COMPLETE == type_ids_MyUnion2.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_MyUnion2.type_identifier1()._d() && - EK_COMPLETE == type_ids_MyUnion2.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_MyUnion2.type_identifier1()._d() && - EK_COMPLETE == type_ids_MyUnion2.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_MyUnion2.type_identifier1()._d() && - (EK_COMPLETE == type_ids_MyUnion2.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MyUnion2.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_MyUnion2.type_identifier1()._d() && - (EK_COMPLETE == type_ids_MyUnion2.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MyUnion2.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_imString = TypeObjectUtils::build_common_union_member(member_id_imString, member_flags_imString, type_ids_MyUnion2.type_identifier1(), - label_seq_imString); - } - else if (EK_COMPLETE == type_ids_MyUnion2.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_MyUnion2.type_identifier2()._d() && - EK_COMPLETE == type_ids_MyUnion2.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_MyUnion2.type_identifier2()._d() && - EK_COMPLETE == type_ids_MyUnion2.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_MyUnion2.type_identifier2()._d() && - EK_COMPLETE == type_ids_MyUnion2.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_MyUnion2.type_identifier2()._d() && - EK_COMPLETE == type_ids_MyUnion2.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_MyUnion2.type_identifier2()._d() && - (EK_COMPLETE == type_ids_MyUnion2.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MyUnion2.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_MyUnion2.type_identifier2()._d() && - (EK_COMPLETE == type_ids_MyUnion2.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MyUnion2.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_imString = TypeObjectUtils::build_common_union_member(member_id_imString, member_flags_imString, type_ids_MyUnion2.type_identifier2(), - label_seq_imString); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Union imString member TypeIdentifier inconsistent."); - return; - } - MemberName name_imString = "imString"; - eprosima::fastcdr::optional member_ann_builtin_imString; - ann_custom_MyUnion2.reset(); - CompleteMemberDetail detail_imString = TypeObjectUtils::build_complete_member_detail(name_imString, member_ann_builtin_imString, ann_custom_MyUnion2); - CompleteUnionMember member_imString = TypeObjectUtils::build_complete_union_member(common_imString, detail_imString); - TypeObjectUtils::add_complete_union_member(member_seq_MyUnion2, member_imString); - } - { - return_code_MyUnion2 = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_MyUnion2); - - if (return_code_MyUnion2 != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "tres Union member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - UnionMemberFlag member_flags_tres = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false); - UnionCaseLabelSeq label_seq_tres; - TypeObjectUtils::add_union_case_label(label_seq_tres, static_cast(2)); - CommonUnionMember common_tres; - MemberId member_id_tres = 0x00000003; - if (EK_COMPLETE == type_ids_MyUnion2.type_identifier1()._d() || TK_NONE == type_ids_MyUnion2.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_MyUnion2.type_identifier1()._d() && - EK_COMPLETE == type_ids_MyUnion2.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_MyUnion2.type_identifier1()._d() && - EK_COMPLETE == type_ids_MyUnion2.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_MyUnion2.type_identifier1()._d() && - EK_COMPLETE == type_ids_MyUnion2.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_MyUnion2.type_identifier1()._d() && - EK_COMPLETE == type_ids_MyUnion2.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_MyUnion2.type_identifier1()._d() && - (EK_COMPLETE == type_ids_MyUnion2.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MyUnion2.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_MyUnion2.type_identifier1()._d() && - (EK_COMPLETE == type_ids_MyUnion2.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MyUnion2.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_tres = TypeObjectUtils::build_common_union_member(member_id_tres, member_flags_tres, type_ids_MyUnion2.type_identifier1(), - label_seq_tres); - } - else if (EK_COMPLETE == type_ids_MyUnion2.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_MyUnion2.type_identifier2()._d() && - EK_COMPLETE == type_ids_MyUnion2.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_MyUnion2.type_identifier2()._d() && - EK_COMPLETE == type_ids_MyUnion2.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_MyUnion2.type_identifier2()._d() && - EK_COMPLETE == type_ids_MyUnion2.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_MyUnion2.type_identifier2()._d() && - EK_COMPLETE == type_ids_MyUnion2.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_MyUnion2.type_identifier2()._d() && - (EK_COMPLETE == type_ids_MyUnion2.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MyUnion2.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_MyUnion2.type_identifier2()._d() && - (EK_COMPLETE == type_ids_MyUnion2.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MyUnion2.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_tres = TypeObjectUtils::build_common_union_member(member_id_tres, member_flags_tres, type_ids_MyUnion2.type_identifier2(), - label_seq_tres); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Union tres member TypeIdentifier inconsistent."); - return; - } - MemberName name_tres = "tres"; - eprosima::fastcdr::optional member_ann_builtin_tres; - ann_custom_MyUnion2.reset(); - CompleteMemberDetail detail_tres = TypeObjectUtils::build_complete_member_detail(name_tres, member_ann_builtin_tres, ann_custom_MyUnion2); - CompleteUnionMember member_tres = TypeObjectUtils::build_complete_union_member(common_tres, detail_tres); - TypeObjectUtils::add_complete_union_member(member_seq_MyUnion2, member_tres); - } - CompleteUnionType union_type_MyUnion2 = TypeObjectUtils::build_complete_union_type(union_flags_MyUnion2, header_MyUnion2, discriminator_MyUnion2, - member_seq_MyUnion2); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_union_type_object(union_type_MyUnion2, type_name_MyUnion2.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyUnion2 already registered in TypeObjectRegistry for a different type."); - } - return_code_MyUnion2 = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyUnion2", type_ids_MyUnion2); - if (return_code_MyUnion2 != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyUnion2: Given Union TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } -} -void register_CompleteStruct_type_identifier() -{ - { - StructTypeFlag struct_flags_CompleteStruct = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_CompleteStruct; - TypeIdentifierPair type_ids_CompleteStruct; - QualifiedTypeName type_name_CompleteStruct = "CompleteStruct"; - eprosima::fastcdr::optional type_ann_builtin_CompleteStruct; - eprosima::fastcdr::optional ann_custom_CompleteStruct; - CompleteTypeDetail detail_CompleteStruct = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_CompleteStruct, ann_custom_CompleteStruct, type_name_CompleteStruct.to_string()); - CompleteStructHeader header_CompleteStruct; - header_CompleteStruct = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_CompleteStruct); - CompleteStructMemberSeq member_seq_CompleteStruct; - { - return_code_CompleteStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyUnion", type_ids_CompleteStruct); - - if (return_code_CompleteStruct != eprosima::fastdds::dds::RETCODE_OK) - { - { - ReturnCode_t return_code_MyUnion; - TypeIdentifierPair type_ids_MyUnion; - UnionTypeFlag union_flags_MyUnion = TypeObjectUtils::build_union_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - QualifiedTypeName type_name_MyUnion = "MyUnion"; - eprosima::fastcdr::optional type_ann_builtin_MyUnion; - eprosima::fastcdr::optional ann_custom_MyUnion; - CompleteTypeDetail detail_MyUnion = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_MyUnion, ann_custom_MyUnion, type_name_MyUnion.to_string()); - CompleteUnionHeader header_MyUnion = TypeObjectUtils::build_complete_union_header(detail_MyUnion); - UnionDiscriminatorFlag member_flags_MyUnion = TypeObjectUtils::build_union_discriminator_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false); - return_code_MyUnion = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyEnum", type_ids_MyUnion); - - if (return_code_MyUnion != eprosima::fastdds::dds::RETCODE_OK) - { - EnumTypeFlag enum_flags_MyEnum = 0; - BitBound bit_bound_MyEnum = 32; - CommonEnumeratedHeader common_MyEnum = TypeObjectUtils::build_common_enumerated_header(bit_bound_MyEnum); - QualifiedTypeName type_name_MyEnum = "MyEnum"; - eprosima::fastcdr::optional type_ann_builtin_MyEnum; - eprosima::fastcdr::optional ann_custom_MyEnum; - CompleteTypeDetail detail_MyEnum = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_MyEnum, ann_custom_MyEnum, type_name_MyEnum.to_string()); - CompleteEnumeratedHeader header_MyEnum = TypeObjectUtils::build_complete_enumerated_header(common_MyEnum, detail_MyEnum); - CompleteEnumeratedLiteralSeq literal_seq_MyEnum; - { - EnumeratedLiteralFlag flags_A = TypeObjectUtils::build_enumerated_literal_flag(false); - CommonEnumeratedLiteral common_A = TypeObjectUtils::build_common_enumerated_literal(0, flags_A); - eprosima::fastcdr::optional member_ann_builtin_A; - ann_custom_MyEnum.reset(); - MemberName name_A = "A"; - CompleteMemberDetail detail_A = TypeObjectUtils::build_complete_member_detail(name_A, member_ann_builtin_A, ann_custom_MyEnum); - CompleteEnumeratedLiteral literal_A = TypeObjectUtils::build_complete_enumerated_literal(common_A, detail_A); - TypeObjectUtils::add_complete_enumerated_literal(literal_seq_MyEnum, literal_A); - } - { - EnumeratedLiteralFlag flags_B = TypeObjectUtils::build_enumerated_literal_flag(false); - CommonEnumeratedLiteral common_B = TypeObjectUtils::build_common_enumerated_literal(1, flags_B); - eprosima::fastcdr::optional member_ann_builtin_B; - ann_custom_MyEnum.reset(); - MemberName name_B = "B"; - CompleteMemberDetail detail_B = TypeObjectUtils::build_complete_member_detail(name_B, member_ann_builtin_B, ann_custom_MyEnum); - CompleteEnumeratedLiteral literal_B = TypeObjectUtils::build_complete_enumerated_literal(common_B, detail_B); - TypeObjectUtils::add_complete_enumerated_literal(literal_seq_MyEnum, literal_B); - } - { - EnumeratedLiteralFlag flags_C = TypeObjectUtils::build_enumerated_literal_flag(false); - CommonEnumeratedLiteral common_C = TypeObjectUtils::build_common_enumerated_literal(2, flags_C); - eprosima::fastcdr::optional member_ann_builtin_C; - ann_custom_MyEnum.reset(); - MemberName name_C = "C"; - CompleteMemberDetail detail_C = TypeObjectUtils::build_complete_member_detail(name_C, member_ann_builtin_C, ann_custom_MyEnum); - CompleteEnumeratedLiteral literal_C = TypeObjectUtils::build_complete_enumerated_literal(common_C, detail_C); - TypeObjectUtils::add_complete_enumerated_literal(literal_seq_MyEnum, literal_C); - } - CompleteEnumeratedType enumerated_type_MyEnum = TypeObjectUtils::build_complete_enumerated_type(enum_flags_MyEnum, header_MyEnum, - literal_seq_MyEnum); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_enumerated_type_object(enumerated_type_MyEnum, type_name_MyEnum.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyEnum already registered in TypeObjectRegistry for a different type."); - } - return_code_MyUnion = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyEnum", type_ids_MyUnion); - if (return_code_MyUnion != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyEnum: Given Enum TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - CommonDiscriminatorMember common_MyUnion; - if (EK_COMPLETE == type_ids_MyUnion.type_identifier1()._d() || TK_NONE == type_ids_MyUnion.type_identifier2()._d()) - { - common_MyUnion = TypeObjectUtils::build_common_discriminator_member(member_flags_MyUnion, type_ids_MyUnion.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_MyUnion.type_identifier2()._d()) - { - common_MyUnion = TypeObjectUtils::build_common_discriminator_member(member_flags_MyUnion, type_ids_MyUnion.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyUnion discriminator TypeIdentifier inconsistent."); - return; - } - type_ann_builtin_MyUnion.reset(); - ann_custom_MyUnion.reset(); - CompleteDiscriminatorMember discriminator_MyUnion = TypeObjectUtils::build_complete_discriminator_member(common_MyUnion, - type_ann_builtin_MyUnion, ann_custom_MyUnion); - CompleteUnionMemberSeq member_seq_MyUnion; - { - return_code_MyUnion = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "BasicStruct", type_ids_MyUnion); - - if (return_code_MyUnion != eprosima::fastdds::dds::RETCODE_OK) - { - { - StructTypeFlag struct_flags_BasicStruct = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_BasicStruct; - TypeIdentifierPair type_ids_BasicStruct; - QualifiedTypeName type_name_BasicStruct = "BasicStruct"; - eprosima::fastcdr::optional type_ann_builtin_BasicStruct; - eprosima::fastcdr::optional ann_custom_BasicStruct; - CompleteTypeDetail detail_BasicStruct = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_BasicStruct, ann_custom_BasicStruct, type_name_BasicStruct.to_string()); - CompleteStructHeader header_BasicStruct; - header_BasicStruct = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_BasicStruct); - CompleteStructMemberSeq member_seq_BasicStruct; - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_bool", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_bool Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_bool = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_bool; - MemberId member_id_my_bool = 0x00000000; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_bool = TypeObjectUtils::build_common_struct_member(member_id_my_bool, member_flags_my_bool, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_bool = TypeObjectUtils::build_common_struct_member(member_id_my_bool, member_flags_my_bool, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_bool member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_bool = "my_bool"; - eprosima::fastcdr::optional member_ann_builtin_my_bool; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_bool = TypeObjectUtils::build_complete_member_detail(name_my_bool, member_ann_builtin_my_bool, ann_custom_BasicStruct); - CompleteStructMember member_my_bool = TypeObjectUtils::build_complete_struct_member(common_my_bool, detail_my_bool); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_bool); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_byte", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_octet Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_octet = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_octet; - MemberId member_id_my_octet = 0x00000001; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_octet = TypeObjectUtils::build_common_struct_member(member_id_my_octet, member_flags_my_octet, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_octet = TypeObjectUtils::build_common_struct_member(member_id_my_octet, member_flags_my_octet, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_octet member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_octet = "my_octet"; - eprosima::fastcdr::optional member_ann_builtin_my_octet; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_octet = TypeObjectUtils::build_complete_member_detail(name_my_octet, member_ann_builtin_my_octet, ann_custom_BasicStruct); - CompleteStructMember member_my_octet = TypeObjectUtils::build_complete_struct_member(common_my_octet, detail_my_octet); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_octet); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int16_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_int16 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_int16 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_int16; - MemberId member_id_my_int16 = 0x00000002; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_int16 = TypeObjectUtils::build_common_struct_member(member_id_my_int16, member_flags_my_int16, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_int16 = TypeObjectUtils::build_common_struct_member(member_id_my_int16, member_flags_my_int16, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_int16 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_int16 = "my_int16"; - eprosima::fastcdr::optional member_ann_builtin_my_int16; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_int16 = TypeObjectUtils::build_complete_member_detail(name_my_int16, member_ann_builtin_my_int16, ann_custom_BasicStruct); - CompleteStructMember member_my_int16 = TypeObjectUtils::build_complete_struct_member(common_my_int16, detail_my_int16); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_int16); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_int32 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_int32 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_int32; - MemberId member_id_my_int32 = 0x00000003; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_int32 = TypeObjectUtils::build_common_struct_member(member_id_my_int32, member_flags_my_int32, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_int32 = TypeObjectUtils::build_common_struct_member(member_id_my_int32, member_flags_my_int32, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_int32 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_int32 = "my_int32"; - eprosima::fastcdr::optional member_ann_builtin_my_int32; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_int32 = TypeObjectUtils::build_complete_member_detail(name_my_int32, member_ann_builtin_my_int32, ann_custom_BasicStruct); - CompleteStructMember member_my_int32 = TypeObjectUtils::build_complete_struct_member(common_my_int32, detail_my_int32); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_int32); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int64_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_int64 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_int64 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_int64; - MemberId member_id_my_int64 = 0x00000004; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_int64 = TypeObjectUtils::build_common_struct_member(member_id_my_int64, member_flags_my_int64, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_int64 = TypeObjectUtils::build_common_struct_member(member_id_my_int64, member_flags_my_int64, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_int64 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_int64 = "my_int64"; - eprosima::fastcdr::optional member_ann_builtin_my_int64; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_int64 = TypeObjectUtils::build_complete_member_detail(name_my_int64, member_ann_builtin_my_int64, ann_custom_BasicStruct); - CompleteStructMember member_my_int64 = TypeObjectUtils::build_complete_struct_member(common_my_int64, detail_my_int64); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_int64); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_uint16_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_uint16 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_uint16 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_uint16; - MemberId member_id_my_uint16 = 0x00000005; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_uint16 = TypeObjectUtils::build_common_struct_member(member_id_my_uint16, member_flags_my_uint16, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_uint16 = TypeObjectUtils::build_common_struct_member(member_id_my_uint16, member_flags_my_uint16, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_uint16 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_uint16 = "my_uint16"; - eprosima::fastcdr::optional member_ann_builtin_my_uint16; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_uint16 = TypeObjectUtils::build_complete_member_detail(name_my_uint16, member_ann_builtin_my_uint16, ann_custom_BasicStruct); - CompleteStructMember member_my_uint16 = TypeObjectUtils::build_complete_struct_member(common_my_uint16, detail_my_uint16); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_uint16); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_uint32_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_uint32 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_uint32 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_uint32; - MemberId member_id_my_uint32 = 0x00000006; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_uint32 = TypeObjectUtils::build_common_struct_member(member_id_my_uint32, member_flags_my_uint32, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_uint32 = TypeObjectUtils::build_common_struct_member(member_id_my_uint32, member_flags_my_uint32, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_uint32 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_uint32 = "my_uint32"; - eprosima::fastcdr::optional member_ann_builtin_my_uint32; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_uint32 = TypeObjectUtils::build_complete_member_detail(name_my_uint32, member_ann_builtin_my_uint32, ann_custom_BasicStruct); - CompleteStructMember member_my_uint32 = TypeObjectUtils::build_complete_struct_member(common_my_uint32, detail_my_uint32); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_uint32); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_uint64_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_uint64 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_uint64 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_uint64; - MemberId member_id_my_uint64 = 0x00000007; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_uint64 = TypeObjectUtils::build_common_struct_member(member_id_my_uint64, member_flags_my_uint64, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_uint64 = TypeObjectUtils::build_common_struct_member(member_id_my_uint64, member_flags_my_uint64, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_uint64 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_uint64 = "my_uint64"; - eprosima::fastcdr::optional member_ann_builtin_my_uint64; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_uint64 = TypeObjectUtils::build_complete_member_detail(name_my_uint64, member_ann_builtin_my_uint64, ann_custom_BasicStruct); - CompleteStructMember member_my_uint64 = TypeObjectUtils::build_complete_struct_member(common_my_uint64, detail_my_uint64); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_uint64); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_float", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_float32 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_float32 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_float32; - MemberId member_id_my_float32 = 0x00000008; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_float32 = TypeObjectUtils::build_common_struct_member(member_id_my_float32, member_flags_my_float32, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_float32 = TypeObjectUtils::build_common_struct_member(member_id_my_float32, member_flags_my_float32, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_float32 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_float32 = "my_float32"; - eprosima::fastcdr::optional member_ann_builtin_my_float32; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_float32 = TypeObjectUtils::build_complete_member_detail(name_my_float32, member_ann_builtin_my_float32, ann_custom_BasicStruct); - CompleteStructMember member_my_float32 = TypeObjectUtils::build_complete_struct_member(common_my_float32, detail_my_float32); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_float32); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_double", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_float64 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_float64 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_float64; - MemberId member_id_my_float64 = 0x00000009; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_float64 = TypeObjectUtils::build_common_struct_member(member_id_my_float64, member_flags_my_float64, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_float64 = TypeObjectUtils::build_common_struct_member(member_id_my_float64, member_flags_my_float64, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_float64 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_float64 = "my_float64"; - eprosima::fastcdr::optional member_ann_builtin_my_float64; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_float64 = TypeObjectUtils::build_complete_member_detail(name_my_float64, member_ann_builtin_my_float64, ann_custom_BasicStruct); - CompleteStructMember member_my_float64 = TypeObjectUtils::build_complete_struct_member(common_my_float64, detail_my_float64); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_float64); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_longdouble", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_float128 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_float128 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_float128; - MemberId member_id_my_float128 = 0x0000000a; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_float128 = TypeObjectUtils::build_common_struct_member(member_id_my_float128, member_flags_my_float128, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_float128 = TypeObjectUtils::build_common_struct_member(member_id_my_float128, member_flags_my_float128, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_float128 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_float128 = "my_float128"; - eprosima::fastcdr::optional member_ann_builtin_my_float128; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_float128 = TypeObjectUtils::build_complete_member_detail(name_my_float128, member_ann_builtin_my_float128, ann_custom_BasicStruct); - CompleteStructMember member_my_float128 = TypeObjectUtils::build_complete_struct_member(common_my_float128, detail_my_float128); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_float128); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_char", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_char Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_char = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_char; - MemberId member_id_my_char = 0x0000000b; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_char = TypeObjectUtils::build_common_struct_member(member_id_my_char, member_flags_my_char, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_char = TypeObjectUtils::build_common_struct_member(member_id_my_char, member_flags_my_char, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_char member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_char = "my_char"; - eprosima::fastcdr::optional member_ann_builtin_my_char; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_char = TypeObjectUtils::build_complete_member_detail(name_my_char, member_ann_builtin_my_char, ann_custom_BasicStruct); - CompleteStructMember member_my_char = TypeObjectUtils::build_complete_struct_member(common_my_char, detail_my_char); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_char); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_string_unbounded", type_ids_BasicStruct); - - if (return_code_BasicStruct != 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_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_string_unbounded", type_ids_BasicStruct); - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_string_unbounded: Given String TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_string = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_string; - MemberId member_id_my_string = 0x0000000c; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_string = TypeObjectUtils::build_common_struct_member(member_id_my_string, member_flags_my_string, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_string = TypeObjectUtils::build_common_struct_member(member_id_my_string, member_flags_my_string, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_string member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_string = "my_string"; - eprosima::fastcdr::optional member_ann_builtin_my_string; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_string = TypeObjectUtils::build_complete_member_detail(name_my_string, member_ann_builtin_my_string, ann_custom_BasicStruct); - CompleteStructMember member_my_string = TypeObjectUtils::build_complete_struct_member(common_my_string, detail_my_string); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_string); - } - CompleteStructType struct_type_BasicStruct = TypeObjectUtils::build_complete_struct_type(struct_flags_BasicStruct, header_BasicStruct, member_seq_BasicStruct); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_BasicStruct, type_name_BasicStruct.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "BasicStruct already registered in TypeObjectRegistry for a different type."); - } - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "BasicStruct", type_ids_BasicStruct); - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "BasicStruct: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - } - UnionMemberFlag member_flags_basic = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false); - UnionCaseLabelSeq label_seq_basic; - TypeObjectUtils::add_union_case_label(label_seq_basic, static_cast(MyEnum::A)); - CommonUnionMember common_basic; - MemberId member_id_basic = 0x00000001; - if (EK_COMPLETE == type_ids_MyUnion.type_identifier1()._d() || TK_NONE == type_ids_MyUnion.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_MyUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_MyUnion.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_MyUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_MyUnion.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_MyUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_MyUnion.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_MyUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_MyUnion.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_MyUnion.type_identifier1()._d() && - (EK_COMPLETE == type_ids_MyUnion.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MyUnion.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_MyUnion.type_identifier1()._d() && - (EK_COMPLETE == type_ids_MyUnion.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MyUnion.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_basic = TypeObjectUtils::build_common_union_member(member_id_basic, member_flags_basic, type_ids_MyUnion.type_identifier1(), - label_seq_basic); - } - else if (EK_COMPLETE == type_ids_MyUnion.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_MyUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_MyUnion.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_MyUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_MyUnion.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_MyUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_MyUnion.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_MyUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_MyUnion.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_MyUnion.type_identifier2()._d() && - (EK_COMPLETE == type_ids_MyUnion.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MyUnion.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_MyUnion.type_identifier2()._d() && - (EK_COMPLETE == type_ids_MyUnion.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MyUnion.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_basic = TypeObjectUtils::build_common_union_member(member_id_basic, member_flags_basic, type_ids_MyUnion.type_identifier2(), - label_seq_basic); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Union basic member TypeIdentifier inconsistent."); - return; - } - MemberName name_basic = "basic"; - eprosima::fastcdr::optional member_ann_builtin_basic; - ann_custom_MyUnion.reset(); - CompleteMemberDetail detail_basic = TypeObjectUtils::build_complete_member_detail(name_basic, member_ann_builtin_basic, ann_custom_MyUnion); - CompleteUnionMember member_basic = TypeObjectUtils::build_complete_union_member(common_basic, detail_basic); - TypeObjectUtils::add_complete_union_member(member_seq_MyUnion, member_basic); - } - { - return_code_MyUnion = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "ComplexStruct", type_ids_MyUnion); - - if (return_code_MyUnion != eprosima::fastdds::dds::RETCODE_OK) - { - { - StructTypeFlag struct_flags_ComplexStruct = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_ComplexStruct; - TypeIdentifierPair type_ids_ComplexStruct; - QualifiedTypeName type_name_ComplexStruct = "ComplexStruct"; - eprosima::fastcdr::optional type_ann_builtin_ComplexStruct; - eprosima::fastcdr::optional ann_custom_ComplexStruct; - CompleteTypeDetail detail_ComplexStruct = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_ComplexStruct, ann_custom_ComplexStruct, type_name_ComplexStruct.to_string()); - CompleteStructHeader header_ComplexStruct; - header_ComplexStruct = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_ComplexStruct); - CompleteStructMemberSeq member_seq_ComplexStruct; - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_byte", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_octet Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_octet = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_octet; - MemberId member_id_my_octet = 0x00000000; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_octet = TypeObjectUtils::build_common_struct_member(member_id_my_octet, member_flags_my_octet, type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_octet = TypeObjectUtils::build_common_struct_member(member_id_my_octet, member_flags_my_octet, type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_octet member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_octet = "my_octet"; - eprosima::fastcdr::optional member_ann_builtin_my_octet; - ann_custom_ComplexStruct.reset(); - CompleteMemberDetail detail_my_octet = TypeObjectUtils::build_complete_member_detail(name_my_octet, member_ann_builtin_my_octet, ann_custom_ComplexStruct); - CompleteStructMember member_my_octet = TypeObjectUtils::build_complete_struct_member(common_my_octet, detail_my_octet); - TypeObjectUtils::add_complete_struct_member(member_seq_ComplexStruct, member_my_octet); - } - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "BasicStruct", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - { - StructTypeFlag struct_flags_BasicStruct = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_BasicStruct; - TypeIdentifierPair type_ids_BasicStruct; - QualifiedTypeName type_name_BasicStruct = "BasicStruct"; - eprosima::fastcdr::optional type_ann_builtin_BasicStruct; - eprosima::fastcdr::optional ann_custom_BasicStruct; - CompleteTypeDetail detail_BasicStruct = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_BasicStruct, ann_custom_BasicStruct, type_name_BasicStruct.to_string()); - CompleteStructHeader header_BasicStruct; - header_BasicStruct = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_BasicStruct); - CompleteStructMemberSeq member_seq_BasicStruct; - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_bool", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_bool Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_bool = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_bool; - MemberId member_id_my_bool = 0x00000000; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_bool = TypeObjectUtils::build_common_struct_member(member_id_my_bool, member_flags_my_bool, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_bool = TypeObjectUtils::build_common_struct_member(member_id_my_bool, member_flags_my_bool, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_bool member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_bool = "my_bool"; - eprosima::fastcdr::optional member_ann_builtin_my_bool; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_bool = TypeObjectUtils::build_complete_member_detail(name_my_bool, member_ann_builtin_my_bool, ann_custom_BasicStruct); - CompleteStructMember member_my_bool = TypeObjectUtils::build_complete_struct_member(common_my_bool, detail_my_bool); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_bool); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_byte", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_octet Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_octet = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_octet; - MemberId member_id_my_octet = 0x00000001; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_octet = TypeObjectUtils::build_common_struct_member(member_id_my_octet, member_flags_my_octet, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_octet = TypeObjectUtils::build_common_struct_member(member_id_my_octet, member_flags_my_octet, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_octet member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_octet = "my_octet"; - eprosima::fastcdr::optional member_ann_builtin_my_octet; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_octet = TypeObjectUtils::build_complete_member_detail(name_my_octet, member_ann_builtin_my_octet, ann_custom_BasicStruct); - CompleteStructMember member_my_octet = TypeObjectUtils::build_complete_struct_member(common_my_octet, detail_my_octet); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_octet); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int16_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_int16 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_int16 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_int16; - MemberId member_id_my_int16 = 0x00000002; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_int16 = TypeObjectUtils::build_common_struct_member(member_id_my_int16, member_flags_my_int16, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_int16 = TypeObjectUtils::build_common_struct_member(member_id_my_int16, member_flags_my_int16, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_int16 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_int16 = "my_int16"; - eprosima::fastcdr::optional member_ann_builtin_my_int16; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_int16 = TypeObjectUtils::build_complete_member_detail(name_my_int16, member_ann_builtin_my_int16, ann_custom_BasicStruct); - CompleteStructMember member_my_int16 = TypeObjectUtils::build_complete_struct_member(common_my_int16, detail_my_int16); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_int16); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_int32 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_int32 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_int32; - MemberId member_id_my_int32 = 0x00000003; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_int32 = TypeObjectUtils::build_common_struct_member(member_id_my_int32, member_flags_my_int32, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_int32 = TypeObjectUtils::build_common_struct_member(member_id_my_int32, member_flags_my_int32, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_int32 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_int32 = "my_int32"; - eprosima::fastcdr::optional member_ann_builtin_my_int32; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_int32 = TypeObjectUtils::build_complete_member_detail(name_my_int32, member_ann_builtin_my_int32, ann_custom_BasicStruct); - CompleteStructMember member_my_int32 = TypeObjectUtils::build_complete_struct_member(common_my_int32, detail_my_int32); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_int32); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int64_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_int64 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_int64 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_int64; - MemberId member_id_my_int64 = 0x00000004; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_int64 = TypeObjectUtils::build_common_struct_member(member_id_my_int64, member_flags_my_int64, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_int64 = TypeObjectUtils::build_common_struct_member(member_id_my_int64, member_flags_my_int64, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_int64 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_int64 = "my_int64"; - eprosima::fastcdr::optional member_ann_builtin_my_int64; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_int64 = TypeObjectUtils::build_complete_member_detail(name_my_int64, member_ann_builtin_my_int64, ann_custom_BasicStruct); - CompleteStructMember member_my_int64 = TypeObjectUtils::build_complete_struct_member(common_my_int64, detail_my_int64); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_int64); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_uint16_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_uint16 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_uint16 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_uint16; - MemberId member_id_my_uint16 = 0x00000005; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_uint16 = TypeObjectUtils::build_common_struct_member(member_id_my_uint16, member_flags_my_uint16, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_uint16 = TypeObjectUtils::build_common_struct_member(member_id_my_uint16, member_flags_my_uint16, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_uint16 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_uint16 = "my_uint16"; - eprosima::fastcdr::optional member_ann_builtin_my_uint16; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_uint16 = TypeObjectUtils::build_complete_member_detail(name_my_uint16, member_ann_builtin_my_uint16, ann_custom_BasicStruct); - CompleteStructMember member_my_uint16 = TypeObjectUtils::build_complete_struct_member(common_my_uint16, detail_my_uint16); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_uint16); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_uint32_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_uint32 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_uint32 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_uint32; - MemberId member_id_my_uint32 = 0x00000006; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_uint32 = TypeObjectUtils::build_common_struct_member(member_id_my_uint32, member_flags_my_uint32, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_uint32 = TypeObjectUtils::build_common_struct_member(member_id_my_uint32, member_flags_my_uint32, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_uint32 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_uint32 = "my_uint32"; - eprosima::fastcdr::optional member_ann_builtin_my_uint32; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_uint32 = TypeObjectUtils::build_complete_member_detail(name_my_uint32, member_ann_builtin_my_uint32, ann_custom_BasicStruct); - CompleteStructMember member_my_uint32 = TypeObjectUtils::build_complete_struct_member(common_my_uint32, detail_my_uint32); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_uint32); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_uint64_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_uint64 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_uint64 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_uint64; - MemberId member_id_my_uint64 = 0x00000007; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_uint64 = TypeObjectUtils::build_common_struct_member(member_id_my_uint64, member_flags_my_uint64, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_uint64 = TypeObjectUtils::build_common_struct_member(member_id_my_uint64, member_flags_my_uint64, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_uint64 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_uint64 = "my_uint64"; - eprosima::fastcdr::optional member_ann_builtin_my_uint64; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_uint64 = TypeObjectUtils::build_complete_member_detail(name_my_uint64, member_ann_builtin_my_uint64, ann_custom_BasicStruct); - CompleteStructMember member_my_uint64 = TypeObjectUtils::build_complete_struct_member(common_my_uint64, detail_my_uint64); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_uint64); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_float", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_float32 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_float32 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_float32; - MemberId member_id_my_float32 = 0x00000008; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_float32 = TypeObjectUtils::build_common_struct_member(member_id_my_float32, member_flags_my_float32, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_float32 = TypeObjectUtils::build_common_struct_member(member_id_my_float32, member_flags_my_float32, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_float32 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_float32 = "my_float32"; - eprosima::fastcdr::optional member_ann_builtin_my_float32; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_float32 = TypeObjectUtils::build_complete_member_detail(name_my_float32, member_ann_builtin_my_float32, ann_custom_BasicStruct); - CompleteStructMember member_my_float32 = TypeObjectUtils::build_complete_struct_member(common_my_float32, detail_my_float32); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_float32); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_double", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_float64 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_float64 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_float64; - MemberId member_id_my_float64 = 0x00000009; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_float64 = TypeObjectUtils::build_common_struct_member(member_id_my_float64, member_flags_my_float64, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_float64 = TypeObjectUtils::build_common_struct_member(member_id_my_float64, member_flags_my_float64, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_float64 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_float64 = "my_float64"; - eprosima::fastcdr::optional member_ann_builtin_my_float64; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_float64 = TypeObjectUtils::build_complete_member_detail(name_my_float64, member_ann_builtin_my_float64, ann_custom_BasicStruct); - CompleteStructMember member_my_float64 = TypeObjectUtils::build_complete_struct_member(common_my_float64, detail_my_float64); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_float64); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_longdouble", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_float128 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_float128 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_float128; - MemberId member_id_my_float128 = 0x0000000a; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_float128 = TypeObjectUtils::build_common_struct_member(member_id_my_float128, member_flags_my_float128, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_float128 = TypeObjectUtils::build_common_struct_member(member_id_my_float128, member_flags_my_float128, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_float128 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_float128 = "my_float128"; - eprosima::fastcdr::optional member_ann_builtin_my_float128; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_float128 = TypeObjectUtils::build_complete_member_detail(name_my_float128, member_ann_builtin_my_float128, ann_custom_BasicStruct); - CompleteStructMember member_my_float128 = TypeObjectUtils::build_complete_struct_member(common_my_float128, detail_my_float128); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_float128); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_char", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_char Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_char = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_char; - MemberId member_id_my_char = 0x0000000b; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_char = TypeObjectUtils::build_common_struct_member(member_id_my_char, member_flags_my_char, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_char = TypeObjectUtils::build_common_struct_member(member_id_my_char, member_flags_my_char, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_char member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_char = "my_char"; - eprosima::fastcdr::optional member_ann_builtin_my_char; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_char = TypeObjectUtils::build_complete_member_detail(name_my_char, member_ann_builtin_my_char, ann_custom_BasicStruct); - CompleteStructMember member_my_char = TypeObjectUtils::build_complete_struct_member(common_my_char, detail_my_char); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_char); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_string_unbounded", type_ids_BasicStruct); - - if (return_code_BasicStruct != 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_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_string_unbounded", type_ids_BasicStruct); - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_string_unbounded: Given String TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_string = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_string; - MemberId member_id_my_string = 0x0000000c; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_string = TypeObjectUtils::build_common_struct_member(member_id_my_string, member_flags_my_string, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_string = TypeObjectUtils::build_common_struct_member(member_id_my_string, member_flags_my_string, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_string member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_string = "my_string"; - eprosima::fastcdr::optional member_ann_builtin_my_string; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_string = TypeObjectUtils::build_complete_member_detail(name_my_string, member_ann_builtin_my_string, ann_custom_BasicStruct); - CompleteStructMember member_my_string = TypeObjectUtils::build_complete_struct_member(common_my_string, detail_my_string); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_string); - } - CompleteStructType struct_type_BasicStruct = TypeObjectUtils::build_complete_struct_type(struct_flags_BasicStruct, header_BasicStruct, member_seq_BasicStruct); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_BasicStruct, type_name_BasicStruct.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "BasicStruct already registered in TypeObjectRegistry for a different type."); - } - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "BasicStruct", type_ids_BasicStruct); - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "BasicStruct: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - } - StructMemberFlag member_flags_my_basic_struct = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_basic_struct; - MemberId member_id_my_basic_struct = 0x00000001; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_basic_struct = TypeObjectUtils::build_common_struct_member(member_id_my_basic_struct, member_flags_my_basic_struct, type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_basic_struct = TypeObjectUtils::build_common_struct_member(member_id_my_basic_struct, member_flags_my_basic_struct, type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_basic_struct member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_basic_struct = "my_basic_struct"; - eprosima::fastcdr::optional member_ann_builtin_my_basic_struct; - ann_custom_ComplexStruct.reset(); - CompleteMemberDetail detail_my_basic_struct = TypeObjectUtils::build_complete_member_detail(name_my_basic_struct, member_ann_builtin_my_basic_struct, ann_custom_ComplexStruct); - CompleteStructMember member_my_basic_struct = TypeObjectUtils::build_complete_struct_member(common_my_basic_struct, detail_my_basic_struct); - TypeObjectUtils::add_complete_struct_member(member_seq_ComplexStruct, member_my_basic_struct); - } - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyAliasEnum", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - AliasTypeFlag alias_flags_MyAliasEnum = 0; - QualifiedTypeName type_name_MyAliasEnum = "MyAliasEnum"; - eprosima::fastcdr::optional type_ann_builtin_MyAliasEnum; - eprosima::fastcdr::optional ann_custom_MyAliasEnum; - CompleteTypeDetail detail_MyAliasEnum = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_MyAliasEnum, ann_custom_MyAliasEnum, type_name_MyAliasEnum.to_string()); - CompleteAliasHeader header_MyAliasEnum = TypeObjectUtils::build_complete_alias_header(detail_MyAliasEnum); - AliasMemberFlag related_flags_MyAliasEnum = 0; - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyEnum", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EnumTypeFlag enum_flags_MyEnum = 0; - BitBound bit_bound_MyEnum = 32; - CommonEnumeratedHeader common_MyEnum = TypeObjectUtils::build_common_enumerated_header(bit_bound_MyEnum); - QualifiedTypeName type_name_MyEnum = "MyEnum"; - eprosima::fastcdr::optional type_ann_builtin_MyEnum; - eprosima::fastcdr::optional ann_custom_MyEnum; - CompleteTypeDetail detail_MyEnum = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_MyEnum, ann_custom_MyEnum, type_name_MyEnum.to_string()); - CompleteEnumeratedHeader header_MyEnum = TypeObjectUtils::build_complete_enumerated_header(common_MyEnum, detail_MyEnum); - CompleteEnumeratedLiteralSeq literal_seq_MyEnum; - { - EnumeratedLiteralFlag flags_A = TypeObjectUtils::build_enumerated_literal_flag(false); - CommonEnumeratedLiteral common_A = TypeObjectUtils::build_common_enumerated_literal(0, flags_A); - eprosima::fastcdr::optional member_ann_builtin_A; - ann_custom_MyEnum.reset(); - MemberName name_A = "A"; - CompleteMemberDetail detail_A = TypeObjectUtils::build_complete_member_detail(name_A, member_ann_builtin_A, ann_custom_MyEnum); - CompleteEnumeratedLiteral literal_A = TypeObjectUtils::build_complete_enumerated_literal(common_A, detail_A); - TypeObjectUtils::add_complete_enumerated_literal(literal_seq_MyEnum, literal_A); - } - { - EnumeratedLiteralFlag flags_B = TypeObjectUtils::build_enumerated_literal_flag(false); - CommonEnumeratedLiteral common_B = TypeObjectUtils::build_common_enumerated_literal(1, flags_B); - eprosima::fastcdr::optional member_ann_builtin_B; - ann_custom_MyEnum.reset(); - MemberName name_B = "B"; - CompleteMemberDetail detail_B = TypeObjectUtils::build_complete_member_detail(name_B, member_ann_builtin_B, ann_custom_MyEnum); - CompleteEnumeratedLiteral literal_B = TypeObjectUtils::build_complete_enumerated_literal(common_B, detail_B); - TypeObjectUtils::add_complete_enumerated_literal(literal_seq_MyEnum, literal_B); - } - { - EnumeratedLiteralFlag flags_C = TypeObjectUtils::build_enumerated_literal_flag(false); - CommonEnumeratedLiteral common_C = TypeObjectUtils::build_common_enumerated_literal(2, flags_C); - eprosima::fastcdr::optional member_ann_builtin_C; - ann_custom_MyEnum.reset(); - MemberName name_C = "C"; - CompleteMemberDetail detail_C = TypeObjectUtils::build_complete_member_detail(name_C, member_ann_builtin_C, ann_custom_MyEnum); - CompleteEnumeratedLiteral literal_C = TypeObjectUtils::build_complete_enumerated_literal(common_C, detail_C); - TypeObjectUtils::add_complete_enumerated_literal(literal_seq_MyEnum, literal_C); - } - CompleteEnumeratedType enumerated_type_MyEnum = TypeObjectUtils::build_complete_enumerated_type(enum_flags_MyEnum, header_MyEnum, - literal_seq_MyEnum); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_enumerated_type_object(enumerated_type_MyEnum, type_name_MyEnum.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyEnum already registered in TypeObjectRegistry for a different type."); - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyEnum", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyEnum: Given Enum TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - CommonAliasBody common_MyAliasEnum; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_MyAliasEnum = TypeObjectUtils::build_common_alias_body(related_flags_MyAliasEnum, type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_MyAliasEnum = TypeObjectUtils::build_common_alias_body(related_flags_MyAliasEnum, type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyAliasEnum related TypeIdentifier inconsistent."); - return; - } - eprosima::fastcdr::optional member_ann_builtin_MyAliasEnum; - ann_custom_MyAliasEnum.reset(); - CompleteAliasBody body_MyAliasEnum = TypeObjectUtils::build_complete_alias_body(common_MyAliasEnum, member_ann_builtin_MyAliasEnum, ann_custom_MyAliasEnum); - CompleteAliasType alias_type_MyAliasEnum = TypeObjectUtils::build_complete_alias_type(alias_flags_MyAliasEnum, header_MyAliasEnum, body_MyAliasEnum); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_alias_type_object(alias_type_MyAliasEnum, type_name_MyAliasEnum.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyAliasEnum already registered in TypeObjectRegistry for a different type."); - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyAliasEnum", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyAliasEnum: Given Alias TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_alias_enum = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_alias_enum; - MemberId member_id_my_alias_enum = 0x00000002; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_alias_enum = TypeObjectUtils::build_common_struct_member(member_id_my_alias_enum, member_flags_my_alias_enum, type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_alias_enum = TypeObjectUtils::build_common_struct_member(member_id_my_alias_enum, member_flags_my_alias_enum, type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_alias_enum member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_alias_enum = "my_alias_enum"; - eprosima::fastcdr::optional member_ann_builtin_my_alias_enum; - ann_custom_ComplexStruct.reset(); - CompleteMemberDetail detail_my_alias_enum = TypeObjectUtils::build_complete_member_detail(name_my_alias_enum, member_ann_builtin_my_alias_enum, ann_custom_ComplexStruct); - CompleteStructMember member_my_alias_enum = TypeObjectUtils::build_complete_struct_member(common_my_alias_enum, detail_my_alias_enum); - TypeObjectUtils::add_complete_struct_member(member_seq_ComplexStruct, member_my_alias_enum); - } - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyEnum", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EnumTypeFlag enum_flags_MyEnum = 0; - BitBound bit_bound_MyEnum = 32; - CommonEnumeratedHeader common_MyEnum = TypeObjectUtils::build_common_enumerated_header(bit_bound_MyEnum); - QualifiedTypeName type_name_MyEnum = "MyEnum"; - eprosima::fastcdr::optional type_ann_builtin_MyEnum; - eprosima::fastcdr::optional ann_custom_MyEnum; - CompleteTypeDetail detail_MyEnum = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_MyEnum, ann_custom_MyEnum, type_name_MyEnum.to_string()); - CompleteEnumeratedHeader header_MyEnum = TypeObjectUtils::build_complete_enumerated_header(common_MyEnum, detail_MyEnum); - CompleteEnumeratedLiteralSeq literal_seq_MyEnum; - { - EnumeratedLiteralFlag flags_A = TypeObjectUtils::build_enumerated_literal_flag(false); - CommonEnumeratedLiteral common_A = TypeObjectUtils::build_common_enumerated_literal(0, flags_A); - eprosima::fastcdr::optional member_ann_builtin_A; - ann_custom_MyEnum.reset(); - MemberName name_A = "A"; - CompleteMemberDetail detail_A = TypeObjectUtils::build_complete_member_detail(name_A, member_ann_builtin_A, ann_custom_MyEnum); - CompleteEnumeratedLiteral literal_A = TypeObjectUtils::build_complete_enumerated_literal(common_A, detail_A); - TypeObjectUtils::add_complete_enumerated_literal(literal_seq_MyEnum, literal_A); - } - { - EnumeratedLiteralFlag flags_B = TypeObjectUtils::build_enumerated_literal_flag(false); - CommonEnumeratedLiteral common_B = TypeObjectUtils::build_common_enumerated_literal(1, flags_B); - eprosima::fastcdr::optional member_ann_builtin_B; - ann_custom_MyEnum.reset(); - MemberName name_B = "B"; - CompleteMemberDetail detail_B = TypeObjectUtils::build_complete_member_detail(name_B, member_ann_builtin_B, ann_custom_MyEnum); - CompleteEnumeratedLiteral literal_B = TypeObjectUtils::build_complete_enumerated_literal(common_B, detail_B); - TypeObjectUtils::add_complete_enumerated_literal(literal_seq_MyEnum, literal_B); - } - { - EnumeratedLiteralFlag flags_C = TypeObjectUtils::build_enumerated_literal_flag(false); - CommonEnumeratedLiteral common_C = TypeObjectUtils::build_common_enumerated_literal(2, flags_C); - eprosima::fastcdr::optional member_ann_builtin_C; - ann_custom_MyEnum.reset(); - MemberName name_C = "C"; - CompleteMemberDetail detail_C = TypeObjectUtils::build_complete_member_detail(name_C, member_ann_builtin_C, ann_custom_MyEnum); - CompleteEnumeratedLiteral literal_C = TypeObjectUtils::build_complete_enumerated_literal(common_C, detail_C); - TypeObjectUtils::add_complete_enumerated_literal(literal_seq_MyEnum, literal_C); - } - CompleteEnumeratedType enumerated_type_MyEnum = TypeObjectUtils::build_complete_enumerated_type(enum_flags_MyEnum, header_MyEnum, - literal_seq_MyEnum); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_enumerated_type_object(enumerated_type_MyEnum, type_name_MyEnum.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyEnum already registered in TypeObjectRegistry for a different type."); - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyEnum", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyEnum: Given Enum TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_enum = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_enum; - MemberId member_id_my_enum = 0x00000003; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_enum = TypeObjectUtils::build_common_struct_member(member_id_my_enum, member_flags_my_enum, type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_enum = TypeObjectUtils::build_common_struct_member(member_id_my_enum, member_flags_my_enum, type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_enum member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_enum = "my_enum"; - eprosima::fastcdr::optional member_ann_builtin_my_enum; - ann_custom_ComplexStruct.reset(); - CompleteMemberDetail detail_my_enum = TypeObjectUtils::build_complete_member_detail(name_my_enum, member_ann_builtin_my_enum, ann_custom_ComplexStruct); - CompleteStructMember member_my_enum = TypeObjectUtils::build_complete_struct_member(common_my_enum, detail_my_enum); - TypeObjectUtils::add_complete_struct_member(member_seq_ComplexStruct, member_my_enum); - } - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_sequence_uint8_t_55", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_byte", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != 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_55 {nullptr}; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_sequence_uint8_t_55 = new TypeIdentifier(type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_sequence_uint8_t_55 = new TypeIdentifier(type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Sequence element TypeIdentifier inconsistent."); - return; - } - EquivalenceKind equiv_kind_anonymous_sequence_uint8_t_55 = EK_COMPLETE; - if (TK_NONE == type_ids_ComplexStruct.type_identifier2()._d()) - { - equiv_kind_anonymous_sequence_uint8_t_55 = EK_BOTH; - } - CollectionElementFlag element_flags_anonymous_sequence_uint8_t_55 = 0; - PlainCollectionHeader header_anonymous_sequence_uint8_t_55 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_sequence_uint8_t_55, element_flags_anonymous_sequence_uint8_t_55); - std::string type_id_kind_anonymous_sequence_uint8_t_55("TI_PLAIN_SEQUENCE_SMALL"); - if (type_id_kind_anonymous_sequence_uint8_t_55 == "TI_PLAIN_SEQUENCE_SMALL") - { - SBound bound = static_cast(55); - PlainSequenceSElemDefn seq_sdefn = TypeObjectUtils::build_plain_sequence_s_elem_defn(header_anonymous_sequence_uint8_t_55, bound, - eprosima::fastcdr::external(element_identifier_anonymous_sequence_uint8_t_55)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_s_sequence_type_identifier(seq_sdefn, "anonymous_sequence_uint8_t_55")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_sequence_uint8_t_55 already registered in TypeObjectRegistry for a different type."); - } - } - else - { - LBound bound = 55; - PlainSequenceLElemDefn seq_ldefn = TypeObjectUtils::build_plain_sequence_l_elem_defn(header_anonymous_sequence_uint8_t_55, bound, - eprosima::fastcdr::external(element_identifier_anonymous_sequence_uint8_t_55)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_l_sequence_type_identifier(seq_ldefn, "anonymous_sequence_uint8_t_55")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_sequence_uint8_t_55 already registered in TypeObjectRegistry for a different type."); - } - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_sequence_uint8_t_55", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_sequence_uint8_t_55: Given Sequence TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_sequence_octet = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_sequence_octet; - MemberId member_id_my_sequence_octet = 0x00000004; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_sequence_octet = TypeObjectUtils::build_common_struct_member(member_id_my_sequence_octet, member_flags_my_sequence_octet, type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_sequence_octet = TypeObjectUtils::build_common_struct_member(member_id_my_sequence_octet, member_flags_my_sequence_octet, type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_sequence_octet member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_sequence_octet = "my_sequence_octet"; - eprosima::fastcdr::optional member_ann_builtin_my_sequence_octet; - ann_custom_ComplexStruct.reset(); - CompleteMemberDetail detail_my_sequence_octet = TypeObjectUtils::build_complete_member_detail(name_my_sequence_octet, member_ann_builtin_my_sequence_octet, ann_custom_ComplexStruct); - CompleteStructMember member_my_sequence_octet = TypeObjectUtils::build_complete_struct_member(common_my_sequence_octet, detail_my_sequence_octet); - TypeObjectUtils::add_complete_struct_member(member_seq_ComplexStruct, member_my_sequence_octet); - } - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_sequence_BasicStruct_unbounded", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "BasicStruct", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - { - StructTypeFlag struct_flags_BasicStruct = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_BasicStruct; - TypeIdentifierPair type_ids_BasicStruct; - QualifiedTypeName type_name_BasicStruct = "BasicStruct"; - eprosima::fastcdr::optional type_ann_builtin_BasicStruct; - eprosima::fastcdr::optional ann_custom_BasicStruct; - CompleteTypeDetail detail_BasicStruct = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_BasicStruct, ann_custom_BasicStruct, type_name_BasicStruct.to_string()); - CompleteStructHeader header_BasicStruct; - header_BasicStruct = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_BasicStruct); - CompleteStructMemberSeq member_seq_BasicStruct; - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_bool", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_bool Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_bool = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_bool; - MemberId member_id_my_bool = 0x00000000; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_bool = TypeObjectUtils::build_common_struct_member(member_id_my_bool, member_flags_my_bool, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_bool = TypeObjectUtils::build_common_struct_member(member_id_my_bool, member_flags_my_bool, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_bool member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_bool = "my_bool"; - eprosima::fastcdr::optional member_ann_builtin_my_bool; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_bool = TypeObjectUtils::build_complete_member_detail(name_my_bool, member_ann_builtin_my_bool, ann_custom_BasicStruct); - CompleteStructMember member_my_bool = TypeObjectUtils::build_complete_struct_member(common_my_bool, detail_my_bool); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_bool); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_byte", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_octet Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_octet = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_octet; - MemberId member_id_my_octet = 0x00000001; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_octet = TypeObjectUtils::build_common_struct_member(member_id_my_octet, member_flags_my_octet, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_octet = TypeObjectUtils::build_common_struct_member(member_id_my_octet, member_flags_my_octet, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_octet member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_octet = "my_octet"; - eprosima::fastcdr::optional member_ann_builtin_my_octet; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_octet = TypeObjectUtils::build_complete_member_detail(name_my_octet, member_ann_builtin_my_octet, ann_custom_BasicStruct); - CompleteStructMember member_my_octet = TypeObjectUtils::build_complete_struct_member(common_my_octet, detail_my_octet); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_octet); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int16_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_int16 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_int16 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_int16; - MemberId member_id_my_int16 = 0x00000002; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_int16 = TypeObjectUtils::build_common_struct_member(member_id_my_int16, member_flags_my_int16, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_int16 = TypeObjectUtils::build_common_struct_member(member_id_my_int16, member_flags_my_int16, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_int16 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_int16 = "my_int16"; - eprosima::fastcdr::optional member_ann_builtin_my_int16; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_int16 = TypeObjectUtils::build_complete_member_detail(name_my_int16, member_ann_builtin_my_int16, ann_custom_BasicStruct); - CompleteStructMember member_my_int16 = TypeObjectUtils::build_complete_struct_member(common_my_int16, detail_my_int16); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_int16); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_int32 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_int32 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_int32; - MemberId member_id_my_int32 = 0x00000003; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_int32 = TypeObjectUtils::build_common_struct_member(member_id_my_int32, member_flags_my_int32, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_int32 = TypeObjectUtils::build_common_struct_member(member_id_my_int32, member_flags_my_int32, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_int32 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_int32 = "my_int32"; - eprosima::fastcdr::optional member_ann_builtin_my_int32; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_int32 = TypeObjectUtils::build_complete_member_detail(name_my_int32, member_ann_builtin_my_int32, ann_custom_BasicStruct); - CompleteStructMember member_my_int32 = TypeObjectUtils::build_complete_struct_member(common_my_int32, detail_my_int32); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_int32); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int64_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_int64 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_int64 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_int64; - MemberId member_id_my_int64 = 0x00000004; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_int64 = TypeObjectUtils::build_common_struct_member(member_id_my_int64, member_flags_my_int64, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_int64 = TypeObjectUtils::build_common_struct_member(member_id_my_int64, member_flags_my_int64, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_int64 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_int64 = "my_int64"; - eprosima::fastcdr::optional member_ann_builtin_my_int64; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_int64 = TypeObjectUtils::build_complete_member_detail(name_my_int64, member_ann_builtin_my_int64, ann_custom_BasicStruct); - CompleteStructMember member_my_int64 = TypeObjectUtils::build_complete_struct_member(common_my_int64, detail_my_int64); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_int64); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_uint16_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_uint16 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_uint16 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_uint16; - MemberId member_id_my_uint16 = 0x00000005; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_uint16 = TypeObjectUtils::build_common_struct_member(member_id_my_uint16, member_flags_my_uint16, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_uint16 = TypeObjectUtils::build_common_struct_member(member_id_my_uint16, member_flags_my_uint16, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_uint16 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_uint16 = "my_uint16"; - eprosima::fastcdr::optional member_ann_builtin_my_uint16; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_uint16 = TypeObjectUtils::build_complete_member_detail(name_my_uint16, member_ann_builtin_my_uint16, ann_custom_BasicStruct); - CompleteStructMember member_my_uint16 = TypeObjectUtils::build_complete_struct_member(common_my_uint16, detail_my_uint16); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_uint16); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_uint32_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_uint32 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_uint32 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_uint32; - MemberId member_id_my_uint32 = 0x00000006; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_uint32 = TypeObjectUtils::build_common_struct_member(member_id_my_uint32, member_flags_my_uint32, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_uint32 = TypeObjectUtils::build_common_struct_member(member_id_my_uint32, member_flags_my_uint32, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_uint32 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_uint32 = "my_uint32"; - eprosima::fastcdr::optional member_ann_builtin_my_uint32; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_uint32 = TypeObjectUtils::build_complete_member_detail(name_my_uint32, member_ann_builtin_my_uint32, ann_custom_BasicStruct); - CompleteStructMember member_my_uint32 = TypeObjectUtils::build_complete_struct_member(common_my_uint32, detail_my_uint32); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_uint32); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_uint64_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_uint64 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_uint64 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_uint64; - MemberId member_id_my_uint64 = 0x00000007; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_uint64 = TypeObjectUtils::build_common_struct_member(member_id_my_uint64, member_flags_my_uint64, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_uint64 = TypeObjectUtils::build_common_struct_member(member_id_my_uint64, member_flags_my_uint64, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_uint64 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_uint64 = "my_uint64"; - eprosima::fastcdr::optional member_ann_builtin_my_uint64; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_uint64 = TypeObjectUtils::build_complete_member_detail(name_my_uint64, member_ann_builtin_my_uint64, ann_custom_BasicStruct); - CompleteStructMember member_my_uint64 = TypeObjectUtils::build_complete_struct_member(common_my_uint64, detail_my_uint64); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_uint64); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_float", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_float32 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_float32 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_float32; - MemberId member_id_my_float32 = 0x00000008; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_float32 = TypeObjectUtils::build_common_struct_member(member_id_my_float32, member_flags_my_float32, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_float32 = TypeObjectUtils::build_common_struct_member(member_id_my_float32, member_flags_my_float32, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_float32 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_float32 = "my_float32"; - eprosima::fastcdr::optional member_ann_builtin_my_float32; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_float32 = TypeObjectUtils::build_complete_member_detail(name_my_float32, member_ann_builtin_my_float32, ann_custom_BasicStruct); - CompleteStructMember member_my_float32 = TypeObjectUtils::build_complete_struct_member(common_my_float32, detail_my_float32); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_float32); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_double", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_float64 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_float64 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_float64; - MemberId member_id_my_float64 = 0x00000009; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_float64 = TypeObjectUtils::build_common_struct_member(member_id_my_float64, member_flags_my_float64, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_float64 = TypeObjectUtils::build_common_struct_member(member_id_my_float64, member_flags_my_float64, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_float64 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_float64 = "my_float64"; - eprosima::fastcdr::optional member_ann_builtin_my_float64; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_float64 = TypeObjectUtils::build_complete_member_detail(name_my_float64, member_ann_builtin_my_float64, ann_custom_BasicStruct); - CompleteStructMember member_my_float64 = TypeObjectUtils::build_complete_struct_member(common_my_float64, detail_my_float64); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_float64); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_longdouble", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_float128 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_float128 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_float128; - MemberId member_id_my_float128 = 0x0000000a; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_float128 = TypeObjectUtils::build_common_struct_member(member_id_my_float128, member_flags_my_float128, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_float128 = TypeObjectUtils::build_common_struct_member(member_id_my_float128, member_flags_my_float128, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_float128 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_float128 = "my_float128"; - eprosima::fastcdr::optional member_ann_builtin_my_float128; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_float128 = TypeObjectUtils::build_complete_member_detail(name_my_float128, member_ann_builtin_my_float128, ann_custom_BasicStruct); - CompleteStructMember member_my_float128 = TypeObjectUtils::build_complete_struct_member(common_my_float128, detail_my_float128); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_float128); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_char", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_char Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_char = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_char; - MemberId member_id_my_char = 0x0000000b; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_char = TypeObjectUtils::build_common_struct_member(member_id_my_char, member_flags_my_char, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_char = TypeObjectUtils::build_common_struct_member(member_id_my_char, member_flags_my_char, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_char member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_char = "my_char"; - eprosima::fastcdr::optional member_ann_builtin_my_char; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_char = TypeObjectUtils::build_complete_member_detail(name_my_char, member_ann_builtin_my_char, ann_custom_BasicStruct); - CompleteStructMember member_my_char = TypeObjectUtils::build_complete_struct_member(common_my_char, detail_my_char); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_char); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_string_unbounded", type_ids_BasicStruct); - - if (return_code_BasicStruct != 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_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_string_unbounded", type_ids_BasicStruct); - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_string_unbounded: Given String TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_string = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_string; - MemberId member_id_my_string = 0x0000000c; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_string = TypeObjectUtils::build_common_struct_member(member_id_my_string, member_flags_my_string, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_string = TypeObjectUtils::build_common_struct_member(member_id_my_string, member_flags_my_string, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_string member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_string = "my_string"; - eprosima::fastcdr::optional member_ann_builtin_my_string; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_string = TypeObjectUtils::build_complete_member_detail(name_my_string, member_ann_builtin_my_string, ann_custom_BasicStruct); - CompleteStructMember member_my_string = TypeObjectUtils::build_complete_struct_member(common_my_string, detail_my_string); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_string); - } - CompleteStructType struct_type_BasicStruct = TypeObjectUtils::build_complete_struct_type(struct_flags_BasicStruct, header_BasicStruct, member_seq_BasicStruct); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_BasicStruct, type_name_BasicStruct.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "BasicStruct already registered in TypeObjectRegistry for a different type."); - } - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "BasicStruct", type_ids_BasicStruct); - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "BasicStruct: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - } - TypeIdentifier* element_identifier_anonymous_sequence_BasicStruct_unbounded {nullptr}; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_sequence_BasicStruct_unbounded = new TypeIdentifier(type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_sequence_BasicStruct_unbounded = new TypeIdentifier(type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Sequence element TypeIdentifier inconsistent."); - return; - } - EquivalenceKind equiv_kind_anonymous_sequence_BasicStruct_unbounded = EK_COMPLETE; - if (TK_NONE == type_ids_ComplexStruct.type_identifier2()._d()) - { - equiv_kind_anonymous_sequence_BasicStruct_unbounded = EK_BOTH; - } - CollectionElementFlag element_flags_anonymous_sequence_BasicStruct_unbounded = 0; - PlainCollectionHeader header_anonymous_sequence_BasicStruct_unbounded = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_sequence_BasicStruct_unbounded, element_flags_anonymous_sequence_BasicStruct_unbounded); - std::string type_id_kind_anonymous_sequence_BasicStruct_unbounded("TI_PLAIN_SEQUENCE_SMALL"); - if (type_id_kind_anonymous_sequence_BasicStruct_unbounded == "TI_PLAIN_SEQUENCE_SMALL") - { - SBound bound = 0; - PlainSequenceSElemDefn seq_sdefn = TypeObjectUtils::build_plain_sequence_s_elem_defn(header_anonymous_sequence_BasicStruct_unbounded, bound, - eprosima::fastcdr::external(element_identifier_anonymous_sequence_BasicStruct_unbounded)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_s_sequence_type_identifier(seq_sdefn, "anonymous_sequence_BasicStruct_unbounded")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_sequence_BasicStruct_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_BasicStruct_unbounded, bound, - eprosima::fastcdr::external(element_identifier_anonymous_sequence_BasicStruct_unbounded)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_l_sequence_type_identifier(seq_ldefn, "anonymous_sequence_BasicStruct_unbounded")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_sequence_BasicStruct_unbounded already registered in TypeObjectRegistry for a different type."); - } - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_sequence_BasicStruct_unbounded", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_sequence_BasicStruct_unbounded: Given Sequence TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_sequence_struct = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_sequence_struct; - MemberId member_id_my_sequence_struct = 0x00000005; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_sequence_struct = TypeObjectUtils::build_common_struct_member(member_id_my_sequence_struct, member_flags_my_sequence_struct, type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_sequence_struct = TypeObjectUtils::build_common_struct_member(member_id_my_sequence_struct, member_flags_my_sequence_struct, type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_sequence_struct member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_sequence_struct = "my_sequence_struct"; - eprosima::fastcdr::optional member_ann_builtin_my_sequence_struct; - ann_custom_ComplexStruct.reset(); - CompleteMemberDetail detail_my_sequence_struct = TypeObjectUtils::build_complete_member_detail(name_my_sequence_struct, member_ann_builtin_my_sequence_struct, ann_custom_ComplexStruct); - CompleteStructMember member_my_sequence_struct = TypeObjectUtils::build_complete_struct_member(common_my_sequence_struct, detail_my_sequence_struct); - TypeObjectUtils::add_complete_struct_member(member_seq_ComplexStruct, member_my_sequence_struct); - } - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_array_char_500_5_4", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_char", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Array element TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - TypeIdentifier* element_identifier_anonymous_array_char_500_5_4 {nullptr}; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_array_char_500_5_4 = new TypeIdentifier(type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_array_char_500_5_4 = new TypeIdentifier(type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Array element TypeIdentifier inconsistent."); - return; - } - EquivalenceKind equiv_kind_anonymous_array_char_500_5_4 = EK_COMPLETE; - if (TK_NONE == type_ids_ComplexStruct.type_identifier2()._d()) - { - equiv_kind_anonymous_array_char_500_5_4 = EK_BOTH; - } - CollectionElementFlag element_flags_anonymous_array_char_500_5_4 = 0; - PlainCollectionHeader header_anonymous_array_char_500_5_4 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_char_500_5_4, element_flags_anonymous_array_char_500_5_4); - std::string type_id_kind_anonymous_array_char_500_5_4("TI_PLAIN_ARRAY_LARGE"); - if (type_id_kind_anonymous_array_char_500_5_4 == "TI_PLAIN_ARRAY_SMALL") - { - SBoundSeq array_bound_seq; - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(500)); - - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(5)); - - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); - - PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_char_500_5_4, array_bound_seq, - eprosima::fastcdr::external(element_identifier_anonymous_array_char_500_5_4)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_char_500_5_4")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_char_500_5_4 already registered in TypeObjectRegistry for a different type."); - } - } - else - { - LBoundSeq array_bound_seq; - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(500)); - - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(5)); - - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); - - PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_char_500_5_4, array_bound_seq, - eprosima::fastcdr::external(element_identifier_anonymous_array_char_500_5_4)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_char_500_5_4")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_char_500_5_4 already registered in TypeObjectRegistry for a different type."); - } - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_array_char_500_5_4", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_char_500_5_4: Given Array TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_array_octet = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_array_octet; - MemberId member_id_my_array_octet = 0x00000006; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_array_octet = TypeObjectUtils::build_common_struct_member(member_id_my_array_octet, member_flags_my_array_octet, type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_array_octet = TypeObjectUtils::build_common_struct_member(member_id_my_array_octet, member_flags_my_array_octet, type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_array_octet member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_array_octet = "my_array_octet"; - eprosima::fastcdr::optional member_ann_builtin_my_array_octet; - ann_custom_ComplexStruct.reset(); - CompleteMemberDetail detail_my_array_octet = TypeObjectUtils::build_complete_member_detail(name_my_array_octet, member_ann_builtin_my_array_octet, ann_custom_ComplexStruct); - CompleteStructMember member_my_array_octet = TypeObjectUtils::build_complete_struct_member(common_my_array_octet, detail_my_array_octet); - TypeObjectUtils::add_complete_struct_member(member_seq_ComplexStruct, member_my_array_octet); - } - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyOctetArray500", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - AliasTypeFlag alias_flags_MyOctetArray500 = 0; - QualifiedTypeName type_name_MyOctetArray500 = "MyOctetArray500"; - eprosima::fastcdr::optional type_ann_builtin_MyOctetArray500; - eprosima::fastcdr::optional ann_custom_MyOctetArray500; - CompleteTypeDetail detail_MyOctetArray500 = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_MyOctetArray500, ann_custom_MyOctetArray500, type_name_MyOctetArray500.to_string()); - CompleteAliasHeader header_MyOctetArray500 = TypeObjectUtils::build_complete_alias_header(detail_MyOctetArray500); - AliasMemberFlag related_flags_MyOctetArray500 = 0; - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_array_uint8_t_500", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_byte", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Array element TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - TypeIdentifier* element_identifier_anonymous_array_uint8_t_500 {nullptr}; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_array_uint8_t_500 = new TypeIdentifier(type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_array_uint8_t_500 = new TypeIdentifier(type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Array element TypeIdentifier inconsistent."); - return; - } - EquivalenceKind equiv_kind_anonymous_array_uint8_t_500 = EK_COMPLETE; - if (TK_NONE == type_ids_ComplexStruct.type_identifier2()._d()) - { - equiv_kind_anonymous_array_uint8_t_500 = EK_BOTH; - } - CollectionElementFlag element_flags_anonymous_array_uint8_t_500 = 0; - PlainCollectionHeader header_anonymous_array_uint8_t_500 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_500, element_flags_anonymous_array_uint8_t_500); - std::string type_id_kind_anonymous_array_uint8_t_500("TI_PLAIN_ARRAY_LARGE"); - if (type_id_kind_anonymous_array_uint8_t_500 == "TI_PLAIN_ARRAY_SMALL") - { - SBoundSeq array_bound_seq; - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(500)); - - PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_500, array_bound_seq, - eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_500)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_500")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_uint8_t_500 already registered in TypeObjectRegistry for a different type."); - } - } - else - { - LBoundSeq array_bound_seq; - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(500)); - - PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_500, array_bound_seq, - eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_500)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_500")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_uint8_t_500 already registered in TypeObjectRegistry for a different type."); - } - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_array_uint8_t_500", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_uint8_t_500: Given Array TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - CommonAliasBody common_MyOctetArray500; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_MyOctetArray500 = TypeObjectUtils::build_common_alias_body(related_flags_MyOctetArray500, type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_MyOctetArray500 = TypeObjectUtils::build_common_alias_body(related_flags_MyOctetArray500, type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyOctetArray500 related TypeIdentifier inconsistent."); - return; - } - eprosima::fastcdr::optional member_ann_builtin_MyOctetArray500; - ann_custom_MyOctetArray500.reset(); - CompleteAliasBody body_MyOctetArray500 = TypeObjectUtils::build_complete_alias_body(common_MyOctetArray500, member_ann_builtin_MyOctetArray500, ann_custom_MyOctetArray500); - CompleteAliasType alias_type_MyOctetArray500 = TypeObjectUtils::build_complete_alias_type(alias_flags_MyOctetArray500, header_MyOctetArray500, body_MyOctetArray500); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_alias_type_object(alias_type_MyOctetArray500, type_name_MyOctetArray500.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyOctetArray500 already registered in TypeObjectRegistry for a different type."); - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyOctetArray500", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyOctetArray500: Given Alias TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_octet_array_500 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_octet_array_500; - MemberId member_id_my_octet_array_500 = 0x00000007; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_octet_array_500 = TypeObjectUtils::build_common_struct_member(member_id_my_octet_array_500, member_flags_my_octet_array_500, type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_octet_array_500 = TypeObjectUtils::build_common_struct_member(member_id_my_octet_array_500, member_flags_my_octet_array_500, type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_octet_array_500 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_octet_array_500 = "my_octet_array_500"; - eprosima::fastcdr::optional member_ann_builtin_my_octet_array_500; - ann_custom_ComplexStruct.reset(); - CompleteMemberDetail detail_my_octet_array_500 = TypeObjectUtils::build_complete_member_detail(name_my_octet_array_500, member_ann_builtin_my_octet_array_500, ann_custom_ComplexStruct); - CompleteStructMember member_my_octet_array_500 = TypeObjectUtils::build_complete_struct_member(common_my_octet_array_500, detail_my_octet_array_500); - TypeObjectUtils::add_complete_struct_member(member_seq_ComplexStruct, member_my_octet_array_500); - } - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_array_BasicStruct_5", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "BasicStruct", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - { - StructTypeFlag struct_flags_BasicStruct = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_BasicStruct; - TypeIdentifierPair type_ids_BasicStruct; - QualifiedTypeName type_name_BasicStruct = "BasicStruct"; - eprosima::fastcdr::optional type_ann_builtin_BasicStruct; - eprosima::fastcdr::optional ann_custom_BasicStruct; - CompleteTypeDetail detail_BasicStruct = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_BasicStruct, ann_custom_BasicStruct, type_name_BasicStruct.to_string()); - CompleteStructHeader header_BasicStruct; - header_BasicStruct = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_BasicStruct); - CompleteStructMemberSeq member_seq_BasicStruct; - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_bool", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_bool Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_bool = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_bool; - MemberId member_id_my_bool = 0x00000000; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_bool = TypeObjectUtils::build_common_struct_member(member_id_my_bool, member_flags_my_bool, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_bool = TypeObjectUtils::build_common_struct_member(member_id_my_bool, member_flags_my_bool, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_bool member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_bool = "my_bool"; - eprosima::fastcdr::optional member_ann_builtin_my_bool; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_bool = TypeObjectUtils::build_complete_member_detail(name_my_bool, member_ann_builtin_my_bool, ann_custom_BasicStruct); - CompleteStructMember member_my_bool = TypeObjectUtils::build_complete_struct_member(common_my_bool, detail_my_bool); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_bool); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_byte", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_octet Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_octet = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_octet; - MemberId member_id_my_octet = 0x00000001; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_octet = TypeObjectUtils::build_common_struct_member(member_id_my_octet, member_flags_my_octet, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_octet = TypeObjectUtils::build_common_struct_member(member_id_my_octet, member_flags_my_octet, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_octet member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_octet = "my_octet"; - eprosima::fastcdr::optional member_ann_builtin_my_octet; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_octet = TypeObjectUtils::build_complete_member_detail(name_my_octet, member_ann_builtin_my_octet, ann_custom_BasicStruct); - CompleteStructMember member_my_octet = TypeObjectUtils::build_complete_struct_member(common_my_octet, detail_my_octet); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_octet); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int16_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_int16 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_int16 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_int16; - MemberId member_id_my_int16 = 0x00000002; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_int16 = TypeObjectUtils::build_common_struct_member(member_id_my_int16, member_flags_my_int16, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_int16 = TypeObjectUtils::build_common_struct_member(member_id_my_int16, member_flags_my_int16, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_int16 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_int16 = "my_int16"; - eprosima::fastcdr::optional member_ann_builtin_my_int16; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_int16 = TypeObjectUtils::build_complete_member_detail(name_my_int16, member_ann_builtin_my_int16, ann_custom_BasicStruct); - CompleteStructMember member_my_int16 = TypeObjectUtils::build_complete_struct_member(common_my_int16, detail_my_int16); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_int16); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_int32 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_int32 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_int32; - MemberId member_id_my_int32 = 0x00000003; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_int32 = TypeObjectUtils::build_common_struct_member(member_id_my_int32, member_flags_my_int32, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_int32 = TypeObjectUtils::build_common_struct_member(member_id_my_int32, member_flags_my_int32, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_int32 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_int32 = "my_int32"; - eprosima::fastcdr::optional member_ann_builtin_my_int32; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_int32 = TypeObjectUtils::build_complete_member_detail(name_my_int32, member_ann_builtin_my_int32, ann_custom_BasicStruct); - CompleteStructMember member_my_int32 = TypeObjectUtils::build_complete_struct_member(common_my_int32, detail_my_int32); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_int32); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int64_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_int64 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_int64 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_int64; - MemberId member_id_my_int64 = 0x00000004; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_int64 = TypeObjectUtils::build_common_struct_member(member_id_my_int64, member_flags_my_int64, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_int64 = TypeObjectUtils::build_common_struct_member(member_id_my_int64, member_flags_my_int64, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_int64 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_int64 = "my_int64"; - eprosima::fastcdr::optional member_ann_builtin_my_int64; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_int64 = TypeObjectUtils::build_complete_member_detail(name_my_int64, member_ann_builtin_my_int64, ann_custom_BasicStruct); - CompleteStructMember member_my_int64 = TypeObjectUtils::build_complete_struct_member(common_my_int64, detail_my_int64); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_int64); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_uint16_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_uint16 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_uint16 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_uint16; - MemberId member_id_my_uint16 = 0x00000005; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_uint16 = TypeObjectUtils::build_common_struct_member(member_id_my_uint16, member_flags_my_uint16, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_uint16 = TypeObjectUtils::build_common_struct_member(member_id_my_uint16, member_flags_my_uint16, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_uint16 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_uint16 = "my_uint16"; - eprosima::fastcdr::optional member_ann_builtin_my_uint16; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_uint16 = TypeObjectUtils::build_complete_member_detail(name_my_uint16, member_ann_builtin_my_uint16, ann_custom_BasicStruct); - CompleteStructMember member_my_uint16 = TypeObjectUtils::build_complete_struct_member(common_my_uint16, detail_my_uint16); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_uint16); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_uint32_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_uint32 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_uint32 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_uint32; - MemberId member_id_my_uint32 = 0x00000006; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_uint32 = TypeObjectUtils::build_common_struct_member(member_id_my_uint32, member_flags_my_uint32, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_uint32 = TypeObjectUtils::build_common_struct_member(member_id_my_uint32, member_flags_my_uint32, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_uint32 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_uint32 = "my_uint32"; - eprosima::fastcdr::optional member_ann_builtin_my_uint32; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_uint32 = TypeObjectUtils::build_complete_member_detail(name_my_uint32, member_ann_builtin_my_uint32, ann_custom_BasicStruct); - CompleteStructMember member_my_uint32 = TypeObjectUtils::build_complete_struct_member(common_my_uint32, detail_my_uint32); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_uint32); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_uint64_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_uint64 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_uint64 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_uint64; - MemberId member_id_my_uint64 = 0x00000007; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_uint64 = TypeObjectUtils::build_common_struct_member(member_id_my_uint64, member_flags_my_uint64, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_uint64 = TypeObjectUtils::build_common_struct_member(member_id_my_uint64, member_flags_my_uint64, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_uint64 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_uint64 = "my_uint64"; - eprosima::fastcdr::optional member_ann_builtin_my_uint64; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_uint64 = TypeObjectUtils::build_complete_member_detail(name_my_uint64, member_ann_builtin_my_uint64, ann_custom_BasicStruct); - CompleteStructMember member_my_uint64 = TypeObjectUtils::build_complete_struct_member(common_my_uint64, detail_my_uint64); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_uint64); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_float", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_float32 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_float32 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_float32; - MemberId member_id_my_float32 = 0x00000008; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_float32 = TypeObjectUtils::build_common_struct_member(member_id_my_float32, member_flags_my_float32, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_float32 = TypeObjectUtils::build_common_struct_member(member_id_my_float32, member_flags_my_float32, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_float32 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_float32 = "my_float32"; - eprosima::fastcdr::optional member_ann_builtin_my_float32; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_float32 = TypeObjectUtils::build_complete_member_detail(name_my_float32, member_ann_builtin_my_float32, ann_custom_BasicStruct); - CompleteStructMember member_my_float32 = TypeObjectUtils::build_complete_struct_member(common_my_float32, detail_my_float32); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_float32); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_double", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_float64 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_float64 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_float64; - MemberId member_id_my_float64 = 0x00000009; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_float64 = TypeObjectUtils::build_common_struct_member(member_id_my_float64, member_flags_my_float64, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_float64 = TypeObjectUtils::build_common_struct_member(member_id_my_float64, member_flags_my_float64, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_float64 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_float64 = "my_float64"; - eprosima::fastcdr::optional member_ann_builtin_my_float64; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_float64 = TypeObjectUtils::build_complete_member_detail(name_my_float64, member_ann_builtin_my_float64, ann_custom_BasicStruct); - CompleteStructMember member_my_float64 = TypeObjectUtils::build_complete_struct_member(common_my_float64, detail_my_float64); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_float64); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_longdouble", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_float128 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_float128 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_float128; - MemberId member_id_my_float128 = 0x0000000a; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_float128 = TypeObjectUtils::build_common_struct_member(member_id_my_float128, member_flags_my_float128, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_float128 = TypeObjectUtils::build_common_struct_member(member_id_my_float128, member_flags_my_float128, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_float128 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_float128 = "my_float128"; - eprosima::fastcdr::optional member_ann_builtin_my_float128; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_float128 = TypeObjectUtils::build_complete_member_detail(name_my_float128, member_ann_builtin_my_float128, ann_custom_BasicStruct); - CompleteStructMember member_my_float128 = TypeObjectUtils::build_complete_struct_member(common_my_float128, detail_my_float128); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_float128); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_char", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_char Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_char = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_char; - MemberId member_id_my_char = 0x0000000b; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_char = TypeObjectUtils::build_common_struct_member(member_id_my_char, member_flags_my_char, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_char = TypeObjectUtils::build_common_struct_member(member_id_my_char, member_flags_my_char, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_char member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_char = "my_char"; - eprosima::fastcdr::optional member_ann_builtin_my_char; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_char = TypeObjectUtils::build_complete_member_detail(name_my_char, member_ann_builtin_my_char, ann_custom_BasicStruct); - CompleteStructMember member_my_char = TypeObjectUtils::build_complete_struct_member(common_my_char, detail_my_char); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_char); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_string_unbounded", type_ids_BasicStruct); - - if (return_code_BasicStruct != 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_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_string_unbounded", type_ids_BasicStruct); - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_string_unbounded: Given String TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_string = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_string; - MemberId member_id_my_string = 0x0000000c; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_string = TypeObjectUtils::build_common_struct_member(member_id_my_string, member_flags_my_string, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_string = TypeObjectUtils::build_common_struct_member(member_id_my_string, member_flags_my_string, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_string member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_string = "my_string"; - eprosima::fastcdr::optional member_ann_builtin_my_string; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_string = TypeObjectUtils::build_complete_member_detail(name_my_string, member_ann_builtin_my_string, ann_custom_BasicStruct); - CompleteStructMember member_my_string = TypeObjectUtils::build_complete_struct_member(common_my_string, detail_my_string); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_string); - } - CompleteStructType struct_type_BasicStruct = TypeObjectUtils::build_complete_struct_type(struct_flags_BasicStruct, header_BasicStruct, member_seq_BasicStruct); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_BasicStruct, type_name_BasicStruct.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "BasicStruct already registered in TypeObjectRegistry for a different type."); - } - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "BasicStruct", type_ids_BasicStruct); - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "BasicStruct: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - } - TypeIdentifier* element_identifier_anonymous_array_BasicStruct_5 {nullptr}; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_array_BasicStruct_5 = new TypeIdentifier(type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_array_BasicStruct_5 = new TypeIdentifier(type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Array element TypeIdentifier inconsistent."); - return; - } - EquivalenceKind equiv_kind_anonymous_array_BasicStruct_5 = EK_COMPLETE; - if (TK_NONE == type_ids_ComplexStruct.type_identifier2()._d()) - { - equiv_kind_anonymous_array_BasicStruct_5 = EK_BOTH; - } - CollectionElementFlag element_flags_anonymous_array_BasicStruct_5 = 0; - PlainCollectionHeader header_anonymous_array_BasicStruct_5 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_BasicStruct_5, element_flags_anonymous_array_BasicStruct_5); - std::string type_id_kind_anonymous_array_BasicStruct_5("TI_PLAIN_ARRAY_SMALL"); - if (type_id_kind_anonymous_array_BasicStruct_5 == "TI_PLAIN_ARRAY_SMALL") - { - SBoundSeq array_bound_seq; - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(5)); - - PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_BasicStruct_5, array_bound_seq, - eprosima::fastcdr::external(element_identifier_anonymous_array_BasicStruct_5)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_BasicStruct_5")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_BasicStruct_5 already registered in TypeObjectRegistry for a different type."); - } - } - else - { - LBoundSeq array_bound_seq; - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(5)); - - PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_BasicStruct_5, array_bound_seq, - eprosima::fastcdr::external(element_identifier_anonymous_array_BasicStruct_5)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_BasicStruct_5")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_BasicStruct_5 already registered in TypeObjectRegistry for a different type."); - } - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_array_BasicStruct_5", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_BasicStruct_5: Given Array TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_array_struct = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_array_struct; - MemberId member_id_my_array_struct = 0x00000008; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_array_struct = TypeObjectUtils::build_common_struct_member(member_id_my_array_struct, member_flags_my_array_struct, type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_array_struct = TypeObjectUtils::build_common_struct_member(member_id_my_array_struct, member_flags_my_array_struct, type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_array_struct member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_array_struct = "my_array_struct"; - eprosima::fastcdr::optional member_ann_builtin_my_array_struct; - ann_custom_ComplexStruct.reset(); - CompleteMemberDetail detail_my_array_struct = TypeObjectUtils::build_complete_member_detail(name_my_array_struct, member_ann_builtin_my_array_struct, ann_custom_ComplexStruct); - CompleteStructMember member_my_array_struct = TypeObjectUtils::build_complete_struct_member(common_my_array_struct, detail_my_array_struct); - TypeObjectUtils::add_complete_struct_member(member_seq_ComplexStruct, member_my_array_struct); - } - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_map_uint8_t_int16_t_unbounded", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int16_t", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Map element TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - TypeIdentifier* element_identifier_anonymous_map_uint8_t_int16_t_unbounded {nullptr}; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_map_uint8_t_int16_t_unbounded = new TypeIdentifier(type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_map_uint8_t_int16_t_unbounded = new TypeIdentifier(type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_uint8_t_int16_t_unbounded inconsistent element TypeIdentifier."); - return; - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_byte", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Map key TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - TypeIdentifier* key_identifier_anonymous_map_uint8_t_int16_t_unbounded {nullptr}; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - key_identifier_anonymous_map_uint8_t_int16_t_unbounded = new TypeIdentifier(type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - key_identifier_anonymous_map_uint8_t_int16_t_unbounded = new TypeIdentifier(type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_uint8_t_int16_t_unbounded inconsistent key TypeIdentifier."); - return; - } - EquivalenceKind equiv_kind_anonymous_map_uint8_t_int16_t_unbounded = EK_BOTH; - if ((EK_COMPLETE == key_identifier_anonymous_map_uint8_t_int16_t_unbounded->_d() || EK_COMPLETE == element_identifier_anonymous_map_uint8_t_int16_t_unbounded->_d()) || - (TI_PLAIN_SEQUENCE_SMALL == element_identifier_anonymous_map_uint8_t_int16_t_unbounded->_d() && EK_COMPLETE == element_identifier_anonymous_map_uint8_t_int16_t_unbounded->seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == element_identifier_anonymous_map_uint8_t_int16_t_unbounded->_d() && EK_COMPLETE == element_identifier_anonymous_map_uint8_t_int16_t_unbounded->seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == element_identifier_anonymous_map_uint8_t_int16_t_unbounded->_d() && EK_COMPLETE == element_identifier_anonymous_map_uint8_t_int16_t_unbounded->array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == element_identifier_anonymous_map_uint8_t_int16_t_unbounded->_d() && EK_COMPLETE == element_identifier_anonymous_map_uint8_t_int16_t_unbounded->array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == element_identifier_anonymous_map_uint8_t_int16_t_unbounded->_d() && (EK_COMPLETE == element_identifier_anonymous_map_uint8_t_int16_t_unbounded->map_sdefn().key_identifier()->_d() || EK_COMPLETE == element_identifier_anonymous_map_uint8_t_int16_t_unbounded->map_sdefn().header().equiv_kind())) || - (TI_PLAIN_MAP_LARGE == element_identifier_anonymous_map_uint8_t_int16_t_unbounded->_d() && (EK_COMPLETE == element_identifier_anonymous_map_uint8_t_int16_t_unbounded->map_ldefn().key_identifier()->_d() || EK_COMPLETE == element_identifier_anonymous_map_uint8_t_int16_t_unbounded->map_ldefn().header().equiv_kind()))) - { - equiv_kind_anonymous_map_uint8_t_int16_t_unbounded = EK_COMPLETE; - } - CollectionElementFlag element_flags_anonymous_map_uint8_t_int16_t_unbounded = 0; - CollectionElementFlag key_flags_anonymous_map_uint8_t_int16_t_unbounded = 0; - PlainCollectionHeader header_anonymous_map_uint8_t_int16_t_unbounded = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_map_uint8_t_int16_t_unbounded, element_flags_anonymous_map_uint8_t_int16_t_unbounded); - std::string type_id_kind_anonymous_map_uint8_t_int16_t_unbounded("TI_PLAIN_MAP_SMALL"); - if (type_id_kind_anonymous_map_uint8_t_int16_t_unbounded == "TI_PLAIN_MAP_SMALL") - { - SBound bound = 0; - PlainMapSTypeDefn map_sdefn = TypeObjectUtils::build_plain_map_s_type_defn(header_anonymous_map_uint8_t_int16_t_unbounded, bound, - eprosima::fastcdr::external(element_identifier_anonymous_map_uint8_t_int16_t_unbounded), key_flags_anonymous_map_uint8_t_int16_t_unbounded, - eprosima::fastcdr::external(key_identifier_anonymous_map_uint8_t_int16_t_unbounded)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_s_map_type_identifier(map_sdefn, "anonymous_map_uint8_t_int16_t_unbounded")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_uint8_t_int16_t_unbounded already registered in TypeObjectRegistry for a different type."); - } - } - else - { - LBound bound = 0; - PlainMapLTypeDefn map_ldefn = TypeObjectUtils::build_plain_map_l_type_defn(header_anonymous_map_uint8_t_int16_t_unbounded, bound, - eprosima::fastcdr::external(element_identifier_anonymous_map_uint8_t_int16_t_unbounded), key_flags_anonymous_map_uint8_t_int16_t_unbounded, - eprosima::fastcdr::external(key_identifier_anonymous_map_uint8_t_int16_t_unbounded)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_l_map_type_identifier(map_ldefn, "anonymous_map_uint8_t_int16_t_unbounded")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_uint8_t_int16_t_unbounded already registered in TypeObjectRegistry for a different type."); - } - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_map_uint8_t_int16_t_unbounded", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_uint8_t_int16_t_unbounded: Given Map TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_map_octet_short = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_map_octet_short; - MemberId member_id_my_map_octet_short = 0x00000009; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_map_octet_short = TypeObjectUtils::build_common_struct_member(member_id_my_map_octet_short, member_flags_my_map_octet_short, type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_map_octet_short = TypeObjectUtils::build_common_struct_member(member_id_my_map_octet_short, member_flags_my_map_octet_short, type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_map_octet_short member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_map_octet_short = "my_map_octet_short"; - eprosima::fastcdr::optional member_ann_builtin_my_map_octet_short; - ann_custom_ComplexStruct.reset(); - CompleteMemberDetail detail_my_map_octet_short = TypeObjectUtils::build_complete_member_detail(name_my_map_octet_short, member_ann_builtin_my_map_octet_short, ann_custom_ComplexStruct); - CompleteStructMember member_my_map_octet_short = TypeObjectUtils::build_complete_struct_member(common_my_map_octet_short, detail_my_map_octet_short); - TypeObjectUtils::add_complete_struct_member(member_seq_ComplexStruct, member_my_map_octet_short); - } - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_map_int32_t_BasicStruct_unbounded", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "BasicStruct", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - { - StructTypeFlag struct_flags_BasicStruct = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_BasicStruct; - TypeIdentifierPair type_ids_BasicStruct; - QualifiedTypeName type_name_BasicStruct = "BasicStruct"; - eprosima::fastcdr::optional type_ann_builtin_BasicStruct; - eprosima::fastcdr::optional ann_custom_BasicStruct; - CompleteTypeDetail detail_BasicStruct = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_BasicStruct, ann_custom_BasicStruct, type_name_BasicStruct.to_string()); - CompleteStructHeader header_BasicStruct; - header_BasicStruct = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_BasicStruct); - CompleteStructMemberSeq member_seq_BasicStruct; - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_bool", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_bool Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_bool = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_bool; - MemberId member_id_my_bool = 0x00000000; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_bool = TypeObjectUtils::build_common_struct_member(member_id_my_bool, member_flags_my_bool, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_bool = TypeObjectUtils::build_common_struct_member(member_id_my_bool, member_flags_my_bool, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_bool member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_bool = "my_bool"; - eprosima::fastcdr::optional member_ann_builtin_my_bool; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_bool = TypeObjectUtils::build_complete_member_detail(name_my_bool, member_ann_builtin_my_bool, ann_custom_BasicStruct); - CompleteStructMember member_my_bool = TypeObjectUtils::build_complete_struct_member(common_my_bool, detail_my_bool); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_bool); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_byte", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_octet Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_octet = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_octet; - MemberId member_id_my_octet = 0x00000001; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_octet = TypeObjectUtils::build_common_struct_member(member_id_my_octet, member_flags_my_octet, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_octet = TypeObjectUtils::build_common_struct_member(member_id_my_octet, member_flags_my_octet, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_octet member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_octet = "my_octet"; - eprosima::fastcdr::optional member_ann_builtin_my_octet; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_octet = TypeObjectUtils::build_complete_member_detail(name_my_octet, member_ann_builtin_my_octet, ann_custom_BasicStruct); - CompleteStructMember member_my_octet = TypeObjectUtils::build_complete_struct_member(common_my_octet, detail_my_octet); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_octet); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int16_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_int16 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_int16 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_int16; - MemberId member_id_my_int16 = 0x00000002; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_int16 = TypeObjectUtils::build_common_struct_member(member_id_my_int16, member_flags_my_int16, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_int16 = TypeObjectUtils::build_common_struct_member(member_id_my_int16, member_flags_my_int16, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_int16 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_int16 = "my_int16"; - eprosima::fastcdr::optional member_ann_builtin_my_int16; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_int16 = TypeObjectUtils::build_complete_member_detail(name_my_int16, member_ann_builtin_my_int16, ann_custom_BasicStruct); - CompleteStructMember member_my_int16 = TypeObjectUtils::build_complete_struct_member(common_my_int16, detail_my_int16); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_int16); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_int32 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_int32 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_int32; - MemberId member_id_my_int32 = 0x00000003; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_int32 = TypeObjectUtils::build_common_struct_member(member_id_my_int32, member_flags_my_int32, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_int32 = TypeObjectUtils::build_common_struct_member(member_id_my_int32, member_flags_my_int32, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_int32 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_int32 = "my_int32"; - eprosima::fastcdr::optional member_ann_builtin_my_int32; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_int32 = TypeObjectUtils::build_complete_member_detail(name_my_int32, member_ann_builtin_my_int32, ann_custom_BasicStruct); - CompleteStructMember member_my_int32 = TypeObjectUtils::build_complete_struct_member(common_my_int32, detail_my_int32); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_int32); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int64_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_int64 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_int64 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_int64; - MemberId member_id_my_int64 = 0x00000004; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_int64 = TypeObjectUtils::build_common_struct_member(member_id_my_int64, member_flags_my_int64, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_int64 = TypeObjectUtils::build_common_struct_member(member_id_my_int64, member_flags_my_int64, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_int64 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_int64 = "my_int64"; - eprosima::fastcdr::optional member_ann_builtin_my_int64; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_int64 = TypeObjectUtils::build_complete_member_detail(name_my_int64, member_ann_builtin_my_int64, ann_custom_BasicStruct); - CompleteStructMember member_my_int64 = TypeObjectUtils::build_complete_struct_member(common_my_int64, detail_my_int64); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_int64); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_uint16_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_uint16 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_uint16 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_uint16; - MemberId member_id_my_uint16 = 0x00000005; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_uint16 = TypeObjectUtils::build_common_struct_member(member_id_my_uint16, member_flags_my_uint16, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_uint16 = TypeObjectUtils::build_common_struct_member(member_id_my_uint16, member_flags_my_uint16, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_uint16 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_uint16 = "my_uint16"; - eprosima::fastcdr::optional member_ann_builtin_my_uint16; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_uint16 = TypeObjectUtils::build_complete_member_detail(name_my_uint16, member_ann_builtin_my_uint16, ann_custom_BasicStruct); - CompleteStructMember member_my_uint16 = TypeObjectUtils::build_complete_struct_member(common_my_uint16, detail_my_uint16); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_uint16); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_uint32_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_uint32 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_uint32 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_uint32; - MemberId member_id_my_uint32 = 0x00000006; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_uint32 = TypeObjectUtils::build_common_struct_member(member_id_my_uint32, member_flags_my_uint32, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_uint32 = TypeObjectUtils::build_common_struct_member(member_id_my_uint32, member_flags_my_uint32, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_uint32 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_uint32 = "my_uint32"; - eprosima::fastcdr::optional member_ann_builtin_my_uint32; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_uint32 = TypeObjectUtils::build_complete_member_detail(name_my_uint32, member_ann_builtin_my_uint32, ann_custom_BasicStruct); - CompleteStructMember member_my_uint32 = TypeObjectUtils::build_complete_struct_member(common_my_uint32, detail_my_uint32); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_uint32); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_uint64_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_uint64 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_uint64 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_uint64; - MemberId member_id_my_uint64 = 0x00000007; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_uint64 = TypeObjectUtils::build_common_struct_member(member_id_my_uint64, member_flags_my_uint64, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_uint64 = TypeObjectUtils::build_common_struct_member(member_id_my_uint64, member_flags_my_uint64, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_uint64 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_uint64 = "my_uint64"; - eprosima::fastcdr::optional member_ann_builtin_my_uint64; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_uint64 = TypeObjectUtils::build_complete_member_detail(name_my_uint64, member_ann_builtin_my_uint64, ann_custom_BasicStruct); - CompleteStructMember member_my_uint64 = TypeObjectUtils::build_complete_struct_member(common_my_uint64, detail_my_uint64); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_uint64); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_float", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_float32 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_float32 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_float32; - MemberId member_id_my_float32 = 0x00000008; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_float32 = TypeObjectUtils::build_common_struct_member(member_id_my_float32, member_flags_my_float32, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_float32 = TypeObjectUtils::build_common_struct_member(member_id_my_float32, member_flags_my_float32, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_float32 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_float32 = "my_float32"; - eprosima::fastcdr::optional member_ann_builtin_my_float32; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_float32 = TypeObjectUtils::build_complete_member_detail(name_my_float32, member_ann_builtin_my_float32, ann_custom_BasicStruct); - CompleteStructMember member_my_float32 = TypeObjectUtils::build_complete_struct_member(common_my_float32, detail_my_float32); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_float32); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_double", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_float64 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_float64 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_float64; - MemberId member_id_my_float64 = 0x00000009; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_float64 = TypeObjectUtils::build_common_struct_member(member_id_my_float64, member_flags_my_float64, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_float64 = TypeObjectUtils::build_common_struct_member(member_id_my_float64, member_flags_my_float64, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_float64 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_float64 = "my_float64"; - eprosima::fastcdr::optional member_ann_builtin_my_float64; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_float64 = TypeObjectUtils::build_complete_member_detail(name_my_float64, member_ann_builtin_my_float64, ann_custom_BasicStruct); - CompleteStructMember member_my_float64 = TypeObjectUtils::build_complete_struct_member(common_my_float64, detail_my_float64); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_float64); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_longdouble", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_float128 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_float128 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_float128; - MemberId member_id_my_float128 = 0x0000000a; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_float128 = TypeObjectUtils::build_common_struct_member(member_id_my_float128, member_flags_my_float128, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_float128 = TypeObjectUtils::build_common_struct_member(member_id_my_float128, member_flags_my_float128, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_float128 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_float128 = "my_float128"; - eprosima::fastcdr::optional member_ann_builtin_my_float128; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_float128 = TypeObjectUtils::build_complete_member_detail(name_my_float128, member_ann_builtin_my_float128, ann_custom_BasicStruct); - CompleteStructMember member_my_float128 = TypeObjectUtils::build_complete_struct_member(common_my_float128, detail_my_float128); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_float128); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_char", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_char Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_char = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_char; - MemberId member_id_my_char = 0x0000000b; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_char = TypeObjectUtils::build_common_struct_member(member_id_my_char, member_flags_my_char, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_char = TypeObjectUtils::build_common_struct_member(member_id_my_char, member_flags_my_char, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_char member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_char = "my_char"; - eprosima::fastcdr::optional member_ann_builtin_my_char; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_char = TypeObjectUtils::build_complete_member_detail(name_my_char, member_ann_builtin_my_char, ann_custom_BasicStruct); - CompleteStructMember member_my_char = TypeObjectUtils::build_complete_struct_member(common_my_char, detail_my_char); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_char); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_string_unbounded", type_ids_BasicStruct); - - if (return_code_BasicStruct != 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_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_string_unbounded", type_ids_BasicStruct); - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_string_unbounded: Given String TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_string = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_string; - MemberId member_id_my_string = 0x0000000c; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_string = TypeObjectUtils::build_common_struct_member(member_id_my_string, member_flags_my_string, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_string = TypeObjectUtils::build_common_struct_member(member_id_my_string, member_flags_my_string, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_string member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_string = "my_string"; - eprosima::fastcdr::optional member_ann_builtin_my_string; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_string = TypeObjectUtils::build_complete_member_detail(name_my_string, member_ann_builtin_my_string, ann_custom_BasicStruct); - CompleteStructMember member_my_string = TypeObjectUtils::build_complete_struct_member(common_my_string, detail_my_string); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_string); - } - CompleteStructType struct_type_BasicStruct = TypeObjectUtils::build_complete_struct_type(struct_flags_BasicStruct, header_BasicStruct, member_seq_BasicStruct); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_BasicStruct, type_name_BasicStruct.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "BasicStruct already registered in TypeObjectRegistry for a different type."); - } - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "BasicStruct", type_ids_BasicStruct); - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "BasicStruct: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - } - TypeIdentifier* element_identifier_anonymous_map_int32_t_BasicStruct_unbounded {nullptr}; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_map_int32_t_BasicStruct_unbounded = new TypeIdentifier(type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_map_int32_t_BasicStruct_unbounded = new TypeIdentifier(type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_BasicStruct_unbounded inconsistent element TypeIdentifier."); - return; - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Map key TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - TypeIdentifier* key_identifier_anonymous_map_int32_t_BasicStruct_unbounded {nullptr}; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - key_identifier_anonymous_map_int32_t_BasicStruct_unbounded = new TypeIdentifier(type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - key_identifier_anonymous_map_int32_t_BasicStruct_unbounded = new TypeIdentifier(type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_BasicStruct_unbounded inconsistent key TypeIdentifier."); - return; - } - EquivalenceKind equiv_kind_anonymous_map_int32_t_BasicStruct_unbounded = EK_BOTH; - if ((EK_COMPLETE == key_identifier_anonymous_map_int32_t_BasicStruct_unbounded->_d() || EK_COMPLETE == element_identifier_anonymous_map_int32_t_BasicStruct_unbounded->_d()) || - (TI_PLAIN_SEQUENCE_SMALL == element_identifier_anonymous_map_int32_t_BasicStruct_unbounded->_d() && EK_COMPLETE == element_identifier_anonymous_map_int32_t_BasicStruct_unbounded->seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == element_identifier_anonymous_map_int32_t_BasicStruct_unbounded->_d() && EK_COMPLETE == element_identifier_anonymous_map_int32_t_BasicStruct_unbounded->seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == element_identifier_anonymous_map_int32_t_BasicStruct_unbounded->_d() && EK_COMPLETE == element_identifier_anonymous_map_int32_t_BasicStruct_unbounded->array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == element_identifier_anonymous_map_int32_t_BasicStruct_unbounded->_d() && EK_COMPLETE == element_identifier_anonymous_map_int32_t_BasicStruct_unbounded->array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == element_identifier_anonymous_map_int32_t_BasicStruct_unbounded->_d() && (EK_COMPLETE == element_identifier_anonymous_map_int32_t_BasicStruct_unbounded->map_sdefn().key_identifier()->_d() || EK_COMPLETE == element_identifier_anonymous_map_int32_t_BasicStruct_unbounded->map_sdefn().header().equiv_kind())) || - (TI_PLAIN_MAP_LARGE == element_identifier_anonymous_map_int32_t_BasicStruct_unbounded->_d() && (EK_COMPLETE == element_identifier_anonymous_map_int32_t_BasicStruct_unbounded->map_ldefn().key_identifier()->_d() || EK_COMPLETE == element_identifier_anonymous_map_int32_t_BasicStruct_unbounded->map_ldefn().header().equiv_kind()))) - { - equiv_kind_anonymous_map_int32_t_BasicStruct_unbounded = EK_COMPLETE; - } - CollectionElementFlag element_flags_anonymous_map_int32_t_BasicStruct_unbounded = 0; - CollectionElementFlag key_flags_anonymous_map_int32_t_BasicStruct_unbounded = 0; - PlainCollectionHeader header_anonymous_map_int32_t_BasicStruct_unbounded = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_map_int32_t_BasicStruct_unbounded, element_flags_anonymous_map_int32_t_BasicStruct_unbounded); - std::string type_id_kind_anonymous_map_int32_t_BasicStruct_unbounded("TI_PLAIN_MAP_SMALL"); - if (type_id_kind_anonymous_map_int32_t_BasicStruct_unbounded == "TI_PLAIN_MAP_SMALL") - { - SBound bound = 0; - PlainMapSTypeDefn map_sdefn = TypeObjectUtils::build_plain_map_s_type_defn(header_anonymous_map_int32_t_BasicStruct_unbounded, bound, - eprosima::fastcdr::external(element_identifier_anonymous_map_int32_t_BasicStruct_unbounded), key_flags_anonymous_map_int32_t_BasicStruct_unbounded, - eprosima::fastcdr::external(key_identifier_anonymous_map_int32_t_BasicStruct_unbounded)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_s_map_type_identifier(map_sdefn, "anonymous_map_int32_t_BasicStruct_unbounded")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_BasicStruct_unbounded already registered in TypeObjectRegistry for a different type."); - } - } - else - { - LBound bound = 0; - PlainMapLTypeDefn map_ldefn = TypeObjectUtils::build_plain_map_l_type_defn(header_anonymous_map_int32_t_BasicStruct_unbounded, bound, - eprosima::fastcdr::external(element_identifier_anonymous_map_int32_t_BasicStruct_unbounded), key_flags_anonymous_map_int32_t_BasicStruct_unbounded, - eprosima::fastcdr::external(key_identifier_anonymous_map_int32_t_BasicStruct_unbounded)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_l_map_type_identifier(map_ldefn, "anonymous_map_int32_t_BasicStruct_unbounded")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_BasicStruct_unbounded already registered in TypeObjectRegistry for a different type."); - } - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_map_int32_t_BasicStruct_unbounded", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_BasicStruct_unbounded: Given Map TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_map_long_struct = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_map_long_struct; - MemberId member_id_my_map_long_struct = 0x0000000a; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_map_long_struct = TypeObjectUtils::build_common_struct_member(member_id_my_map_long_struct, member_flags_my_map_long_struct, type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_map_long_struct = TypeObjectUtils::build_common_struct_member(member_id_my_map_long_struct, member_flags_my_map_long_struct, type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_map_long_struct member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_map_long_struct = "my_map_long_struct"; - eprosima::fastcdr::optional member_ann_builtin_my_map_long_struct; - ann_custom_ComplexStruct.reset(); - CompleteMemberDetail detail_my_map_long_struct = TypeObjectUtils::build_complete_member_detail(name_my_map_long_struct, member_ann_builtin_my_map_long_struct, ann_custom_ComplexStruct); - CompleteStructMember member_my_map_long_struct = TypeObjectUtils::build_complete_struct_member(common_my_map_long_struct, detail_my_map_long_struct); - TypeObjectUtils::add_complete_struct_member(member_seq_ComplexStruct, member_my_map_long_struct); - } - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_sequence_uint8_t_unbounded", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_byte", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != 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_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_sequence_uint8_t_unbounded = new TypeIdentifier(type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_sequence_uint8_t_unbounded = new TypeIdentifier(type_ids_ComplexStruct.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_ComplexStruct.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_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_sequence_uint8_t_unbounded", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_sequence_uint8_t_unbounded: Given Sequence TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - TypeIdentifier* element_identifier_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded {nullptr}; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded = new TypeIdentifier(type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded = new TypeIdentifier(type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Sequence element TypeIdentifier inconsistent."); - return; - } - EquivalenceKind equiv_kind_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded = EK_COMPLETE; - if (TK_NONE == type_ids_ComplexStruct.type_identifier2()._d()) - { - equiv_kind_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded = EK_BOTH; - } - CollectionElementFlag element_flags_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded = 0; - PlainCollectionHeader header_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded, element_flags_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded); - std::string type_id_kind_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded("TI_PLAIN_SEQUENCE_SMALL"); - if (type_id_kind_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded == "TI_PLAIN_SEQUENCE_SMALL") - { - SBound bound = 0; - PlainSequenceSElemDefn seq_sdefn = TypeObjectUtils::build_plain_sequence_s_elem_defn(header_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded, bound, - eprosima::fastcdr::external(element_identifier_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_s_sequence_type_identifier(seq_sdefn, "anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_sequence_anonymous_sequence_uint8_t_unbounded_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_anonymous_sequence_uint8_t_unbounded_unbounded, bound, - eprosima::fastcdr::external(element_identifier_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_l_sequence_type_identifier(seq_ldefn, "anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded already registered in TypeObjectRegistry for a different type."); - } - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded: Given Sequence TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - TypeIdentifier* element_identifier_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded {nullptr}; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded = new TypeIdentifier(type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded = new TypeIdentifier(type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded inconsistent element TypeIdentifier."); - return; - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Map key TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - TypeIdentifier* key_identifier_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded {nullptr}; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - key_identifier_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded = new TypeIdentifier(type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - key_identifier_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded = new TypeIdentifier(type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded inconsistent key TypeIdentifier."); - return; - } - EquivalenceKind equiv_kind_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded = EK_BOTH; - if ((EK_COMPLETE == key_identifier_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded->_d() || EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded->_d()) || - (TI_PLAIN_SEQUENCE_SMALL == element_identifier_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded->_d() && EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded->seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == element_identifier_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded->_d() && EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded->seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == element_identifier_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded->_d() && EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded->array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == element_identifier_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded->_d() && EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded->array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == element_identifier_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded->_d() && (EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded->map_sdefn().key_identifier()->_d() || EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded->map_sdefn().header().equiv_kind())) || - (TI_PLAIN_MAP_LARGE == element_identifier_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded->_d() && (EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded->map_ldefn().key_identifier()->_d() || EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded->map_ldefn().header().equiv_kind()))) - { - equiv_kind_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded = EK_COMPLETE; - } - CollectionElementFlag element_flags_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded = 0; - CollectionElementFlag key_flags_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded = 0; - PlainCollectionHeader header_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded, element_flags_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded); - std::string type_id_kind_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded("TI_PLAIN_MAP_SMALL"); - if (type_id_kind_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded == "TI_PLAIN_MAP_SMALL") - { - SBound bound = 0; - PlainMapSTypeDefn map_sdefn = TypeObjectUtils::build_plain_map_s_type_defn(header_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded, bound, - eprosima::fastcdr::external(element_identifier_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded), key_flags_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded, - eprosima::fastcdr::external(key_identifier_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_s_map_type_identifier(map_sdefn, "anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded already registered in TypeObjectRegistry for a different type."); - } - } - else - { - LBound bound = 0; - PlainMapLTypeDefn map_ldefn = TypeObjectUtils::build_plain_map_l_type_defn(header_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded, bound, - eprosima::fastcdr::external(element_identifier_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded), key_flags_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded, - eprosima::fastcdr::external(key_identifier_anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_l_map_type_identifier(map_ldefn, "anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded already registered in TypeObjectRegistry for a different type."); - } - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_anonymous_sequence_anonymous_sequence_uint8_t_unbounded_unbounded_unbounded: Given Map TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_map_long_seq_octet = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_map_long_seq_octet; - MemberId member_id_my_map_long_seq_octet = 0x0000000b; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_map_long_seq_octet = TypeObjectUtils::build_common_struct_member(member_id_my_map_long_seq_octet, member_flags_my_map_long_seq_octet, type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_map_long_seq_octet = TypeObjectUtils::build_common_struct_member(member_id_my_map_long_seq_octet, member_flags_my_map_long_seq_octet, type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_map_long_seq_octet member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_map_long_seq_octet = "my_map_long_seq_octet"; - eprosima::fastcdr::optional member_ann_builtin_my_map_long_seq_octet; - ann_custom_ComplexStruct.reset(); - CompleteMemberDetail detail_my_map_long_seq_octet = TypeObjectUtils::build_complete_member_detail(name_my_map_long_seq_octet, member_ann_builtin_my_map_long_seq_octet, ann_custom_ComplexStruct); - CompleteStructMember member_my_map_long_seq_octet = TypeObjectUtils::build_complete_struct_member(common_my_map_long_seq_octet, detail_my_map_long_seq_octet); - TypeObjectUtils::add_complete_struct_member(member_seq_ComplexStruct, member_my_map_long_seq_octet); - } - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyOctetArray500", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - AliasTypeFlag alias_flags_MyOctetArray500 = 0; - QualifiedTypeName type_name_MyOctetArray500 = "MyOctetArray500"; - eprosima::fastcdr::optional type_ann_builtin_MyOctetArray500; - eprosima::fastcdr::optional ann_custom_MyOctetArray500; - CompleteTypeDetail detail_MyOctetArray500 = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_MyOctetArray500, ann_custom_MyOctetArray500, type_name_MyOctetArray500.to_string()); - CompleteAliasHeader header_MyOctetArray500 = TypeObjectUtils::build_complete_alias_header(detail_MyOctetArray500); - AliasMemberFlag related_flags_MyOctetArray500 = 0; - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_array_uint8_t_500", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_byte", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Array element TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - TypeIdentifier* element_identifier_anonymous_array_uint8_t_500 {nullptr}; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_array_uint8_t_500 = new TypeIdentifier(type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_array_uint8_t_500 = new TypeIdentifier(type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Array element TypeIdentifier inconsistent."); - return; - } - EquivalenceKind equiv_kind_anonymous_array_uint8_t_500 = EK_COMPLETE; - if (TK_NONE == type_ids_ComplexStruct.type_identifier2()._d()) - { - equiv_kind_anonymous_array_uint8_t_500 = EK_BOTH; - } - CollectionElementFlag element_flags_anonymous_array_uint8_t_500 = 0; - PlainCollectionHeader header_anonymous_array_uint8_t_500 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_500, element_flags_anonymous_array_uint8_t_500); - std::string type_id_kind_anonymous_array_uint8_t_500("TI_PLAIN_ARRAY_LARGE"); - if (type_id_kind_anonymous_array_uint8_t_500 == "TI_PLAIN_ARRAY_SMALL") - { - SBoundSeq array_bound_seq; - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(500)); - - PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_500, array_bound_seq, - eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_500)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_500")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_uint8_t_500 already registered in TypeObjectRegistry for a different type."); - } - } - else - { - LBoundSeq array_bound_seq; - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(500)); - - PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_500, array_bound_seq, - eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_500)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_500")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_uint8_t_500 already registered in TypeObjectRegistry for a different type."); - } - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_array_uint8_t_500", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_uint8_t_500: Given Array TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - CommonAliasBody common_MyOctetArray500; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_MyOctetArray500 = TypeObjectUtils::build_common_alias_body(related_flags_MyOctetArray500, type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_MyOctetArray500 = TypeObjectUtils::build_common_alias_body(related_flags_MyOctetArray500, type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyOctetArray500 related TypeIdentifier inconsistent."); - return; - } - eprosima::fastcdr::optional member_ann_builtin_MyOctetArray500; - ann_custom_MyOctetArray500.reset(); - CompleteAliasBody body_MyOctetArray500 = TypeObjectUtils::build_complete_alias_body(common_MyOctetArray500, member_ann_builtin_MyOctetArray500, ann_custom_MyOctetArray500); - CompleteAliasType alias_type_MyOctetArray500 = TypeObjectUtils::build_complete_alias_type(alias_flags_MyOctetArray500, header_MyOctetArray500, body_MyOctetArray500); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_alias_type_object(alias_type_MyOctetArray500, type_name_MyOctetArray500.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyOctetArray500 already registered in TypeObjectRegistry for a different type."); - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyOctetArray500", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyOctetArray500: Given Alias TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - TypeIdentifier* element_identifier_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded {nullptr}; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded = new TypeIdentifier(type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded = new TypeIdentifier(type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded inconsistent element TypeIdentifier."); - return; - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Map key TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - TypeIdentifier* key_identifier_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded {nullptr}; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - key_identifier_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded = new TypeIdentifier(type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - key_identifier_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded = new TypeIdentifier(type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded inconsistent key TypeIdentifier."); - return; - } - EquivalenceKind equiv_kind_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded = EK_BOTH; - if ((EK_COMPLETE == key_identifier_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded->_d() || EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded->_d()) || - (TI_PLAIN_SEQUENCE_SMALL == element_identifier_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded->_d() && EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded->seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == element_identifier_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded->_d() && EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded->seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == element_identifier_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded->_d() && EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded->array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == element_identifier_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded->_d() && EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded->array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == element_identifier_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded->_d() && (EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded->map_sdefn().key_identifier()->_d() || EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded->map_sdefn().header().equiv_kind())) || - (TI_PLAIN_MAP_LARGE == element_identifier_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded->_d() && (EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded->map_ldefn().key_identifier()->_d() || EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded->map_ldefn().header().equiv_kind()))) - { - equiv_kind_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded = EK_COMPLETE; - } - CollectionElementFlag element_flags_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded = 0; - CollectionElementFlag key_flags_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded = 0; - PlainCollectionHeader header_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded, element_flags_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded); - std::string type_id_kind_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded("TI_PLAIN_MAP_SMALL"); - if (type_id_kind_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded == "TI_PLAIN_MAP_SMALL") - { - SBound bound = 0; - PlainMapSTypeDefn map_sdefn = TypeObjectUtils::build_plain_map_s_type_defn(header_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded, bound, - eprosima::fastcdr::external(element_identifier_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded), key_flags_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded, - eprosima::fastcdr::external(key_identifier_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_s_map_type_identifier(map_sdefn, "anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded already registered in TypeObjectRegistry for a different type."); - } - } - else - { - LBound bound = 0; - PlainMapLTypeDefn map_ldefn = TypeObjectUtils::build_plain_map_l_type_defn(header_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded, bound, - eprosima::fastcdr::external(element_identifier_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded), key_flags_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded, - eprosima::fastcdr::external(key_identifier_anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_l_map_type_identifier(map_ldefn, "anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded already registered in TypeObjectRegistry for a different type."); - } - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_anonymous_array_uint8_t_500_unbounded: Given Map TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_map_long_octet_array_500 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_map_long_octet_array_500; - MemberId member_id_my_map_long_octet_array_500 = 0x0000000c; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_map_long_octet_array_500 = TypeObjectUtils::build_common_struct_member(member_id_my_map_long_octet_array_500, member_flags_my_map_long_octet_array_500, type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_map_long_octet_array_500 = TypeObjectUtils::build_common_struct_member(member_id_my_map_long_octet_array_500, member_flags_my_map_long_octet_array_500, type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_map_long_octet_array_500 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_map_long_octet_array_500 = "my_map_long_octet_array_500"; - eprosima::fastcdr::optional member_ann_builtin_my_map_long_octet_array_500; - ann_custom_ComplexStruct.reset(); - CompleteMemberDetail detail_my_map_long_octet_array_500 = TypeObjectUtils::build_complete_member_detail(name_my_map_long_octet_array_500, member_ann_builtin_my_map_long_octet_array_500, ann_custom_ComplexStruct); - CompleteStructMember member_my_map_long_octet_array_500 = TypeObjectUtils::build_complete_struct_member(common_my_map_long_octet_array_500, detail_my_map_long_octet_array_500); - TypeObjectUtils::add_complete_struct_member(member_seq_ComplexStruct, member_my_map_long_octet_array_500); - } - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "BSAlias5", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - AliasTypeFlag alias_flags_BSAlias5 = 0; - QualifiedTypeName type_name_BSAlias5 = "BSAlias5"; - eprosima::fastcdr::optional type_ann_builtin_BSAlias5; - eprosima::fastcdr::optional ann_custom_BSAlias5; - CompleteTypeDetail detail_BSAlias5 = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_BSAlias5, ann_custom_BSAlias5, type_name_BSAlias5.to_string()); - CompleteAliasHeader header_BSAlias5 = TypeObjectUtils::build_complete_alias_header(detail_BSAlias5); - AliasMemberFlag related_flags_BSAlias5 = 0; - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_array_BasicStruct_5", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "BasicStruct", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - { - StructTypeFlag struct_flags_BasicStruct = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_BasicStruct; - TypeIdentifierPair type_ids_BasicStruct; - QualifiedTypeName type_name_BasicStruct = "BasicStruct"; - eprosima::fastcdr::optional type_ann_builtin_BasicStruct; - eprosima::fastcdr::optional ann_custom_BasicStruct; - CompleteTypeDetail detail_BasicStruct = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_BasicStruct, ann_custom_BasicStruct, type_name_BasicStruct.to_string()); - CompleteStructHeader header_BasicStruct; - header_BasicStruct = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_BasicStruct); - CompleteStructMemberSeq member_seq_BasicStruct; - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_bool", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_bool Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_bool = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_bool; - MemberId member_id_my_bool = 0x00000000; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_bool = TypeObjectUtils::build_common_struct_member(member_id_my_bool, member_flags_my_bool, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_bool = TypeObjectUtils::build_common_struct_member(member_id_my_bool, member_flags_my_bool, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_bool member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_bool = "my_bool"; - eprosima::fastcdr::optional member_ann_builtin_my_bool; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_bool = TypeObjectUtils::build_complete_member_detail(name_my_bool, member_ann_builtin_my_bool, ann_custom_BasicStruct); - CompleteStructMember member_my_bool = TypeObjectUtils::build_complete_struct_member(common_my_bool, detail_my_bool); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_bool); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_byte", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_octet Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_octet = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_octet; - MemberId member_id_my_octet = 0x00000001; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_octet = TypeObjectUtils::build_common_struct_member(member_id_my_octet, member_flags_my_octet, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_octet = TypeObjectUtils::build_common_struct_member(member_id_my_octet, member_flags_my_octet, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_octet member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_octet = "my_octet"; - eprosima::fastcdr::optional member_ann_builtin_my_octet; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_octet = TypeObjectUtils::build_complete_member_detail(name_my_octet, member_ann_builtin_my_octet, ann_custom_BasicStruct); - CompleteStructMember member_my_octet = TypeObjectUtils::build_complete_struct_member(common_my_octet, detail_my_octet); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_octet); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int16_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_int16 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_int16 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_int16; - MemberId member_id_my_int16 = 0x00000002; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_int16 = TypeObjectUtils::build_common_struct_member(member_id_my_int16, member_flags_my_int16, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_int16 = TypeObjectUtils::build_common_struct_member(member_id_my_int16, member_flags_my_int16, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_int16 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_int16 = "my_int16"; - eprosima::fastcdr::optional member_ann_builtin_my_int16; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_int16 = TypeObjectUtils::build_complete_member_detail(name_my_int16, member_ann_builtin_my_int16, ann_custom_BasicStruct); - CompleteStructMember member_my_int16 = TypeObjectUtils::build_complete_struct_member(common_my_int16, detail_my_int16); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_int16); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_int32 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_int32 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_int32; - MemberId member_id_my_int32 = 0x00000003; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_int32 = TypeObjectUtils::build_common_struct_member(member_id_my_int32, member_flags_my_int32, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_int32 = TypeObjectUtils::build_common_struct_member(member_id_my_int32, member_flags_my_int32, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_int32 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_int32 = "my_int32"; - eprosima::fastcdr::optional member_ann_builtin_my_int32; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_int32 = TypeObjectUtils::build_complete_member_detail(name_my_int32, member_ann_builtin_my_int32, ann_custom_BasicStruct); - CompleteStructMember member_my_int32 = TypeObjectUtils::build_complete_struct_member(common_my_int32, detail_my_int32); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_int32); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int64_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_int64 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_int64 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_int64; - MemberId member_id_my_int64 = 0x00000004; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_int64 = TypeObjectUtils::build_common_struct_member(member_id_my_int64, member_flags_my_int64, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_int64 = TypeObjectUtils::build_common_struct_member(member_id_my_int64, member_flags_my_int64, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_int64 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_int64 = "my_int64"; - eprosima::fastcdr::optional member_ann_builtin_my_int64; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_int64 = TypeObjectUtils::build_complete_member_detail(name_my_int64, member_ann_builtin_my_int64, ann_custom_BasicStruct); - CompleteStructMember member_my_int64 = TypeObjectUtils::build_complete_struct_member(common_my_int64, detail_my_int64); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_int64); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_uint16_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_uint16 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_uint16 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_uint16; - MemberId member_id_my_uint16 = 0x00000005; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_uint16 = TypeObjectUtils::build_common_struct_member(member_id_my_uint16, member_flags_my_uint16, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_uint16 = TypeObjectUtils::build_common_struct_member(member_id_my_uint16, member_flags_my_uint16, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_uint16 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_uint16 = "my_uint16"; - eprosima::fastcdr::optional member_ann_builtin_my_uint16; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_uint16 = TypeObjectUtils::build_complete_member_detail(name_my_uint16, member_ann_builtin_my_uint16, ann_custom_BasicStruct); - CompleteStructMember member_my_uint16 = TypeObjectUtils::build_complete_struct_member(common_my_uint16, detail_my_uint16); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_uint16); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_uint32_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_uint32 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_uint32 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_uint32; - MemberId member_id_my_uint32 = 0x00000006; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_uint32 = TypeObjectUtils::build_common_struct_member(member_id_my_uint32, member_flags_my_uint32, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_uint32 = TypeObjectUtils::build_common_struct_member(member_id_my_uint32, member_flags_my_uint32, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_uint32 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_uint32 = "my_uint32"; - eprosima::fastcdr::optional member_ann_builtin_my_uint32; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_uint32 = TypeObjectUtils::build_complete_member_detail(name_my_uint32, member_ann_builtin_my_uint32, ann_custom_BasicStruct); - CompleteStructMember member_my_uint32 = TypeObjectUtils::build_complete_struct_member(common_my_uint32, detail_my_uint32); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_uint32); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_uint64_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_uint64 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_uint64 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_uint64; - MemberId member_id_my_uint64 = 0x00000007; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_uint64 = TypeObjectUtils::build_common_struct_member(member_id_my_uint64, member_flags_my_uint64, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_uint64 = TypeObjectUtils::build_common_struct_member(member_id_my_uint64, member_flags_my_uint64, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_uint64 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_uint64 = "my_uint64"; - eprosima::fastcdr::optional member_ann_builtin_my_uint64; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_uint64 = TypeObjectUtils::build_complete_member_detail(name_my_uint64, member_ann_builtin_my_uint64, ann_custom_BasicStruct); - CompleteStructMember member_my_uint64 = TypeObjectUtils::build_complete_struct_member(common_my_uint64, detail_my_uint64); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_uint64); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_float", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_float32 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_float32 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_float32; - MemberId member_id_my_float32 = 0x00000008; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_float32 = TypeObjectUtils::build_common_struct_member(member_id_my_float32, member_flags_my_float32, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_float32 = TypeObjectUtils::build_common_struct_member(member_id_my_float32, member_flags_my_float32, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_float32 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_float32 = "my_float32"; - eprosima::fastcdr::optional member_ann_builtin_my_float32; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_float32 = TypeObjectUtils::build_complete_member_detail(name_my_float32, member_ann_builtin_my_float32, ann_custom_BasicStruct); - CompleteStructMember member_my_float32 = TypeObjectUtils::build_complete_struct_member(common_my_float32, detail_my_float32); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_float32); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_double", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_float64 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_float64 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_float64; - MemberId member_id_my_float64 = 0x00000009; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_float64 = TypeObjectUtils::build_common_struct_member(member_id_my_float64, member_flags_my_float64, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_float64 = TypeObjectUtils::build_common_struct_member(member_id_my_float64, member_flags_my_float64, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_float64 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_float64 = "my_float64"; - eprosima::fastcdr::optional member_ann_builtin_my_float64; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_float64 = TypeObjectUtils::build_complete_member_detail(name_my_float64, member_ann_builtin_my_float64, ann_custom_BasicStruct); - CompleteStructMember member_my_float64 = TypeObjectUtils::build_complete_struct_member(common_my_float64, detail_my_float64); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_float64); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_longdouble", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_float128 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_float128 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_float128; - MemberId member_id_my_float128 = 0x0000000a; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_float128 = TypeObjectUtils::build_common_struct_member(member_id_my_float128, member_flags_my_float128, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_float128 = TypeObjectUtils::build_common_struct_member(member_id_my_float128, member_flags_my_float128, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_float128 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_float128 = "my_float128"; - eprosima::fastcdr::optional member_ann_builtin_my_float128; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_float128 = TypeObjectUtils::build_complete_member_detail(name_my_float128, member_ann_builtin_my_float128, ann_custom_BasicStruct); - CompleteStructMember member_my_float128 = TypeObjectUtils::build_complete_struct_member(common_my_float128, detail_my_float128); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_float128); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_char", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_char Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_char = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_char; - MemberId member_id_my_char = 0x0000000b; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_char = TypeObjectUtils::build_common_struct_member(member_id_my_char, member_flags_my_char, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_char = TypeObjectUtils::build_common_struct_member(member_id_my_char, member_flags_my_char, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_char member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_char = "my_char"; - eprosima::fastcdr::optional member_ann_builtin_my_char; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_char = TypeObjectUtils::build_complete_member_detail(name_my_char, member_ann_builtin_my_char, ann_custom_BasicStruct); - CompleteStructMember member_my_char = TypeObjectUtils::build_complete_struct_member(common_my_char, detail_my_char); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_char); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_string_unbounded", type_ids_BasicStruct); - - if (return_code_BasicStruct != 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_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_string_unbounded", type_ids_BasicStruct); - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_string_unbounded: Given String TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_string = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_string; - MemberId member_id_my_string = 0x0000000c; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_string = TypeObjectUtils::build_common_struct_member(member_id_my_string, member_flags_my_string, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_string = TypeObjectUtils::build_common_struct_member(member_id_my_string, member_flags_my_string, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_string member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_string = "my_string"; - eprosima::fastcdr::optional member_ann_builtin_my_string; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_string = TypeObjectUtils::build_complete_member_detail(name_my_string, member_ann_builtin_my_string, ann_custom_BasicStruct); - CompleteStructMember member_my_string = TypeObjectUtils::build_complete_struct_member(common_my_string, detail_my_string); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_string); - } - CompleteStructType struct_type_BasicStruct = TypeObjectUtils::build_complete_struct_type(struct_flags_BasicStruct, header_BasicStruct, member_seq_BasicStruct); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_BasicStruct, type_name_BasicStruct.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "BasicStruct already registered in TypeObjectRegistry for a different type."); - } - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "BasicStruct", type_ids_BasicStruct); - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "BasicStruct: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - } - TypeIdentifier* element_identifier_anonymous_array_BasicStruct_5 {nullptr}; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_array_BasicStruct_5 = new TypeIdentifier(type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_array_BasicStruct_5 = new TypeIdentifier(type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Array element TypeIdentifier inconsistent."); - return; - } - EquivalenceKind equiv_kind_anonymous_array_BasicStruct_5 = EK_COMPLETE; - if (TK_NONE == type_ids_ComplexStruct.type_identifier2()._d()) - { - equiv_kind_anonymous_array_BasicStruct_5 = EK_BOTH; - } - CollectionElementFlag element_flags_anonymous_array_BasicStruct_5 = 0; - PlainCollectionHeader header_anonymous_array_BasicStruct_5 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_BasicStruct_5, element_flags_anonymous_array_BasicStruct_5); - std::string type_id_kind_anonymous_array_BasicStruct_5("TI_PLAIN_ARRAY_SMALL"); - if (type_id_kind_anonymous_array_BasicStruct_5 == "TI_PLAIN_ARRAY_SMALL") - { - SBoundSeq array_bound_seq; - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(5)); - - PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_BasicStruct_5, array_bound_seq, - eprosima::fastcdr::external(element_identifier_anonymous_array_BasicStruct_5)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_BasicStruct_5")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_BasicStruct_5 already registered in TypeObjectRegistry for a different type."); - } - } - else - { - LBoundSeq array_bound_seq; - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(5)); - - PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_BasicStruct_5, array_bound_seq, - eprosima::fastcdr::external(element_identifier_anonymous_array_BasicStruct_5)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_BasicStruct_5")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_BasicStruct_5 already registered in TypeObjectRegistry for a different type."); - } - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_array_BasicStruct_5", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_BasicStruct_5: Given Array TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - CommonAliasBody common_BSAlias5; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_BSAlias5 = TypeObjectUtils::build_common_alias_body(related_flags_BSAlias5, type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_BSAlias5 = TypeObjectUtils::build_common_alias_body(related_flags_BSAlias5, type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "BSAlias5 related TypeIdentifier inconsistent."); - return; - } - eprosima::fastcdr::optional member_ann_builtin_BSAlias5; - ann_custom_BSAlias5.reset(); - CompleteAliasBody body_BSAlias5 = TypeObjectUtils::build_complete_alias_body(common_BSAlias5, member_ann_builtin_BSAlias5, ann_custom_BSAlias5); - CompleteAliasType alias_type_BSAlias5 = TypeObjectUtils::build_complete_alias_type(alias_flags_BSAlias5, header_BSAlias5, body_BSAlias5); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_alias_type_object(alias_type_BSAlias5, type_name_BSAlias5.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "BSAlias5 already registered in TypeObjectRegistry for a different type."); - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "BSAlias5", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "BSAlias5: Given Alias TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - TypeIdentifier* element_identifier_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded {nullptr}; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded = new TypeIdentifier(type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded = new TypeIdentifier(type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded inconsistent element TypeIdentifier."); - return; - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_byte", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Map key TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - TypeIdentifier* key_identifier_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded {nullptr}; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - key_identifier_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded = new TypeIdentifier(type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - key_identifier_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded = new TypeIdentifier(type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded inconsistent key TypeIdentifier."); - return; - } - EquivalenceKind equiv_kind_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded = EK_BOTH; - if ((EK_COMPLETE == key_identifier_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded->_d() || EK_COMPLETE == element_identifier_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded->_d()) || - (TI_PLAIN_SEQUENCE_SMALL == element_identifier_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded->_d() && EK_COMPLETE == element_identifier_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded->seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == element_identifier_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded->_d() && EK_COMPLETE == element_identifier_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded->seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == element_identifier_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded->_d() && EK_COMPLETE == element_identifier_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded->array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == element_identifier_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded->_d() && EK_COMPLETE == element_identifier_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded->array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == element_identifier_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded->_d() && (EK_COMPLETE == element_identifier_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded->map_sdefn().key_identifier()->_d() || EK_COMPLETE == element_identifier_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded->map_sdefn().header().equiv_kind())) || - (TI_PLAIN_MAP_LARGE == element_identifier_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded->_d() && (EK_COMPLETE == element_identifier_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded->map_ldefn().key_identifier()->_d() || EK_COMPLETE == element_identifier_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded->map_ldefn().header().equiv_kind()))) - { - equiv_kind_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded = EK_COMPLETE; - } - CollectionElementFlag element_flags_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded = 0; - CollectionElementFlag key_flags_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded = 0; - PlainCollectionHeader header_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded, element_flags_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded); - std::string type_id_kind_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded("TI_PLAIN_MAP_SMALL"); - if (type_id_kind_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded == "TI_PLAIN_MAP_SMALL") - { - SBound bound = 0; - PlainMapSTypeDefn map_sdefn = TypeObjectUtils::build_plain_map_s_type_defn(header_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded, bound, - eprosima::fastcdr::external(element_identifier_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded), key_flags_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded, - eprosima::fastcdr::external(key_identifier_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_s_map_type_identifier(map_sdefn, "anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded already registered in TypeObjectRegistry for a different type."); - } - } - else - { - LBound bound = 0; - PlainMapLTypeDefn map_ldefn = TypeObjectUtils::build_plain_map_l_type_defn(header_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded, bound, - eprosima::fastcdr::external(element_identifier_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded), key_flags_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded, - eprosima::fastcdr::external(key_identifier_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_l_map_type_identifier(map_ldefn, "anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded already registered in TypeObjectRegistry for a different type."); - } - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded: Given Map TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - TypeIdentifier* element_identifier_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded {nullptr}; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded = new TypeIdentifier(type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded = new TypeIdentifier(type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded inconsistent element TypeIdentifier."); - return; - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Map key TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - TypeIdentifier* key_identifier_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded {nullptr}; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - key_identifier_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded = new TypeIdentifier(type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - key_identifier_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded = new TypeIdentifier(type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded inconsistent key TypeIdentifier."); - return; - } - EquivalenceKind equiv_kind_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded = EK_BOTH; - if ((EK_COMPLETE == key_identifier_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded->_d() || EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded->_d()) || - (TI_PLAIN_SEQUENCE_SMALL == element_identifier_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded->_d() && EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded->seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == element_identifier_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded->_d() && EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded->seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == element_identifier_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded->_d() && EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded->array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == element_identifier_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded->_d() && EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded->array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == element_identifier_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded->_d() && (EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded->map_sdefn().key_identifier()->_d() || EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded->map_sdefn().header().equiv_kind())) || - (TI_PLAIN_MAP_LARGE == element_identifier_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded->_d() && (EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded->map_ldefn().key_identifier()->_d() || EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded->map_ldefn().header().equiv_kind()))) - { - equiv_kind_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded = EK_COMPLETE; - } - CollectionElementFlag element_flags_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded = 0; - CollectionElementFlag key_flags_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded = 0; - PlainCollectionHeader header_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded, element_flags_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded); - std::string type_id_kind_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded("TI_PLAIN_MAP_SMALL"); - if (type_id_kind_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded == "TI_PLAIN_MAP_SMALL") - { - SBound bound = 0; - PlainMapSTypeDefn map_sdefn = TypeObjectUtils::build_plain_map_s_type_defn(header_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded, bound, - eprosima::fastcdr::external(element_identifier_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded), key_flags_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded, - eprosima::fastcdr::external(key_identifier_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_s_map_type_identifier(map_sdefn, "anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded already registered in TypeObjectRegistry for a different type."); - } - } - else - { - LBound bound = 0; - PlainMapLTypeDefn map_ldefn = TypeObjectUtils::build_plain_map_l_type_defn(header_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded, bound, - eprosima::fastcdr::external(element_identifier_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded), key_flags_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded, - eprosima::fastcdr::external(key_identifier_anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_l_map_type_identifier(map_ldefn, "anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded already registered in TypeObjectRegistry for a different type."); - } - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_anonymous_map_uint8_t_anonymous_array_BasicStruct_5_unbounded_unbounded: Given Map TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_map_long_lol_type = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_map_long_lol_type; - MemberId member_id_my_map_long_lol_type = 0x0000000d; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_map_long_lol_type = TypeObjectUtils::build_common_struct_member(member_id_my_map_long_lol_type, member_flags_my_map_long_lol_type, type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_map_long_lol_type = TypeObjectUtils::build_common_struct_member(member_id_my_map_long_lol_type, member_flags_my_map_long_lol_type, type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_map_long_lol_type member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_map_long_lol_type = "my_map_long_lol_type"; - eprosima::fastcdr::optional member_ann_builtin_my_map_long_lol_type; - ann_custom_ComplexStruct.reset(); - CompleteMemberDetail detail_my_map_long_lol_type = TypeObjectUtils::build_complete_member_detail(name_my_map_long_lol_type, member_ann_builtin_my_map_long_lol_type, ann_custom_ComplexStruct); - CompleteStructMember member_my_map_long_lol_type = TypeObjectUtils::build_complete_struct_member(common_my_map_long_lol_type, detail_my_map_long_lol_type); - TypeObjectUtils::add_complete_struct_member(member_seq_ComplexStruct, member_my_map_long_lol_type); - } - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_string_128", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - std::string type_id_kind_anonymous_string_128("TI_STRING8_SMALL"); - if (type_id_kind_anonymous_string_128 == "TI_STRING8_SMALL") - { - SBound bound = static_cast(128); - 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_128")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_string_128 already registered in TypeObjectRegistry for a different type."); - } - } - else if (type_id_kind_anonymous_string_128 == "TI_STRING8_LARGE") - { - LBound bound = 128; - 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_128")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_string_128 already registered in TypeObjectRegistry for a different type."); - } - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_string_128: Unknown String kind."); - return; - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_string_128", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_string_128: Given String TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_small_string_8 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_small_string_8; - MemberId member_id_my_small_string_8 = 0x0000000e; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_small_string_8 = TypeObjectUtils::build_common_struct_member(member_id_my_small_string_8, member_flags_my_small_string_8, type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_small_string_8 = TypeObjectUtils::build_common_struct_member(member_id_my_small_string_8, member_flags_my_small_string_8, type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_small_string_8 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_small_string_8 = "my_small_string_8"; - eprosima::fastcdr::optional member_ann_builtin_my_small_string_8; - ann_custom_ComplexStruct.reset(); - CompleteMemberDetail detail_my_small_string_8 = TypeObjectUtils::build_complete_member_detail(name_my_small_string_8, member_ann_builtin_my_small_string_8, ann_custom_ComplexStruct); - CompleteStructMember member_my_small_string_8 = TypeObjectUtils::build_complete_struct_member(common_my_small_string_8, detail_my_small_string_8); - TypeObjectUtils::add_complete_struct_member(member_seq_ComplexStruct, member_my_small_string_8); - } - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_string_500", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - std::string type_id_kind_anonymous_string_500("TI_STRING8_LARGE"); - if (type_id_kind_anonymous_string_500 == "TI_STRING8_SMALL") - { - SBound bound = static_cast(500); - 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_500")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_string_500 already registered in TypeObjectRegistry for a different type."); - } - } - else if (type_id_kind_anonymous_string_500 == "TI_STRING8_LARGE") - { - LBound bound = 500; - 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_500")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_string_500 already registered in TypeObjectRegistry for a different type."); - } - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_string_500: Unknown String kind."); - return; - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_string_500", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_string_500: Given String TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_large_string_8 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_large_string_8; - MemberId member_id_my_large_string_8 = 0x0000000f; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_large_string_8 = TypeObjectUtils::build_common_struct_member(member_id_my_large_string_8, member_flags_my_large_string_8, type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_large_string_8 = TypeObjectUtils::build_common_struct_member(member_id_my_large_string_8, member_flags_my_large_string_8, type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_large_string_8 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_large_string_8 = "my_large_string_8"; - eprosima::fastcdr::optional member_ann_builtin_my_large_string_8; - ann_custom_ComplexStruct.reset(); - CompleteMemberDetail detail_my_large_string_8 = TypeObjectUtils::build_complete_member_detail(name_my_large_string_8, member_ann_builtin_my_large_string_8, ann_custom_ComplexStruct); - CompleteStructMember member_my_large_string_8 = TypeObjectUtils::build_complete_struct_member(common_my_large_string_8, detail_my_large_string_8); - TypeObjectUtils::add_complete_struct_member(member_seq_ComplexStruct, member_my_large_string_8); - } - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_array_anonymous_string_75_5_5", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_string_75", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - std::string type_id_kind_anonymous_string_75("TI_STRING8_SMALL"); - if (type_id_kind_anonymous_string_75 == "TI_STRING8_SMALL") - { - SBound bound = static_cast(75); - 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_75")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_string_75 already registered in TypeObjectRegistry for a different type."); - } - } - else if (type_id_kind_anonymous_string_75 == "TI_STRING8_LARGE") - { - LBound bound = 75; - 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_75")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_string_75 already registered in TypeObjectRegistry for a different type."); - } - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_string_75: Unknown String kind."); - return; - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_string_75", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_string_75: Given String TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - TypeIdentifier* element_identifier_anonymous_array_anonymous_string_75_5_5 {nullptr}; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_array_anonymous_string_75_5_5 = new TypeIdentifier(type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_array_anonymous_string_75_5_5 = new TypeIdentifier(type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Array element TypeIdentifier inconsistent."); - return; - } - EquivalenceKind equiv_kind_anonymous_array_anonymous_string_75_5_5 = EK_COMPLETE; - if (TK_NONE == type_ids_ComplexStruct.type_identifier2()._d()) - { - equiv_kind_anonymous_array_anonymous_string_75_5_5 = EK_BOTH; - } - CollectionElementFlag element_flags_anonymous_array_anonymous_string_75_5_5 = 0; - PlainCollectionHeader header_anonymous_array_anonymous_string_75_5_5 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_anonymous_string_75_5_5, element_flags_anonymous_array_anonymous_string_75_5_5); - std::string type_id_kind_anonymous_array_anonymous_string_75_5_5("TI_PLAIN_ARRAY_SMALL"); - if (type_id_kind_anonymous_array_anonymous_string_75_5_5 == "TI_PLAIN_ARRAY_SMALL") - { - SBoundSeq array_bound_seq; - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(5)); - - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(5)); - - PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_anonymous_string_75_5_5, array_bound_seq, - eprosima::fastcdr::external(element_identifier_anonymous_array_anonymous_string_75_5_5)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_anonymous_string_75_5_5")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_anonymous_string_75_5_5 already registered in TypeObjectRegistry for a different type."); - } - } - else - { - LBoundSeq array_bound_seq; - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(5)); - - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(5)); - - PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_anonymous_string_75_5_5, array_bound_seq, - eprosima::fastcdr::external(element_identifier_anonymous_array_anonymous_string_75_5_5)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_anonymous_string_75_5_5")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_anonymous_string_75_5_5 already registered in TypeObjectRegistry for a different type."); - } - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_array_anonymous_string_75_5_5", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_anonymous_string_75_5_5: Given Array TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_array_string = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_array_string; - MemberId member_id_my_array_string = 0x00000010; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_array_string = TypeObjectUtils::build_common_struct_member(member_id_my_array_string, member_flags_my_array_string, type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_array_string = TypeObjectUtils::build_common_struct_member(member_id_my_array_string, member_flags_my_array_string, type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_array_string member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_array_string = "my_array_string"; - eprosima::fastcdr::optional member_ann_builtin_my_array_string; - ann_custom_ComplexStruct.reset(); - CompleteMemberDetail detail_my_array_string = TypeObjectUtils::build_complete_member_detail(name_my_array_string, member_ann_builtin_my_array_string, ann_custom_ComplexStruct); - CompleteStructMember member_my_array_string = TypeObjectUtils::build_complete_struct_member(common_my_array_string, detail_my_array_string); - TypeObjectUtils::add_complete_struct_member(member_seq_ComplexStruct, member_my_array_string); - } - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MA3", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - AliasTypeFlag alias_flags_MA3 = 0; - QualifiedTypeName type_name_MA3 = "MA3"; - eprosima::fastcdr::optional type_ann_builtin_MA3; - eprosima::fastcdr::optional ann_custom_MA3; - CompleteTypeDetail detail_MA3 = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_MA3, ann_custom_MA3, type_name_MA3.to_string()); - CompleteAliasHeader header_MA3 = TypeObjectUtils::build_complete_alias_header(detail_MA3); - AliasMemberFlag related_flags_MA3 = 0; - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_array_MyAliasEnum3_42", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyAliasEnum3", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - AliasTypeFlag alias_flags_MyAliasEnum3 = 0; - QualifiedTypeName type_name_MyAliasEnum3 = "MyAliasEnum3"; - eprosima::fastcdr::optional type_ann_builtin_MyAliasEnum3; - eprosima::fastcdr::optional ann_custom_MyAliasEnum3; - CompleteTypeDetail detail_MyAliasEnum3 = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_MyAliasEnum3, ann_custom_MyAliasEnum3, type_name_MyAliasEnum3.to_string()); - CompleteAliasHeader header_MyAliasEnum3 = TypeObjectUtils::build_complete_alias_header(detail_MyAliasEnum3); - AliasMemberFlag related_flags_MyAliasEnum3 = 0; - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyAliasEnum2", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - AliasTypeFlag alias_flags_MyAliasEnum2 = 0; - QualifiedTypeName type_name_MyAliasEnum2 = "MyAliasEnum2"; - eprosima::fastcdr::optional type_ann_builtin_MyAliasEnum2; - eprosima::fastcdr::optional ann_custom_MyAliasEnum2; - CompleteTypeDetail detail_MyAliasEnum2 = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_MyAliasEnum2, ann_custom_MyAliasEnum2, type_name_MyAliasEnum2.to_string()); - CompleteAliasHeader header_MyAliasEnum2 = TypeObjectUtils::build_complete_alias_header(detail_MyAliasEnum2); - AliasMemberFlag related_flags_MyAliasEnum2 = 0; - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyAliasEnum", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - AliasTypeFlag alias_flags_MyAliasEnum = 0; - QualifiedTypeName type_name_MyAliasEnum = "MyAliasEnum"; - eprosima::fastcdr::optional type_ann_builtin_MyAliasEnum; - eprosima::fastcdr::optional ann_custom_MyAliasEnum; - CompleteTypeDetail detail_MyAliasEnum = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_MyAliasEnum, ann_custom_MyAliasEnum, type_name_MyAliasEnum.to_string()); - CompleteAliasHeader header_MyAliasEnum = TypeObjectUtils::build_complete_alias_header(detail_MyAliasEnum); - AliasMemberFlag related_flags_MyAliasEnum = 0; - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyEnum", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EnumTypeFlag enum_flags_MyEnum = 0; - BitBound bit_bound_MyEnum = 32; - CommonEnumeratedHeader common_MyEnum = TypeObjectUtils::build_common_enumerated_header(bit_bound_MyEnum); - QualifiedTypeName type_name_MyEnum = "MyEnum"; - eprosima::fastcdr::optional type_ann_builtin_MyEnum; - eprosima::fastcdr::optional ann_custom_MyEnum; - CompleteTypeDetail detail_MyEnum = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_MyEnum, ann_custom_MyEnum, type_name_MyEnum.to_string()); - CompleteEnumeratedHeader header_MyEnum = TypeObjectUtils::build_complete_enumerated_header(common_MyEnum, detail_MyEnum); - CompleteEnumeratedLiteralSeq literal_seq_MyEnum; - { - EnumeratedLiteralFlag flags_A = TypeObjectUtils::build_enumerated_literal_flag(false); - CommonEnumeratedLiteral common_A = TypeObjectUtils::build_common_enumerated_literal(0, flags_A); - eprosima::fastcdr::optional member_ann_builtin_A; - ann_custom_MyEnum.reset(); - MemberName name_A = "A"; - CompleteMemberDetail detail_A = TypeObjectUtils::build_complete_member_detail(name_A, member_ann_builtin_A, ann_custom_MyEnum); - CompleteEnumeratedLiteral literal_A = TypeObjectUtils::build_complete_enumerated_literal(common_A, detail_A); - TypeObjectUtils::add_complete_enumerated_literal(literal_seq_MyEnum, literal_A); - } - { - EnumeratedLiteralFlag flags_B = TypeObjectUtils::build_enumerated_literal_flag(false); - CommonEnumeratedLiteral common_B = TypeObjectUtils::build_common_enumerated_literal(1, flags_B); - eprosima::fastcdr::optional member_ann_builtin_B; - ann_custom_MyEnum.reset(); - MemberName name_B = "B"; - CompleteMemberDetail detail_B = TypeObjectUtils::build_complete_member_detail(name_B, member_ann_builtin_B, ann_custom_MyEnum); - CompleteEnumeratedLiteral literal_B = TypeObjectUtils::build_complete_enumerated_literal(common_B, detail_B); - TypeObjectUtils::add_complete_enumerated_literal(literal_seq_MyEnum, literal_B); - } - { - EnumeratedLiteralFlag flags_C = TypeObjectUtils::build_enumerated_literal_flag(false); - CommonEnumeratedLiteral common_C = TypeObjectUtils::build_common_enumerated_literal(2, flags_C); - eprosima::fastcdr::optional member_ann_builtin_C; - ann_custom_MyEnum.reset(); - MemberName name_C = "C"; - CompleteMemberDetail detail_C = TypeObjectUtils::build_complete_member_detail(name_C, member_ann_builtin_C, ann_custom_MyEnum); - CompleteEnumeratedLiteral literal_C = TypeObjectUtils::build_complete_enumerated_literal(common_C, detail_C); - TypeObjectUtils::add_complete_enumerated_literal(literal_seq_MyEnum, literal_C); - } - CompleteEnumeratedType enumerated_type_MyEnum = TypeObjectUtils::build_complete_enumerated_type(enum_flags_MyEnum, header_MyEnum, - literal_seq_MyEnum); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_enumerated_type_object(enumerated_type_MyEnum, type_name_MyEnum.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyEnum already registered in TypeObjectRegistry for a different type."); - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyEnum", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyEnum: Given Enum TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - CommonAliasBody common_MyAliasEnum; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_MyAliasEnum = TypeObjectUtils::build_common_alias_body(related_flags_MyAliasEnum, type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_MyAliasEnum = TypeObjectUtils::build_common_alias_body(related_flags_MyAliasEnum, type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyAliasEnum related TypeIdentifier inconsistent."); - return; - } - eprosima::fastcdr::optional member_ann_builtin_MyAliasEnum; - ann_custom_MyAliasEnum.reset(); - CompleteAliasBody body_MyAliasEnum = TypeObjectUtils::build_complete_alias_body(common_MyAliasEnum, member_ann_builtin_MyAliasEnum, ann_custom_MyAliasEnum); - CompleteAliasType alias_type_MyAliasEnum = TypeObjectUtils::build_complete_alias_type(alias_flags_MyAliasEnum, header_MyAliasEnum, body_MyAliasEnum); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_alias_type_object(alias_type_MyAliasEnum, type_name_MyAliasEnum.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyAliasEnum already registered in TypeObjectRegistry for a different type."); - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyAliasEnum", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyAliasEnum: Given Alias TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - CommonAliasBody common_MyAliasEnum2; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_MyAliasEnum2 = TypeObjectUtils::build_common_alias_body(related_flags_MyAliasEnum2, type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_MyAliasEnum2 = TypeObjectUtils::build_common_alias_body(related_flags_MyAliasEnum2, type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyAliasEnum2 related TypeIdentifier inconsistent."); - return; - } - eprosima::fastcdr::optional member_ann_builtin_MyAliasEnum2; - ann_custom_MyAliasEnum2.reset(); - CompleteAliasBody body_MyAliasEnum2 = TypeObjectUtils::build_complete_alias_body(common_MyAliasEnum2, member_ann_builtin_MyAliasEnum2, ann_custom_MyAliasEnum2); - CompleteAliasType alias_type_MyAliasEnum2 = TypeObjectUtils::build_complete_alias_type(alias_flags_MyAliasEnum2, header_MyAliasEnum2, body_MyAliasEnum2); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_alias_type_object(alias_type_MyAliasEnum2, type_name_MyAliasEnum2.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyAliasEnum2 already registered in TypeObjectRegistry for a different type."); - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyAliasEnum2", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyAliasEnum2: Given Alias TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - CommonAliasBody common_MyAliasEnum3; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_MyAliasEnum3 = TypeObjectUtils::build_common_alias_body(related_flags_MyAliasEnum3, type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_MyAliasEnum3 = TypeObjectUtils::build_common_alias_body(related_flags_MyAliasEnum3, type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyAliasEnum3 related TypeIdentifier inconsistent."); - return; - } - eprosima::fastcdr::optional member_ann_builtin_MyAliasEnum3; - ann_custom_MyAliasEnum3.reset(); - CompleteAliasBody body_MyAliasEnum3 = TypeObjectUtils::build_complete_alias_body(common_MyAliasEnum3, member_ann_builtin_MyAliasEnum3, ann_custom_MyAliasEnum3); - CompleteAliasType alias_type_MyAliasEnum3 = TypeObjectUtils::build_complete_alias_type(alias_flags_MyAliasEnum3, header_MyAliasEnum3, body_MyAliasEnum3); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_alias_type_object(alias_type_MyAliasEnum3, type_name_MyAliasEnum3.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyAliasEnum3 already registered in TypeObjectRegistry for a different type."); - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyAliasEnum3", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyAliasEnum3: Given Alias TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - TypeIdentifier* element_identifier_anonymous_array_MyAliasEnum3_42 {nullptr}; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_array_MyAliasEnum3_42 = new TypeIdentifier(type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_array_MyAliasEnum3_42 = new TypeIdentifier(type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Array element TypeIdentifier inconsistent."); - return; - } - EquivalenceKind equiv_kind_anonymous_array_MyAliasEnum3_42 = EK_COMPLETE; - if (TK_NONE == type_ids_ComplexStruct.type_identifier2()._d()) - { - equiv_kind_anonymous_array_MyAliasEnum3_42 = EK_BOTH; - } - CollectionElementFlag element_flags_anonymous_array_MyAliasEnum3_42 = 0; - PlainCollectionHeader header_anonymous_array_MyAliasEnum3_42 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_MyAliasEnum3_42, element_flags_anonymous_array_MyAliasEnum3_42); - std::string type_id_kind_anonymous_array_MyAliasEnum3_42("TI_PLAIN_ARRAY_SMALL"); - if (type_id_kind_anonymous_array_MyAliasEnum3_42 == "TI_PLAIN_ARRAY_SMALL") - { - SBoundSeq array_bound_seq; - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(42)); - - PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_MyAliasEnum3_42, array_bound_seq, - eprosima::fastcdr::external(element_identifier_anonymous_array_MyAliasEnum3_42)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_MyAliasEnum3_42")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_MyAliasEnum3_42 already registered in TypeObjectRegistry for a different type."); - } - } - else - { - LBoundSeq array_bound_seq; - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(42)); - - PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_MyAliasEnum3_42, array_bound_seq, - eprosima::fastcdr::external(element_identifier_anonymous_array_MyAliasEnum3_42)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_MyAliasEnum3_42")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_MyAliasEnum3_42 already registered in TypeObjectRegistry for a different type."); - } - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_array_MyAliasEnum3_42", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_MyAliasEnum3_42: Given Array TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - CommonAliasBody common_MA3; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_MA3 = TypeObjectUtils::build_common_alias_body(related_flags_MA3, type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_MA3 = TypeObjectUtils::build_common_alias_body(related_flags_MA3, type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MA3 related TypeIdentifier inconsistent."); - return; - } - eprosima::fastcdr::optional member_ann_builtin_MA3; - ann_custom_MA3.reset(); - CompleteAliasBody body_MA3 = TypeObjectUtils::build_complete_alias_body(common_MA3, member_ann_builtin_MA3, ann_custom_MA3); - CompleteAliasType alias_type_MA3 = TypeObjectUtils::build_complete_alias_type(alias_flags_MA3, header_MA3, body_MA3); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_alias_type_object(alias_type_MA3, type_name_MA3.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MA3 already registered in TypeObjectRegistry for a different type."); - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MA3", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MA3: Given Alias TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_multi_alias_array_42 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_multi_alias_array_42; - MemberId member_id_multi_alias_array_42 = 0x00000011; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_multi_alias_array_42 = TypeObjectUtils::build_common_struct_member(member_id_multi_alias_array_42, member_flags_multi_alias_array_42, type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_multi_alias_array_42 = TypeObjectUtils::build_common_struct_member(member_id_multi_alias_array_42, member_flags_multi_alias_array_42, type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure multi_alias_array_42 member TypeIdentifier inconsistent."); - return; - } - MemberName name_multi_alias_array_42 = "multi_alias_array_42"; - eprosima::fastcdr::optional member_ann_builtin_multi_alias_array_42; - ann_custom_ComplexStruct.reset(); - CompleteMemberDetail detail_multi_alias_array_42 = TypeObjectUtils::build_complete_member_detail(name_multi_alias_array_42, member_ann_builtin_multi_alias_array_42, ann_custom_ComplexStruct); - CompleteStructMember member_multi_alias_array_42 = TypeObjectUtils::build_complete_struct_member(common_multi_alias_array_42, detail_multi_alias_array_42); - TypeObjectUtils::add_complete_struct_member(member_seq_ComplexStruct, member_multi_alias_array_42); - } - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_array_anonymous_array_int32_t_2_5", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyMiniArray", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - AliasTypeFlag alias_flags_MyMiniArray = 0; - QualifiedTypeName type_name_MyMiniArray = "MyMiniArray"; - eprosima::fastcdr::optional type_ann_builtin_MyMiniArray; - eprosima::fastcdr::optional ann_custom_MyMiniArray; - CompleteTypeDetail detail_MyMiniArray = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_MyMiniArray, ann_custom_MyMiniArray, type_name_MyMiniArray.to_string()); - CompleteAliasHeader header_MyMiniArray = TypeObjectUtils::build_complete_alias_header(detail_MyMiniArray); - AliasMemberFlag related_flags_MyMiniArray = 0; - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_array_int32_t_2", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Array element TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - TypeIdentifier* element_identifier_anonymous_array_int32_t_2 {nullptr}; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_array_int32_t_2 = new TypeIdentifier(type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_array_int32_t_2 = new TypeIdentifier(type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Array element TypeIdentifier inconsistent."); - return; - } - EquivalenceKind equiv_kind_anonymous_array_int32_t_2 = EK_COMPLETE; - if (TK_NONE == type_ids_ComplexStruct.type_identifier2()._d()) - { - equiv_kind_anonymous_array_int32_t_2 = EK_BOTH; - } - CollectionElementFlag element_flags_anonymous_array_int32_t_2 = 0; - PlainCollectionHeader header_anonymous_array_int32_t_2 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_int32_t_2, element_flags_anonymous_array_int32_t_2); - std::string type_id_kind_anonymous_array_int32_t_2("TI_PLAIN_ARRAY_SMALL"); - if (type_id_kind_anonymous_array_int32_t_2 == "TI_PLAIN_ARRAY_SMALL") - { - SBoundSeq array_bound_seq; - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(2)); - - PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_int32_t_2, array_bound_seq, - eprosima::fastcdr::external(element_identifier_anonymous_array_int32_t_2)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_int32_t_2")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_int32_t_2 already registered in TypeObjectRegistry for a different type."); - } - } - else - { - LBoundSeq array_bound_seq; - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(2)); - - PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_int32_t_2, array_bound_seq, - eprosima::fastcdr::external(element_identifier_anonymous_array_int32_t_2)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_int32_t_2")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_int32_t_2 already registered in TypeObjectRegistry for a different type."); - } - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_array_int32_t_2", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_int32_t_2: Given Array TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - CommonAliasBody common_MyMiniArray; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_MyMiniArray = TypeObjectUtils::build_common_alias_body(related_flags_MyMiniArray, type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_MyMiniArray = TypeObjectUtils::build_common_alias_body(related_flags_MyMiniArray, type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyMiniArray related TypeIdentifier inconsistent."); - return; - } - eprosima::fastcdr::optional member_ann_builtin_MyMiniArray; - ann_custom_MyMiniArray.reset(); - CompleteAliasBody body_MyMiniArray = TypeObjectUtils::build_complete_alias_body(common_MyMiniArray, member_ann_builtin_MyMiniArray, ann_custom_MyMiniArray); - CompleteAliasType alias_type_MyMiniArray = TypeObjectUtils::build_complete_alias_type(alias_flags_MyMiniArray, header_MyMiniArray, body_MyMiniArray); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_alias_type_object(alias_type_MyMiniArray, type_name_MyMiniArray.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyMiniArray already registered in TypeObjectRegistry for a different type."); - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyMiniArray", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyMiniArray: Given Alias TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - TypeIdentifier* element_identifier_anonymous_array_anonymous_array_int32_t_2_5 {nullptr}; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_array_anonymous_array_int32_t_2_5 = new TypeIdentifier(type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_array_anonymous_array_int32_t_2_5 = new TypeIdentifier(type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Array element TypeIdentifier inconsistent."); - return; - } - EquivalenceKind equiv_kind_anonymous_array_anonymous_array_int32_t_2_5 = EK_COMPLETE; - if (TK_NONE == type_ids_ComplexStruct.type_identifier2()._d()) - { - equiv_kind_anonymous_array_anonymous_array_int32_t_2_5 = EK_BOTH; - } - CollectionElementFlag element_flags_anonymous_array_anonymous_array_int32_t_2_5 = 0; - PlainCollectionHeader header_anonymous_array_anonymous_array_int32_t_2_5 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_anonymous_array_int32_t_2_5, element_flags_anonymous_array_anonymous_array_int32_t_2_5); - std::string type_id_kind_anonymous_array_anonymous_array_int32_t_2_5("TI_PLAIN_ARRAY_SMALL"); - if (type_id_kind_anonymous_array_anonymous_array_int32_t_2_5 == "TI_PLAIN_ARRAY_SMALL") - { - SBoundSeq array_bound_seq; - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(5)); - - PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_anonymous_array_int32_t_2_5, array_bound_seq, - eprosima::fastcdr::external(element_identifier_anonymous_array_anonymous_array_int32_t_2_5)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_anonymous_array_int32_t_2_5")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_anonymous_array_int32_t_2_5 already registered in TypeObjectRegistry for a different type."); - } - } - else - { - LBoundSeq array_bound_seq; - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(5)); - - PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_anonymous_array_int32_t_2_5, array_bound_seq, - eprosima::fastcdr::external(element_identifier_anonymous_array_anonymous_array_int32_t_2_5)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_anonymous_array_int32_t_2_5")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_anonymous_array_int32_t_2_5 already registered in TypeObjectRegistry for a different type."); - } - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_array_anonymous_array_int32_t_2_5", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_anonymous_array_int32_t_2_5: Given Array TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_array_arrays = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_array_arrays; - MemberId member_id_my_array_arrays = 0x00000012; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_array_arrays = TypeObjectUtils::build_common_struct_member(member_id_my_array_arrays, member_flags_my_array_arrays, type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_array_arrays = TypeObjectUtils::build_common_struct_member(member_id_my_array_arrays, member_flags_my_array_arrays, type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_array_arrays member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_array_arrays = "my_array_arrays"; - eprosima::fastcdr::optional member_ann_builtin_my_array_arrays; - ann_custom_ComplexStruct.reset(); - CompleteMemberDetail detail_my_array_arrays = TypeObjectUtils::build_complete_member_detail(name_my_array_arrays, member_ann_builtin_my_array_arrays, ann_custom_ComplexStruct); - CompleteStructMember member_my_array_arrays = TypeObjectUtils::build_complete_struct_member(common_my_array_arrays, detail_my_array_arrays); - TypeObjectUtils::add_complete_struct_member(member_seq_ComplexStruct, member_my_array_arrays); - } - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_array_anonymous_sequence_int32_t_unbounded_23", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MySequenceLong", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - AliasTypeFlag alias_flags_MySequenceLong = 0; - QualifiedTypeName type_name_MySequenceLong = "MySequenceLong"; - eprosima::fastcdr::optional type_ann_builtin_MySequenceLong; - eprosima::fastcdr::optional ann_custom_MySequenceLong; - CompleteTypeDetail detail_MySequenceLong = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_MySequenceLong, ann_custom_MySequenceLong, type_name_MySequenceLong.to_string()); - CompleteAliasHeader header_MySequenceLong = TypeObjectUtils::build_complete_alias_header(detail_MySequenceLong); - AliasMemberFlag related_flags_MySequenceLong = 0; - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_sequence_int32_t_unbounded", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_ComplexStruct); - - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Sequence element TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - TypeIdentifier* element_identifier_anonymous_sequence_int32_t_unbounded {nullptr}; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_sequence_int32_t_unbounded = new TypeIdentifier(type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_sequence_int32_t_unbounded = new TypeIdentifier(type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Sequence element TypeIdentifier inconsistent."); - return; - } - EquivalenceKind equiv_kind_anonymous_sequence_int32_t_unbounded = EK_COMPLETE; - if (TK_NONE == type_ids_ComplexStruct.type_identifier2()._d()) - { - equiv_kind_anonymous_sequence_int32_t_unbounded = EK_BOTH; - } - CollectionElementFlag element_flags_anonymous_sequence_int32_t_unbounded = 0; - PlainCollectionHeader header_anonymous_sequence_int32_t_unbounded = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_sequence_int32_t_unbounded, element_flags_anonymous_sequence_int32_t_unbounded); - std::string type_id_kind_anonymous_sequence_int32_t_unbounded("TI_PLAIN_SEQUENCE_SMALL"); - if (type_id_kind_anonymous_sequence_int32_t_unbounded == "TI_PLAIN_SEQUENCE_SMALL") - { - SBound bound = 0; - PlainSequenceSElemDefn seq_sdefn = TypeObjectUtils::build_plain_sequence_s_elem_defn(header_anonymous_sequence_int32_t_unbounded, bound, - eprosima::fastcdr::external(element_identifier_anonymous_sequence_int32_t_unbounded)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_s_sequence_type_identifier(seq_sdefn, "anonymous_sequence_int32_t_unbounded")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_sequence_int32_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_int32_t_unbounded, bound, - eprosima::fastcdr::external(element_identifier_anonymous_sequence_int32_t_unbounded)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_l_sequence_type_identifier(seq_ldefn, "anonymous_sequence_int32_t_unbounded")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_sequence_int32_t_unbounded already registered in TypeObjectRegistry for a different type."); - } - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_sequence_int32_t_unbounded", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_sequence_int32_t_unbounded: Given Sequence TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - CommonAliasBody common_MySequenceLong; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_MySequenceLong = TypeObjectUtils::build_common_alias_body(related_flags_MySequenceLong, type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_MySequenceLong = TypeObjectUtils::build_common_alias_body(related_flags_MySequenceLong, type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MySequenceLong related TypeIdentifier inconsistent."); - return; - } - eprosima::fastcdr::optional member_ann_builtin_MySequenceLong; - ann_custom_MySequenceLong.reset(); - CompleteAliasBody body_MySequenceLong = TypeObjectUtils::build_complete_alias_body(common_MySequenceLong, member_ann_builtin_MySequenceLong, ann_custom_MySequenceLong); - CompleteAliasType alias_type_MySequenceLong = TypeObjectUtils::build_complete_alias_type(alias_flags_MySequenceLong, header_MySequenceLong, body_MySequenceLong); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_alias_type_object(alias_type_MySequenceLong, type_name_MySequenceLong.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MySequenceLong already registered in TypeObjectRegistry for a different type."); - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MySequenceLong", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MySequenceLong: Given Alias TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - TypeIdentifier* element_identifier_anonymous_array_anonymous_sequence_int32_t_unbounded_23 {nullptr}; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_array_anonymous_sequence_int32_t_unbounded_23 = new TypeIdentifier(type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_array_anonymous_sequence_int32_t_unbounded_23 = new TypeIdentifier(type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Array element TypeIdentifier inconsistent."); - return; - } - EquivalenceKind equiv_kind_anonymous_array_anonymous_sequence_int32_t_unbounded_23 = EK_COMPLETE; - if (TK_NONE == type_ids_ComplexStruct.type_identifier2()._d()) - { - equiv_kind_anonymous_array_anonymous_sequence_int32_t_unbounded_23 = EK_BOTH; - } - CollectionElementFlag element_flags_anonymous_array_anonymous_sequence_int32_t_unbounded_23 = 0; - PlainCollectionHeader header_anonymous_array_anonymous_sequence_int32_t_unbounded_23 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_anonymous_sequence_int32_t_unbounded_23, element_flags_anonymous_array_anonymous_sequence_int32_t_unbounded_23); - std::string type_id_kind_anonymous_array_anonymous_sequence_int32_t_unbounded_23("TI_PLAIN_ARRAY_SMALL"); - if (type_id_kind_anonymous_array_anonymous_sequence_int32_t_unbounded_23 == "TI_PLAIN_ARRAY_SMALL") - { - SBoundSeq array_bound_seq; - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(23)); - - PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_anonymous_sequence_int32_t_unbounded_23, array_bound_seq, - eprosima::fastcdr::external(element_identifier_anonymous_array_anonymous_sequence_int32_t_unbounded_23)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_anonymous_sequence_int32_t_unbounded_23")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_anonymous_sequence_int32_t_unbounded_23 already registered in TypeObjectRegistry for a different type."); - } - } - else - { - LBoundSeq array_bound_seq; - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(23)); - - PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_anonymous_sequence_int32_t_unbounded_23, array_bound_seq, - eprosima::fastcdr::external(element_identifier_anonymous_array_anonymous_sequence_int32_t_unbounded_23)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_anonymous_sequence_int32_t_unbounded_23")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_anonymous_sequence_int32_t_unbounded_23 already registered in TypeObjectRegistry for a different type."); - } - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_array_anonymous_sequence_int32_t_unbounded_23", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_anonymous_sequence_int32_t_unbounded_23: Given Array TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_sequences_array = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_sequences_array; - MemberId member_id_my_sequences_array = 0x00000013; - if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1()._d() || TK_NONE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_sequences_array = TypeObjectUtils::build_common_struct_member(member_id_my_sequences_array, member_flags_my_sequences_array, type_ids_ComplexStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ComplexStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ComplexStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_sequences_array = TypeObjectUtils::build_common_struct_member(member_id_my_sequences_array, member_flags_my_sequences_array, type_ids_ComplexStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_sequences_array member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_sequences_array = "my_sequences_array"; - eprosima::fastcdr::optional member_ann_builtin_my_sequences_array; - ann_custom_ComplexStruct.reset(); - CompleteMemberDetail detail_my_sequences_array = TypeObjectUtils::build_complete_member_detail(name_my_sequences_array, member_ann_builtin_my_sequences_array, ann_custom_ComplexStruct); - CompleteStructMember member_my_sequences_array = TypeObjectUtils::build_complete_struct_member(common_my_sequences_array, detail_my_sequences_array); - TypeObjectUtils::add_complete_struct_member(member_seq_ComplexStruct, member_my_sequences_array); - } - CompleteStructType struct_type_ComplexStruct = TypeObjectUtils::build_complete_struct_type(struct_flags_ComplexStruct, header_ComplexStruct, member_seq_ComplexStruct); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_ComplexStruct, type_name_ComplexStruct.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "ComplexStruct already registered in TypeObjectRegistry for a different type."); - } - return_code_ComplexStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "ComplexStruct", type_ids_ComplexStruct); - if (return_code_ComplexStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "ComplexStruct: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - } - UnionMemberFlag member_flags_complex = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false); - UnionCaseLabelSeq label_seq_complex; - TypeObjectUtils::add_union_case_label(label_seq_complex, static_cast(MyEnum::B)); - TypeObjectUtils::add_union_case_label(label_seq_complex, static_cast(MyEnum::C)); - CommonUnionMember common_complex; - MemberId member_id_complex = 0x00000002; - if (EK_COMPLETE == type_ids_MyUnion.type_identifier1()._d() || TK_NONE == type_ids_MyUnion.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_MyUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_MyUnion.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_MyUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_MyUnion.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_MyUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_MyUnion.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_MyUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_MyUnion.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_MyUnion.type_identifier1()._d() && - (EK_COMPLETE == type_ids_MyUnion.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MyUnion.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_MyUnion.type_identifier1()._d() && - (EK_COMPLETE == type_ids_MyUnion.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MyUnion.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_complex = TypeObjectUtils::build_common_union_member(member_id_complex, member_flags_complex, type_ids_MyUnion.type_identifier1(), - label_seq_complex); - } - else if (EK_COMPLETE == type_ids_MyUnion.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_MyUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_MyUnion.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_MyUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_MyUnion.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_MyUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_MyUnion.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_MyUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_MyUnion.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_MyUnion.type_identifier2()._d() && - (EK_COMPLETE == type_ids_MyUnion.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MyUnion.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_MyUnion.type_identifier2()._d() && - (EK_COMPLETE == type_ids_MyUnion.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MyUnion.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_complex = TypeObjectUtils::build_common_union_member(member_id_complex, member_flags_complex, type_ids_MyUnion.type_identifier2(), - label_seq_complex); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Union complex member TypeIdentifier inconsistent."); - return; - } - MemberName name_complex = "complex"; - eprosima::fastcdr::optional member_ann_builtin_complex; - ann_custom_MyUnion.reset(); - CompleteMemberDetail detail_complex = TypeObjectUtils::build_complete_member_detail(name_complex, member_ann_builtin_complex, ann_custom_MyUnion); - CompleteUnionMember member_complex = TypeObjectUtils::build_complete_union_member(common_complex, detail_complex); - TypeObjectUtils::add_complete_union_member(member_seq_MyUnion, member_complex); - } - CompleteUnionType union_type_MyUnion = TypeObjectUtils::build_complete_union_type(union_flags_MyUnion, header_MyUnion, discriminator_MyUnion, - member_seq_MyUnion); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_union_type_object(union_type_MyUnion, type_name_MyUnion.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyUnion already registered in TypeObjectRegistry for a different type."); - } - return_code_MyUnion = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyUnion", type_ids_MyUnion); - if (return_code_MyUnion != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyUnion: Given Union TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - } - StructMemberFlag member_flags_my_union = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_union; - MemberId member_id_my_union = 0x00000000; - if (EK_COMPLETE == type_ids_CompleteStruct.type_identifier1()._d() || TK_NONE == type_ids_CompleteStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_CompleteStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_CompleteStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_CompleteStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_CompleteStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_CompleteStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_CompleteStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_CompleteStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_CompleteStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_CompleteStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_CompleteStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_CompleteStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_CompleteStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_CompleteStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_CompleteStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_union = TypeObjectUtils::build_common_struct_member(member_id_my_union, member_flags_my_union, type_ids_CompleteStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_CompleteStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_CompleteStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_CompleteStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_CompleteStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_CompleteStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_CompleteStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_CompleteStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_CompleteStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_CompleteStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_CompleteStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_CompleteStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_CompleteStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_CompleteStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_CompleteStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_CompleteStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_union = TypeObjectUtils::build_common_struct_member(member_id_my_union, member_flags_my_union, type_ids_CompleteStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_union member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_union = "my_union"; - eprosima::fastcdr::optional member_ann_builtin_my_union; - ann_custom_CompleteStruct.reset(); - CompleteMemberDetail detail_my_union = TypeObjectUtils::build_complete_member_detail(name_my_union, member_ann_builtin_my_union, ann_custom_CompleteStruct); - CompleteStructMember member_my_union = TypeObjectUtils::build_complete_struct_member(common_my_union, detail_my_union); - TypeObjectUtils::add_complete_struct_member(member_seq_CompleteStruct, member_my_union); - } - { - return_code_CompleteStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyUnion2", type_ids_CompleteStruct); - - if (return_code_CompleteStruct != eprosima::fastdds::dds::RETCODE_OK) - { - { - ReturnCode_t return_code_MyUnion2; - TypeIdentifierPair type_ids_MyUnion2; - UnionTypeFlag union_flags_MyUnion2 = TypeObjectUtils::build_union_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - QualifiedTypeName type_name_MyUnion2 = "MyUnion2"; - eprosima::fastcdr::optional type_ann_builtin_MyUnion2; - eprosima::fastcdr::optional ann_custom_MyUnion2; - CompleteTypeDetail detail_MyUnion2 = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_MyUnion2, ann_custom_MyUnion2, type_name_MyUnion2.to_string()); - CompleteUnionHeader header_MyUnion2 = TypeObjectUtils::build_complete_union_header(detail_MyUnion2); - UnionDiscriminatorFlag member_flags_MyUnion2 = TypeObjectUtils::build_union_discriminator_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false); - return_code_MyUnion2 = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_byte", type_ids_MyUnion2); - - if (return_code_MyUnion2 != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Union discriminator TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - CommonDiscriminatorMember common_MyUnion2; - if (EK_COMPLETE == type_ids_MyUnion2.type_identifier1()._d() || TK_NONE == type_ids_MyUnion2.type_identifier2()._d()) - { - common_MyUnion2 = TypeObjectUtils::build_common_discriminator_member(member_flags_MyUnion2, type_ids_MyUnion2.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_MyUnion2.type_identifier2()._d()) - { - common_MyUnion2 = TypeObjectUtils::build_common_discriminator_member(member_flags_MyUnion2, type_ids_MyUnion2.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyUnion2 discriminator TypeIdentifier inconsistent."); - return; - } - type_ann_builtin_MyUnion2.reset(); - ann_custom_MyUnion2.reset(); - CompleteDiscriminatorMember discriminator_MyUnion2 = TypeObjectUtils::build_complete_discriminator_member(common_MyUnion2, - type_ann_builtin_MyUnion2, ann_custom_MyUnion2); - CompleteUnionMemberSeq member_seq_MyUnion2; - { - return_code_MyUnion2 = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_MyUnion2); - - if (return_code_MyUnion2 != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "uno Union member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - UnionMemberFlag member_flags_uno = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false); - UnionCaseLabelSeq label_seq_uno; - TypeObjectUtils::add_union_case_label(label_seq_uno, static_cast(0)); - CommonUnionMember common_uno; - MemberId member_id_uno = 0x00000001; - if (EK_COMPLETE == type_ids_MyUnion2.type_identifier1()._d() || TK_NONE == type_ids_MyUnion2.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_MyUnion2.type_identifier1()._d() && - EK_COMPLETE == type_ids_MyUnion2.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_MyUnion2.type_identifier1()._d() && - EK_COMPLETE == type_ids_MyUnion2.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_MyUnion2.type_identifier1()._d() && - EK_COMPLETE == type_ids_MyUnion2.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_MyUnion2.type_identifier1()._d() && - EK_COMPLETE == type_ids_MyUnion2.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_MyUnion2.type_identifier1()._d() && - (EK_COMPLETE == type_ids_MyUnion2.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MyUnion2.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_MyUnion2.type_identifier1()._d() && - (EK_COMPLETE == type_ids_MyUnion2.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MyUnion2.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_uno = TypeObjectUtils::build_common_union_member(member_id_uno, member_flags_uno, type_ids_MyUnion2.type_identifier1(), - label_seq_uno); - } - else if (EK_COMPLETE == type_ids_MyUnion2.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_MyUnion2.type_identifier2()._d() && - EK_COMPLETE == type_ids_MyUnion2.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_MyUnion2.type_identifier2()._d() && - EK_COMPLETE == type_ids_MyUnion2.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_MyUnion2.type_identifier2()._d() && - EK_COMPLETE == type_ids_MyUnion2.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_MyUnion2.type_identifier2()._d() && - EK_COMPLETE == type_ids_MyUnion2.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_MyUnion2.type_identifier2()._d() && - (EK_COMPLETE == type_ids_MyUnion2.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MyUnion2.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_MyUnion2.type_identifier2()._d() && - (EK_COMPLETE == type_ids_MyUnion2.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MyUnion2.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_uno = TypeObjectUtils::build_common_union_member(member_id_uno, member_flags_uno, type_ids_MyUnion2.type_identifier2(), - label_seq_uno); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Union uno member TypeIdentifier inconsistent."); - return; - } - MemberName name_uno = "uno"; - eprosima::fastcdr::optional member_ann_builtin_uno; - ann_custom_MyUnion2.reset(); - CompleteMemberDetail detail_uno = TypeObjectUtils::build_complete_member_detail(name_uno, member_ann_builtin_uno, ann_custom_MyUnion2); - CompleteUnionMember member_uno = TypeObjectUtils::build_complete_union_member(common_uno, detail_uno); - TypeObjectUtils::add_complete_union_member(member_seq_MyUnion2, member_uno); - } - { - return_code_MyUnion2 = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_string_unbounded", type_ids_MyUnion2); - - if (return_code_MyUnion2 != 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_MyUnion2 = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_string_unbounded", type_ids_MyUnion2); - if (return_code_MyUnion2 != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_string_unbounded: Given String TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - UnionMemberFlag member_flags_imString = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false); - UnionCaseLabelSeq label_seq_imString; - TypeObjectUtils::add_union_case_label(label_seq_imString, static_cast(1)); - CommonUnionMember common_imString; - MemberId member_id_imString = 0x00000002; - if (EK_COMPLETE == type_ids_MyUnion2.type_identifier1()._d() || TK_NONE == type_ids_MyUnion2.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_MyUnion2.type_identifier1()._d() && - EK_COMPLETE == type_ids_MyUnion2.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_MyUnion2.type_identifier1()._d() && - EK_COMPLETE == type_ids_MyUnion2.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_MyUnion2.type_identifier1()._d() && - EK_COMPLETE == type_ids_MyUnion2.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_MyUnion2.type_identifier1()._d() && - EK_COMPLETE == type_ids_MyUnion2.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_MyUnion2.type_identifier1()._d() && - (EK_COMPLETE == type_ids_MyUnion2.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MyUnion2.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_MyUnion2.type_identifier1()._d() && - (EK_COMPLETE == type_ids_MyUnion2.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MyUnion2.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_imString = TypeObjectUtils::build_common_union_member(member_id_imString, member_flags_imString, type_ids_MyUnion2.type_identifier1(), - label_seq_imString); - } - else if (EK_COMPLETE == type_ids_MyUnion2.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_MyUnion2.type_identifier2()._d() && - EK_COMPLETE == type_ids_MyUnion2.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_MyUnion2.type_identifier2()._d() && - EK_COMPLETE == type_ids_MyUnion2.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_MyUnion2.type_identifier2()._d() && - EK_COMPLETE == type_ids_MyUnion2.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_MyUnion2.type_identifier2()._d() && - EK_COMPLETE == type_ids_MyUnion2.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_MyUnion2.type_identifier2()._d() && - (EK_COMPLETE == type_ids_MyUnion2.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MyUnion2.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_MyUnion2.type_identifier2()._d() && - (EK_COMPLETE == type_ids_MyUnion2.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MyUnion2.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_imString = TypeObjectUtils::build_common_union_member(member_id_imString, member_flags_imString, type_ids_MyUnion2.type_identifier2(), - label_seq_imString); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Union imString member TypeIdentifier inconsistent."); - return; - } - MemberName name_imString = "imString"; - eprosima::fastcdr::optional member_ann_builtin_imString; - ann_custom_MyUnion2.reset(); - CompleteMemberDetail detail_imString = TypeObjectUtils::build_complete_member_detail(name_imString, member_ann_builtin_imString, ann_custom_MyUnion2); - CompleteUnionMember member_imString = TypeObjectUtils::build_complete_union_member(common_imString, detail_imString); - TypeObjectUtils::add_complete_union_member(member_seq_MyUnion2, member_imString); - } - { - return_code_MyUnion2 = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_MyUnion2); - - if (return_code_MyUnion2 != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "tres Union member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - UnionMemberFlag member_flags_tres = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false); - UnionCaseLabelSeq label_seq_tres; - TypeObjectUtils::add_union_case_label(label_seq_tres, static_cast(2)); - CommonUnionMember common_tres; - MemberId member_id_tres = 0x00000003; - if (EK_COMPLETE == type_ids_MyUnion2.type_identifier1()._d() || TK_NONE == type_ids_MyUnion2.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_MyUnion2.type_identifier1()._d() && - EK_COMPLETE == type_ids_MyUnion2.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_MyUnion2.type_identifier1()._d() && - EK_COMPLETE == type_ids_MyUnion2.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_MyUnion2.type_identifier1()._d() && - EK_COMPLETE == type_ids_MyUnion2.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_MyUnion2.type_identifier1()._d() && - EK_COMPLETE == type_ids_MyUnion2.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_MyUnion2.type_identifier1()._d() && - (EK_COMPLETE == type_ids_MyUnion2.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MyUnion2.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_MyUnion2.type_identifier1()._d() && - (EK_COMPLETE == type_ids_MyUnion2.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MyUnion2.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_tres = TypeObjectUtils::build_common_union_member(member_id_tres, member_flags_tres, type_ids_MyUnion2.type_identifier1(), - label_seq_tres); - } - else if (EK_COMPLETE == type_ids_MyUnion2.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_MyUnion2.type_identifier2()._d() && - EK_COMPLETE == type_ids_MyUnion2.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_MyUnion2.type_identifier2()._d() && - EK_COMPLETE == type_ids_MyUnion2.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_MyUnion2.type_identifier2()._d() && - EK_COMPLETE == type_ids_MyUnion2.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_MyUnion2.type_identifier2()._d() && - EK_COMPLETE == type_ids_MyUnion2.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_MyUnion2.type_identifier2()._d() && - (EK_COMPLETE == type_ids_MyUnion2.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MyUnion2.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_MyUnion2.type_identifier2()._d() && - (EK_COMPLETE == type_ids_MyUnion2.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MyUnion2.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_tres = TypeObjectUtils::build_common_union_member(member_id_tres, member_flags_tres, type_ids_MyUnion2.type_identifier2(), - label_seq_tres); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Union tres member TypeIdentifier inconsistent."); - return; - } - MemberName name_tres = "tres"; - eprosima::fastcdr::optional member_ann_builtin_tres; - ann_custom_MyUnion2.reset(); - CompleteMemberDetail detail_tres = TypeObjectUtils::build_complete_member_detail(name_tres, member_ann_builtin_tres, ann_custom_MyUnion2); - CompleteUnionMember member_tres = TypeObjectUtils::build_complete_union_member(common_tres, detail_tres); - TypeObjectUtils::add_complete_union_member(member_seq_MyUnion2, member_tres); - } - CompleteUnionType union_type_MyUnion2 = TypeObjectUtils::build_complete_union_type(union_flags_MyUnion2, header_MyUnion2, discriminator_MyUnion2, - member_seq_MyUnion2); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_union_type_object(union_type_MyUnion2, type_name_MyUnion2.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyUnion2 already registered in TypeObjectRegistry for a different type."); - } - return_code_MyUnion2 = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyUnion2", type_ids_MyUnion2); - if (return_code_MyUnion2 != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyUnion2: Given Union TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - } - StructMemberFlag member_flags_my_union_2 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_union_2; - MemberId member_id_my_union_2 = 0x00000001; - if (EK_COMPLETE == type_ids_CompleteStruct.type_identifier1()._d() || TK_NONE == type_ids_CompleteStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_CompleteStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_CompleteStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_CompleteStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_CompleteStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_CompleteStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_CompleteStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_CompleteStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_CompleteStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_CompleteStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_CompleteStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_CompleteStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_CompleteStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_CompleteStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_CompleteStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_union_2 = TypeObjectUtils::build_common_struct_member(member_id_my_union_2, member_flags_my_union_2, type_ids_CompleteStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_CompleteStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_CompleteStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_CompleteStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_CompleteStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_CompleteStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_CompleteStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_CompleteStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_CompleteStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_CompleteStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_CompleteStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_CompleteStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_CompleteStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_CompleteStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_CompleteStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_CompleteStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_union_2 = TypeObjectUtils::build_common_struct_member(member_id_my_union_2, member_flags_my_union_2, type_ids_CompleteStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_union_2 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_union_2 = "my_union_2"; - eprosima::fastcdr::optional member_ann_builtin_my_union_2; - ann_custom_CompleteStruct.reset(); - CompleteMemberDetail detail_my_union_2 = TypeObjectUtils::build_complete_member_detail(name_my_union_2, member_ann_builtin_my_union_2, ann_custom_CompleteStruct); - CompleteStructMember member_my_union_2 = TypeObjectUtils::build_complete_struct_member(common_my_union_2, detail_my_union_2); - TypeObjectUtils::add_complete_struct_member(member_seq_CompleteStruct, member_my_union_2); - } - CompleteStructType struct_type_CompleteStruct = TypeObjectUtils::build_complete_struct_type(struct_flags_CompleteStruct, header_CompleteStruct, member_seq_CompleteStruct); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_CompleteStruct, type_name_CompleteStruct.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "CompleteStruct already registered in TypeObjectRegistry for a different type."); - } - return_code_CompleteStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "CompleteStruct", type_ids_CompleteStruct); - if (return_code_CompleteStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "CompleteStruct: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } -} -void register_KeyedStruct_type_identifier() -{ - { - StructTypeFlag struct_flags_KeyedStruct = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_KeyedStruct; - TypeIdentifierPair type_ids_KeyedStruct; - QualifiedTypeName type_name_KeyedStruct = "KeyedStruct"; - eprosima::fastcdr::optional type_ann_builtin_KeyedStruct; - eprosima::fastcdr::optional ann_custom_KeyedStruct; - CompleteTypeDetail detail_KeyedStruct = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_KeyedStruct, ann_custom_KeyedStruct, type_name_KeyedStruct.to_string()); - CompleteStructHeader header_KeyedStruct; - header_KeyedStruct = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_KeyedStruct); - CompleteStructMemberSeq member_seq_KeyedStruct; - { - return_code_KeyedStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_byte", type_ids_KeyedStruct); - - if (return_code_KeyedStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "key Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_key = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, true, false); - CommonStructMember common_key; - MemberId member_id_key = 0x00000000; - if (EK_COMPLETE == type_ids_KeyedStruct.type_identifier1()._d() || TK_NONE == type_ids_KeyedStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_KeyedStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_KeyedStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_KeyedStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_KeyedStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_KeyedStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_KeyedStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_KeyedStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_KeyedStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_KeyedStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_KeyedStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_KeyedStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_KeyedStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_KeyedStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_KeyedStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_key = TypeObjectUtils::build_common_struct_member(member_id_key, member_flags_key, type_ids_KeyedStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_KeyedStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_KeyedStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_KeyedStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_KeyedStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_KeyedStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_KeyedStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_KeyedStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_KeyedStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_KeyedStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_KeyedStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_KeyedStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_KeyedStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_KeyedStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_KeyedStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_KeyedStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_key = TypeObjectUtils::build_common_struct_member(member_id_key, member_flags_key, type_ids_KeyedStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure key member TypeIdentifier inconsistent."); - return; - } - MemberName name_key = "key"; - eprosima::fastcdr::optional member_ann_builtin_key; - ann_custom_KeyedStruct.reset(); - AppliedAnnotationSeq tmp_ann_custom_key; - eprosima::fastcdr::optional unit_key; - eprosima::fastcdr::optional min_key; - eprosima::fastcdr::optional max_key; - eprosima::fastcdr::optional hash_id_key; - if (unit_key.has_value() || min_key.has_value() || max_key.has_value() || hash_id_key.has_value()) - { - member_ann_builtin_key = TypeObjectUtils::build_applied_builtin_member_annotations(unit_key, min_key, max_key, hash_id_key); - } - if (!tmp_ann_custom_key.empty()) - { - ann_custom_KeyedStruct = tmp_ann_custom_key; - } - CompleteMemberDetail detail_key = TypeObjectUtils::build_complete_member_detail(name_key, member_ann_builtin_key, ann_custom_KeyedStruct); - CompleteStructMember member_key = TypeObjectUtils::build_complete_struct_member(common_key, detail_key); - TypeObjectUtils::add_complete_struct_member(member_seq_KeyedStruct, member_key); - } - { - return_code_KeyedStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "BasicStruct", type_ids_KeyedStruct); - - if (return_code_KeyedStruct != eprosima::fastdds::dds::RETCODE_OK) - { - { - StructTypeFlag struct_flags_BasicStruct = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_BasicStruct; - TypeIdentifierPair type_ids_BasicStruct; - QualifiedTypeName type_name_BasicStruct = "BasicStruct"; - eprosima::fastcdr::optional type_ann_builtin_BasicStruct; - eprosima::fastcdr::optional ann_custom_BasicStruct; - CompleteTypeDetail detail_BasicStruct = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_BasicStruct, ann_custom_BasicStruct, type_name_BasicStruct.to_string()); - CompleteStructHeader header_BasicStruct; - header_BasicStruct = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_BasicStruct); - CompleteStructMemberSeq member_seq_BasicStruct; - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_bool", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_bool Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_bool = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_bool; - MemberId member_id_my_bool = 0x00000000; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_bool = TypeObjectUtils::build_common_struct_member(member_id_my_bool, member_flags_my_bool, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_bool = TypeObjectUtils::build_common_struct_member(member_id_my_bool, member_flags_my_bool, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_bool member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_bool = "my_bool"; - eprosima::fastcdr::optional member_ann_builtin_my_bool; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_bool = TypeObjectUtils::build_complete_member_detail(name_my_bool, member_ann_builtin_my_bool, ann_custom_BasicStruct); - CompleteStructMember member_my_bool = TypeObjectUtils::build_complete_struct_member(common_my_bool, detail_my_bool); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_bool); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_byte", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_octet Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_octet = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_octet; - MemberId member_id_my_octet = 0x00000001; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_octet = TypeObjectUtils::build_common_struct_member(member_id_my_octet, member_flags_my_octet, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_octet = TypeObjectUtils::build_common_struct_member(member_id_my_octet, member_flags_my_octet, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_octet member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_octet = "my_octet"; - eprosima::fastcdr::optional member_ann_builtin_my_octet; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_octet = TypeObjectUtils::build_complete_member_detail(name_my_octet, member_ann_builtin_my_octet, ann_custom_BasicStruct); - CompleteStructMember member_my_octet = TypeObjectUtils::build_complete_struct_member(common_my_octet, detail_my_octet); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_octet); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int16_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_int16 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_int16 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_int16; - MemberId member_id_my_int16 = 0x00000002; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_int16 = TypeObjectUtils::build_common_struct_member(member_id_my_int16, member_flags_my_int16, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_int16 = TypeObjectUtils::build_common_struct_member(member_id_my_int16, member_flags_my_int16, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_int16 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_int16 = "my_int16"; - eprosima::fastcdr::optional member_ann_builtin_my_int16; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_int16 = TypeObjectUtils::build_complete_member_detail(name_my_int16, member_ann_builtin_my_int16, ann_custom_BasicStruct); - CompleteStructMember member_my_int16 = TypeObjectUtils::build_complete_struct_member(common_my_int16, detail_my_int16); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_int16); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_int32 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_int32 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_int32; - MemberId member_id_my_int32 = 0x00000003; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_int32 = TypeObjectUtils::build_common_struct_member(member_id_my_int32, member_flags_my_int32, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_int32 = TypeObjectUtils::build_common_struct_member(member_id_my_int32, member_flags_my_int32, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_int32 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_int32 = "my_int32"; - eprosima::fastcdr::optional member_ann_builtin_my_int32; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_int32 = TypeObjectUtils::build_complete_member_detail(name_my_int32, member_ann_builtin_my_int32, ann_custom_BasicStruct); - CompleteStructMember member_my_int32 = TypeObjectUtils::build_complete_struct_member(common_my_int32, detail_my_int32); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_int32); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int64_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_int64 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_int64 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_int64; - MemberId member_id_my_int64 = 0x00000004; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_int64 = TypeObjectUtils::build_common_struct_member(member_id_my_int64, member_flags_my_int64, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_int64 = TypeObjectUtils::build_common_struct_member(member_id_my_int64, member_flags_my_int64, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_int64 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_int64 = "my_int64"; - eprosima::fastcdr::optional member_ann_builtin_my_int64; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_int64 = TypeObjectUtils::build_complete_member_detail(name_my_int64, member_ann_builtin_my_int64, ann_custom_BasicStruct); - CompleteStructMember member_my_int64 = TypeObjectUtils::build_complete_struct_member(common_my_int64, detail_my_int64); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_int64); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_uint16_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_uint16 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_uint16 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_uint16; - MemberId member_id_my_uint16 = 0x00000005; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_uint16 = TypeObjectUtils::build_common_struct_member(member_id_my_uint16, member_flags_my_uint16, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_uint16 = TypeObjectUtils::build_common_struct_member(member_id_my_uint16, member_flags_my_uint16, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_uint16 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_uint16 = "my_uint16"; - eprosima::fastcdr::optional member_ann_builtin_my_uint16; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_uint16 = TypeObjectUtils::build_complete_member_detail(name_my_uint16, member_ann_builtin_my_uint16, ann_custom_BasicStruct); - CompleteStructMember member_my_uint16 = TypeObjectUtils::build_complete_struct_member(common_my_uint16, detail_my_uint16); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_uint16); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_uint32_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_uint32 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_uint32 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_uint32; - MemberId member_id_my_uint32 = 0x00000006; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_uint32 = TypeObjectUtils::build_common_struct_member(member_id_my_uint32, member_flags_my_uint32, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_uint32 = TypeObjectUtils::build_common_struct_member(member_id_my_uint32, member_flags_my_uint32, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_uint32 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_uint32 = "my_uint32"; - eprosima::fastcdr::optional member_ann_builtin_my_uint32; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_uint32 = TypeObjectUtils::build_complete_member_detail(name_my_uint32, member_ann_builtin_my_uint32, ann_custom_BasicStruct); - CompleteStructMember member_my_uint32 = TypeObjectUtils::build_complete_struct_member(common_my_uint32, detail_my_uint32); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_uint32); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_uint64_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_uint64 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_uint64 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_uint64; - MemberId member_id_my_uint64 = 0x00000007; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_uint64 = TypeObjectUtils::build_common_struct_member(member_id_my_uint64, member_flags_my_uint64, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_uint64 = TypeObjectUtils::build_common_struct_member(member_id_my_uint64, member_flags_my_uint64, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_uint64 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_uint64 = "my_uint64"; - eprosima::fastcdr::optional member_ann_builtin_my_uint64; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_uint64 = TypeObjectUtils::build_complete_member_detail(name_my_uint64, member_ann_builtin_my_uint64, ann_custom_BasicStruct); - CompleteStructMember member_my_uint64 = TypeObjectUtils::build_complete_struct_member(common_my_uint64, detail_my_uint64); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_uint64); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_float", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_float32 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_float32 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_float32; - MemberId member_id_my_float32 = 0x00000008; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_float32 = TypeObjectUtils::build_common_struct_member(member_id_my_float32, member_flags_my_float32, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_float32 = TypeObjectUtils::build_common_struct_member(member_id_my_float32, member_flags_my_float32, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_float32 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_float32 = "my_float32"; - eprosima::fastcdr::optional member_ann_builtin_my_float32; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_float32 = TypeObjectUtils::build_complete_member_detail(name_my_float32, member_ann_builtin_my_float32, ann_custom_BasicStruct); - CompleteStructMember member_my_float32 = TypeObjectUtils::build_complete_struct_member(common_my_float32, detail_my_float32); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_float32); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_double", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_float64 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_float64 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_float64; - MemberId member_id_my_float64 = 0x00000009; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_float64 = TypeObjectUtils::build_common_struct_member(member_id_my_float64, member_flags_my_float64, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_float64 = TypeObjectUtils::build_common_struct_member(member_id_my_float64, member_flags_my_float64, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_float64 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_float64 = "my_float64"; - eprosima::fastcdr::optional member_ann_builtin_my_float64; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_float64 = TypeObjectUtils::build_complete_member_detail(name_my_float64, member_ann_builtin_my_float64, ann_custom_BasicStruct); - CompleteStructMember member_my_float64 = TypeObjectUtils::build_complete_struct_member(common_my_float64, detail_my_float64); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_float64); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_longdouble", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_float128 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_float128 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_float128; - MemberId member_id_my_float128 = 0x0000000a; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_float128 = TypeObjectUtils::build_common_struct_member(member_id_my_float128, member_flags_my_float128, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_float128 = TypeObjectUtils::build_common_struct_member(member_id_my_float128, member_flags_my_float128, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_float128 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_float128 = "my_float128"; - eprosima::fastcdr::optional member_ann_builtin_my_float128; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_float128 = TypeObjectUtils::build_complete_member_detail(name_my_float128, member_ann_builtin_my_float128, ann_custom_BasicStruct); - CompleteStructMember member_my_float128 = TypeObjectUtils::build_complete_struct_member(common_my_float128, detail_my_float128); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_float128); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_char", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_char Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_char = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_char; - MemberId member_id_my_char = 0x0000000b; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_char = TypeObjectUtils::build_common_struct_member(member_id_my_char, member_flags_my_char, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_char = TypeObjectUtils::build_common_struct_member(member_id_my_char, member_flags_my_char, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_char member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_char = "my_char"; - eprosima::fastcdr::optional member_ann_builtin_my_char; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_char = TypeObjectUtils::build_complete_member_detail(name_my_char, member_ann_builtin_my_char, ann_custom_BasicStruct); - CompleteStructMember member_my_char = TypeObjectUtils::build_complete_struct_member(common_my_char, detail_my_char); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_char); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_string_unbounded", type_ids_BasicStruct); - - if (return_code_BasicStruct != 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_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_string_unbounded", type_ids_BasicStruct); - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_string_unbounded: Given String TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_string = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_string; - MemberId member_id_my_string = 0x0000000c; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_string = TypeObjectUtils::build_common_struct_member(member_id_my_string, member_flags_my_string, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_string = TypeObjectUtils::build_common_struct_member(member_id_my_string, member_flags_my_string, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_string member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_string = "my_string"; - eprosima::fastcdr::optional member_ann_builtin_my_string; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_string = TypeObjectUtils::build_complete_member_detail(name_my_string, member_ann_builtin_my_string, ann_custom_BasicStruct); - CompleteStructMember member_my_string = TypeObjectUtils::build_complete_struct_member(common_my_string, detail_my_string); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_string); - } - CompleteStructType struct_type_BasicStruct = TypeObjectUtils::build_complete_struct_type(struct_flags_BasicStruct, header_BasicStruct, member_seq_BasicStruct); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_BasicStruct, type_name_BasicStruct.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "BasicStruct already registered in TypeObjectRegistry for a different type."); - } - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "BasicStruct", type_ids_BasicStruct); - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "BasicStruct: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - } - StructMemberFlag member_flags_basic = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_basic; - MemberId member_id_basic = 0x00000001; - if (EK_COMPLETE == type_ids_KeyedStruct.type_identifier1()._d() || TK_NONE == type_ids_KeyedStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_KeyedStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_KeyedStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_KeyedStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_KeyedStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_KeyedStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_KeyedStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_KeyedStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_KeyedStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_KeyedStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_KeyedStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_KeyedStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_KeyedStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_KeyedStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_KeyedStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_basic = TypeObjectUtils::build_common_struct_member(member_id_basic, member_flags_basic, type_ids_KeyedStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_KeyedStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_KeyedStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_KeyedStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_KeyedStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_KeyedStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_KeyedStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_KeyedStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_KeyedStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_KeyedStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_KeyedStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_KeyedStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_KeyedStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_KeyedStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_KeyedStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_KeyedStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_basic = TypeObjectUtils::build_common_struct_member(member_id_basic, member_flags_basic, type_ids_KeyedStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure basic member TypeIdentifier inconsistent."); - return; - } - MemberName name_basic = "basic"; - eprosima::fastcdr::optional member_ann_builtin_basic; - ann_custom_KeyedStruct.reset(); - CompleteMemberDetail detail_basic = TypeObjectUtils::build_complete_member_detail(name_basic, member_ann_builtin_basic, ann_custom_KeyedStruct); - CompleteStructMember member_basic = TypeObjectUtils::build_complete_struct_member(common_basic, detail_basic); - TypeObjectUtils::add_complete_struct_member(member_seq_KeyedStruct, member_basic); - } - CompleteStructType struct_type_KeyedStruct = TypeObjectUtils::build_complete_struct_type(struct_flags_KeyedStruct, header_KeyedStruct, member_seq_KeyedStruct); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_KeyedStruct, type_name_KeyedStruct.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "KeyedStruct already registered in TypeObjectRegistry for a different type."); - } - return_code_KeyedStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "KeyedStruct", type_ids_KeyedStruct); - if (return_code_KeyedStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "KeyedStruct: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } -} - diff --git a/test/unittest/dynamic_types/idl/TestTypeObjectSupport.hpp b/test/unittest/dynamic_types/idl/TestTypeObjectSupport.hpp deleted file mode 100644 index baa6097dc28..00000000000 --- a/test/unittest/dynamic_types/idl/TestTypeObjectSupport.hpp +++ /dev/null @@ -1,89 +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 TestTypeObjectSupport.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_TEST_TYPE_OBJECT_SUPPORT_HPP_ -#define _FAST_DDS_GENERATED_TEST_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_Test_type_objects(); - -#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC - -/** - * @brief Register BasicStruct 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_BasicStruct_type_identifier(); -/** - * @brief Register ComplexStruct 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_ComplexStruct_type_identifier(); -/** - * @brief Register MyUnion 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_MyUnion_type_identifier(); -/** - * @brief Register MyUnion2 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_MyUnion2_type_identifier(); -/** - * @brief Register CompleteStruct 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_CompleteStruct_type_identifier(); -/** - * @brief Register KeyedStruct 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_KeyedStruct_type_identifier(); - - -#endif // DOXYGEN_SHOULD_SKIP_THIS_PUBLIC - -#endif // _FAST_DDS_GENERATED_TEST_TYPE_OBJECT_SUPPORT_HPP_ diff --git a/test/unittest/dynamic_types/idl/new_features_4_2.hpp b/test/unittest/dynamic_types/idl/new_features_4_2.hpp deleted file mode 100644 index 4448c153e24..00000000000 --- a/test/unittest/dynamic_types/idl/new_features_4_2.hpp +++ /dev/null @@ -1,2685 +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 new_features_4_2.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_NEW_FEATURES_4_2_HPP_ -#define _FAST_DDS_GENERATED_NEW_FEATURES_4_2_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(NEW_FEATURES_4_2_SOURCE) -#define NEW_FEATURES_4_2_DllAPI __declspec( dllexport ) -#else -#define NEW_FEATURES_4_2_DllAPI __declspec( dllimport ) -#endif // NEW_FEATURES_4_2_SOURCE -#else -#define NEW_FEATURES_4_2_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define NEW_FEATURES_4_2_DllAPI -#endif // _WIN32 - -/*! - * @brief This class represents the structure NewAliases defined by the user in the IDL file. - * @ingroup new_features_4_2 - */ -class NewAliases -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport NewAliases() - { - } - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~NewAliases() - { - } - - /*! - * @brief Copy constructor. - * @param x Reference to the object NewAliases that will be copied. - */ - eProsima_user_DllExport NewAliases( - const NewAliases& x) - { - m_int8_ = x.m_int8_; - - m_uint8_ = x.m_uint8_; - - m_int16_ = x.m_int16_; - - m_uint16_ = x.m_uint16_; - - m_int32_ = x.m_int32_; - - m_uint32_ = x.m_uint32_; - - m_int64_ = x.m_int64_; - - m_uint64_ = x.m_uint64_; - - m_local_string = x.m_local_string; - - } - - /*! - * @brief Move constructor. - * @param x Reference to the object NewAliases that will be copied. - */ - eProsima_user_DllExport NewAliases( - NewAliases&& x) noexcept - { - m_int8_ = x.m_int8_; - m_uint8_ = x.m_uint8_; - m_int16_ = x.m_int16_; - m_uint16_ = x.m_uint16_; - m_int32_ = x.m_int32_; - m_uint32_ = x.m_uint32_; - m_int64_ = x.m_int64_; - m_uint64_ = x.m_uint64_; - m_local_string = std::move(x.m_local_string); - } - - /*! - * @brief Copy assignment. - * @param x Reference to the object NewAliases that will be copied. - */ - eProsima_user_DllExport NewAliases& operator =( - const NewAliases& x) - { - - m_int8_ = x.m_int8_; - - m_uint8_ = x.m_uint8_; - - m_int16_ = x.m_int16_; - - m_uint16_ = x.m_uint16_; - - m_int32_ = x.m_int32_; - - m_uint32_ = x.m_uint32_; - - m_int64_ = x.m_int64_; - - m_uint64_ = x.m_uint64_; - - m_local_string = x.m_local_string; - - return *this; - } - - /*! - * @brief Move assignment. - * @param x Reference to the object NewAliases that will be copied. - */ - eProsima_user_DllExport NewAliases& operator =( - NewAliases&& x) noexcept - { - - m_int8_ = x.m_int8_; - m_uint8_ = x.m_uint8_; - m_int16_ = x.m_int16_; - m_uint16_ = x.m_uint16_; - m_int32_ = x.m_int32_; - m_uint32_ = x.m_uint32_; - m_int64_ = x.m_int64_; - m_uint64_ = x.m_uint64_; - m_local_string = std::move(x.m_local_string); - return *this; - } - - /*! - * @brief Comparison operator. - * @param x NewAliases object to compare. - */ - eProsima_user_DllExport bool operator ==( - const NewAliases& x) const - { - return (m_int8_ == x.m_int8_ && - m_uint8_ == x.m_uint8_ && - m_int16_ == x.m_int16_ && - m_uint16_ == x.m_uint16_ && - m_int32_ == x.m_int32_ && - m_uint32_ == x.m_uint32_ && - m_int64_ == x.m_int64_ && - m_uint64_ == x.m_uint64_ && - m_local_string == x.m_local_string); - } - - /*! - * @brief Comparison operator. - * @param x NewAliases object to compare. - */ - eProsima_user_DllExport bool operator !=( - const NewAliases& x) const - { - return !(*this == x); - } - - /*! - * @brief This function sets a value in member int8_ - * @param _int8_ New value for member int8_ - */ - eProsima_user_DllExport void int8_( - int8_t _int8_) - { - m_int8_ = _int8_; - } - - /*! - * @brief This function returns the value of member int8_ - * @return Value of member int8_ - */ - eProsima_user_DllExport int8_t int8_() const - { - return m_int8_; - } - - /*! - * @brief This function returns a reference to member int8_ - * @return Reference to member int8_ - */ - eProsima_user_DllExport int8_t& int8_() - { - return m_int8_; - } - - - /*! - * @brief This function sets a value in member uint8_ - * @param _uint8_ New value for member uint8_ - */ - eProsima_user_DllExport void uint8_( - uint8_t _uint8_) - { - m_uint8_ = _uint8_; - } - - /*! - * @brief This function returns the value of member uint8_ - * @return Value of member uint8_ - */ - eProsima_user_DllExport uint8_t uint8_() const - { - return m_uint8_; - } - - /*! - * @brief This function returns a reference to member uint8_ - * @return Reference to member uint8_ - */ - eProsima_user_DllExport uint8_t& uint8_() - { - return m_uint8_; - } - - - /*! - * @brief This function sets a value in member int16_ - * @param _int16_ New value for member int16_ - */ - eProsima_user_DllExport void int16_( - int16_t _int16_) - { - m_int16_ = _int16_; - } - - /*! - * @brief This function returns the value of member int16_ - * @return Value of member int16_ - */ - eProsima_user_DllExport int16_t int16_() const - { - return m_int16_; - } - - /*! - * @brief This function returns a reference to member int16_ - * @return Reference to member int16_ - */ - eProsima_user_DllExport int16_t& int16_() - { - return m_int16_; - } - - - /*! - * @brief This function sets a value in member uint16_ - * @param _uint16_ New value for member uint16_ - */ - eProsima_user_DllExport void uint16_( - uint16_t _uint16_) - { - m_uint16_ = _uint16_; - } - - /*! - * @brief This function returns the value of member uint16_ - * @return Value of member uint16_ - */ - eProsima_user_DllExport uint16_t uint16_() const - { - return m_uint16_; - } - - /*! - * @brief This function returns a reference to member uint16_ - * @return Reference to member uint16_ - */ - eProsima_user_DllExport uint16_t& uint16_() - { - return m_uint16_; - } - - - /*! - * @brief This function sets a value in member int32_ - * @param _int32_ New value for member int32_ - */ - eProsima_user_DllExport void int32_( - int32_t _int32_) - { - m_int32_ = _int32_; - } - - /*! - * @brief This function returns the value of member int32_ - * @return Value of member int32_ - */ - eProsima_user_DllExport int32_t int32_() const - { - return m_int32_; - } - - /*! - * @brief This function returns a reference to member int32_ - * @return Reference to member int32_ - */ - eProsima_user_DllExport int32_t& int32_() - { - return m_int32_; - } - - - /*! - * @brief This function sets a value in member uint32_ - * @param _uint32_ New value for member uint32_ - */ - eProsima_user_DllExport void uint32_( - uint32_t _uint32_) - { - m_uint32_ = _uint32_; - } - - /*! - * @brief This function returns the value of member uint32_ - * @return Value of member uint32_ - */ - eProsima_user_DllExport uint32_t uint32_() const - { - return m_uint32_; - } - - /*! - * @brief This function returns a reference to member uint32_ - * @return Reference to member uint32_ - */ - eProsima_user_DllExport uint32_t& uint32_() - { - return m_uint32_; - } - - - /*! - * @brief This function sets a value in member int64_ - * @param _int64_ New value for member int64_ - */ - eProsima_user_DllExport void int64_( - int64_t _int64_) - { - m_int64_ = _int64_; - } - - /*! - * @brief This function returns the value of member int64_ - * @return Value of member int64_ - */ - eProsima_user_DllExport int64_t int64_() const - { - return m_int64_; - } - - /*! - * @brief This function returns a reference to member int64_ - * @return Reference to member int64_ - */ - eProsima_user_DllExport int64_t& int64_() - { - return m_int64_; - } - - - /*! - * @brief This function sets a value in member uint64_ - * @param _uint64_ New value for member uint64_ - */ - eProsima_user_DllExport void uint64_( - uint64_t _uint64_) - { - m_uint64_ = _uint64_; - } - - /*! - * @brief This function returns the value of member uint64_ - * @return Value of member uint64_ - */ - eProsima_user_DllExport uint64_t uint64_() const - { - return m_uint64_; - } - - /*! - * @brief This function returns a reference to member uint64_ - * @return Reference to member uint64_ - */ - eProsima_user_DllExport uint64_t& uint64_() - { - return m_uint64_; - } - - - /*! - * @brief This function copies the value in member local_string - * @param _local_string New value to be copied in member local_string - */ - eProsima_user_DllExport void local_string( - const std::string& _local_string) - { - m_local_string = _local_string; - } - - /*! - * @brief This function moves the value in member local_string - * @param _local_string New value to be moved in member local_string - */ - eProsima_user_DllExport void local_string( - std::string&& _local_string) - { - m_local_string = std::move(_local_string); - } - - /*! - * @brief This function returns a constant reference to member local_string - * @return Constant reference to member local_string - */ - eProsima_user_DllExport const std::string& local_string() const - { - return m_local_string; - } - - /*! - * @brief This function returns a reference to member local_string - * @return Reference to member local_string - */ - eProsima_user_DllExport std::string& local_string() - { - return m_local_string; - } - - - -private: - - int8_t m_int8_{0}; - uint8_t m_uint8_{0}; - int16_t m_int16_{0}; - uint16_t m_uint16_{0}; - int32_t m_int32_{0}; - uint32_t m_uint32_{0}; - int64_t m_int64_{0}; - uint64_t m_uint64_{555}; - std::string m_local_string; - -}; -/*! - * @brief This class represents the union WCharUnion defined by the user in the IDL file. - * @ingroup new_features_4_2 - */ -class WCharUnion -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport WCharUnion() - { - m__d = 'a'; - } - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~WCharUnion() - { - } - - /*! - * @brief Copy constructor. - * @param x Reference to the object WCharUnion that will be copied. - */ - eProsima_user_DllExport WCharUnion( - const WCharUnion& x) - { - m__d = x.m__d; - - switch (m__d) - { - case 'a': - m_case_zero = x.m_case_zero; - break; - - - case 'b': - m_case_one = x.m_case_one; - break; - - default: - break; - } - } - - /*! - * @brief Move constructor. - * @param x Reference to the object WCharUnion that will be copied. - */ - eProsima_user_DllExport WCharUnion( - WCharUnion&& x) noexcept - { - m__d = x.m__d; - - switch (m__d) - { - case 'a': - m_case_zero = x.m_case_zero; - break; - - - case 'b': - m_case_one = x.m_case_one; - break; - - default: - break; - } - } - - /*! - * @brief Copy assignment. - * @param x Reference to the object WCharUnion that will be copied. - */ - eProsima_user_DllExport WCharUnion& operator =( - const WCharUnion& x) - { - m__d = x.m__d; - - switch (m__d) - { - case 'a': - m_case_zero = x.m_case_zero; - break; - - - case 'b': - m_case_one = x.m_case_one; - break; - - default: - break; - } - - return *this; - } - - /*! - * @brief Move assignment. - * @param x Reference to the object WCharUnion that will be copied. - */ - eProsima_user_DllExport WCharUnion& operator =( - WCharUnion&& x) noexcept - { - m__d = x.m__d; - - switch (m__d) - { - case 'a': - m_case_zero = x.m_case_zero; - break; - - - case 'b': - m_case_one = x.m_case_one; - break; - - default: - break; - } - - return *this; - } - - /*! - * @brief Comparison operator. - * @param x WCharUnion object to compare. - */ - eProsima_user_DllExport bool operator ==( - const WCharUnion& x) const - { - if (m__d != x.m__d) - { - return false; - } - - switch (m__d) - { - case 'a': - return (m_case_zero == x.m_case_zero); - break; - - - case 'b': - return (m_case_one == x.m_case_one); - break; - - default: - break; - } - return false; - } - - /*! - * @brief Comparison operator. - * @param x WCharUnion object to compare. - */ - eProsima_user_DllExport bool operator !=( - const WCharUnion& 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( - wchar_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 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 wchar_t _d() const - { - return m__d; - } - - /*! - * @brief This function returns a reference to the discriminator. - * @return Reference to the discriminator. - */ - eProsima_user_DllExport wchar_t& _d() - { - return m__d; - } - - /*! - * @brief This function sets a value in member case_zero - * @param _case_zero New value for member case_zero - */ - eProsima_user_DllExport void case_zero( - int32_t _case_zero) - { - m_case_zero = _case_zero; - m__d = 'a'; - - } - - /*! - * @brief This function returns the value of member case_zero - * @return Value of member case_zero - * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t case_zero() const - { - bool b = false; - - switch (m__d) - { - case 'a': - b = true; - break; - default: - break; - } - - if (!b) - { - throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); - } - - return m_case_zero; - } - - /*! - * @brief This function returns a reference to member case_zero - * @return Reference to member case_zero - * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t& case_zero() - { - bool b = false; - - switch (m__d) - { - case 'a': - b = true; - break; - default: - break; - } - - if (!b) - { - throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); - } - - return m_case_zero; - } - - - /*! - * @brief This function sets a value in member case_one - * @param _case_one New value for member case_one - */ - eProsima_user_DllExport void case_one( - int32_t _case_one) - { - m_case_one = _case_one; - m__d = 'b'; - - } - - /*! - * @brief This function returns the value of member case_one - * @return Value of member case_one - * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t case_one() const - { - bool b = false; - - switch (m__d) - { - case 'b': - b = true; - break; - default: - break; - } - - if (!b) - { - throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); - } - - return m_case_one; - } - - /*! - * @brief This function returns a reference to member case_one - * @return Reference to member case_one - * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t& case_one() - { - bool b = false; - - switch (m__d) - { - case 'b': - b = true; - break; - default: - break; - } - - if (!b) - { - throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); - } - - return m_case_one; - } - - - -private: - - wchar_t m__d; - - int32_t m_case_zero{0}; - int32_t m_case_one{0}; -}; -/*! - * @brief This class represents the union OctetUnion defined by the user in the IDL file. - * @ingroup new_features_4_2 - */ -class OctetUnion -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport OctetUnion() - { - m__d = 5; - } - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~OctetUnion() - { - } - - /*! - * @brief Copy constructor. - * @param x Reference to the object OctetUnion that will be copied. - */ - eProsima_user_DllExport OctetUnion( - const OctetUnion& x) - { - m__d = x.m__d; - - switch (m__d) - { - case 5: - m_case_five = x.m_case_five; - break; - - - case 7: - m_case_seven = x.m_case_seven; - break; - - default: - break; - } - } - - /*! - * @brief Move constructor. - * @param x Reference to the object OctetUnion that will be copied. - */ - eProsima_user_DllExport OctetUnion( - OctetUnion&& x) noexcept - { - m__d = x.m__d; - - switch (m__d) - { - case 5: - m_case_five = x.m_case_five; - break; - - - case 7: - m_case_seven = x.m_case_seven; - break; - - default: - break; - } - } - - /*! - * @brief Copy assignment. - * @param x Reference to the object OctetUnion that will be copied. - */ - eProsima_user_DllExport OctetUnion& operator =( - const OctetUnion& x) - { - m__d = x.m__d; - - switch (m__d) - { - case 5: - m_case_five = x.m_case_five; - break; - - - case 7: - m_case_seven = x.m_case_seven; - break; - - default: - break; - } - - return *this; - } - - /*! - * @brief Move assignment. - * @param x Reference to the object OctetUnion that will be copied. - */ - eProsima_user_DllExport OctetUnion& operator =( - OctetUnion&& x) noexcept - { - m__d = x.m__d; - - switch (m__d) - { - case 5: - m_case_five = x.m_case_five; - break; - - - case 7: - m_case_seven = x.m_case_seven; - break; - - default: - break; - } - - return *this; - } - - /*! - * @brief Comparison operator. - * @param x OctetUnion object to compare. - */ - eProsima_user_DllExport bool operator ==( - const OctetUnion& x) const - { - if (m__d != x.m__d) - { - return false; - } - - switch (m__d) - { - case 5: - return (m_case_five == x.m_case_five); - break; - - - case 7: - return (m_case_seven == x.m_case_seven); - break; - - default: - break; - } - return false; - } - - /*! - * @brief Comparison operator. - * @param x OctetUnion object to compare. - */ - eProsima_user_DllExport bool operator !=( - const OctetUnion& 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 b = false; - - switch (m__d) - { - case 5: - switch (__d) - { - case 5: - b = true; - break; - default: - break; - } - break; - - - case 7: - switch (__d) - { - case 7: - b = true; - break; - default: - break; - } - break; - - default: - break; - } - - if (!b) - { - 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 returns a reference to the discriminator. - * @return Reference to the discriminator. - */ - eProsima_user_DllExport uint8_t& _d() - { - return m__d; - } - - /*! - * @brief This function sets a value in member case_five - * @param _case_five New value for member case_five - */ - eProsima_user_DllExport void case_five( - int32_t _case_five) - { - m_case_five = _case_five; - m__d = 5; - - } - - /*! - * @brief This function returns the value of member case_five - * @return Value of member case_five - * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t case_five() const - { - bool b = false; - - switch (m__d) - { - case 5: - b = true; - break; - default: - break; - } - - if (!b) - { - throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); - } - - return m_case_five; - } - - /*! - * @brief This function returns a reference to member case_five - * @return Reference to member case_five - * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t& case_five() - { - bool b = false; - - switch (m__d) - { - case 5: - b = true; - break; - default: - break; - } - - if (!b) - { - throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); - } - - return m_case_five; - } - - - /*! - * @brief This function sets a value in member case_seven - * @param _case_seven New value for member case_seven - */ - eProsima_user_DllExport void case_seven( - int32_t _case_seven) - { - m_case_seven = _case_seven; - m__d = 7; - - } - - /*! - * @brief This function returns the value of member case_seven - * @return Value of member case_seven - * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t case_seven() const - { - bool b = false; - - switch (m__d) - { - case 7: - b = true; - break; - default: - break; - } - - if (!b) - { - throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); - } - - return m_case_seven; - } - - /*! - * @brief This function returns a reference to member case_seven - * @return Reference to member case_seven - * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t& case_seven() - { - bool b = false; - - switch (m__d) - { - case 7: - b = true; - break; - default: - break; - } - - if (!b) - { - throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); - } - - return m_case_seven; - } - - - -private: - - uint8_t m__d; - - int32_t m_case_five{0}; - int32_t m_case_seven{0}; -}; -/*! - * @brief This class represents the union Int8Union defined by the user in the IDL file. - * @ingroup new_features_4_2 - */ -class Int8Union -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport Int8Union() - { - m__d = 3; - } - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~Int8Union() - { - } - - /*! - * @brief Copy constructor. - * @param x Reference to the object Int8Union that will be copied. - */ - eProsima_user_DllExport Int8Union( - const Int8Union& x) - { - m__d = x.m__d; - - switch (m__d) - { - case 3: - m_case_three = x.m_case_three; - break; - - - case 6: - m_case_six = x.m_case_six; - break; - - default: - break; - } - } - - /*! - * @brief Move constructor. - * @param x Reference to the object Int8Union that will be copied. - */ - eProsima_user_DllExport Int8Union( - Int8Union&& x) noexcept - { - m__d = x.m__d; - - switch (m__d) - { - case 3: - m_case_three = x.m_case_three; - break; - - - case 6: - m_case_six = x.m_case_six; - break; - - default: - break; - } - } - - /*! - * @brief Copy assignment. - * @param x Reference to the object Int8Union that will be copied. - */ - eProsima_user_DllExport Int8Union& operator =( - const Int8Union& x) - { - m__d = x.m__d; - - switch (m__d) - { - case 3: - m_case_three = x.m_case_three; - break; - - - case 6: - m_case_six = x.m_case_six; - break; - - default: - break; - } - - return *this; - } - - /*! - * @brief Move assignment. - * @param x Reference to the object Int8Union that will be copied. - */ - eProsima_user_DllExport Int8Union& operator =( - Int8Union&& x) noexcept - { - m__d = x.m__d; - - switch (m__d) - { - case 3: - m_case_three = x.m_case_three; - break; - - - case 6: - m_case_six = x.m_case_six; - break; - - default: - break; - } - - return *this; - } - - /*! - * @brief Comparison operator. - * @param x Int8Union object to compare. - */ - eProsima_user_DllExport bool operator ==( - const Int8Union& x) const - { - if (m__d != x.m__d) - { - return false; - } - - switch (m__d) - { - case 3: - return (m_case_three == x.m_case_three); - break; - - - case 6: - return (m_case_six == x.m_case_six); - break; - - default: - break; - } - return false; - } - - /*! - * @brief Comparison operator. - * @param x Int8Union object to compare. - */ - eProsima_user_DllExport bool operator !=( - const Int8Union& 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( - int8_t __d) - { - bool b = false; - - switch (m__d) - { - case 3: - switch (__d) - { - case 3: - b = true; - break; - default: - break; - } - break; - - - case 6: - switch (__d) - { - case 6: - b = true; - break; - default: - break; - } - break; - - default: - break; - } - - if (!b) - { - 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 int8_t _d() const - { - return m__d; - } - - /*! - * @brief This function returns a reference to the discriminator. - * @return Reference to the discriminator. - */ - eProsima_user_DllExport int8_t& _d() - { - return m__d; - } - - /*! - * @brief This function sets a value in member case_three - * @param _case_three New value for member case_three - */ - eProsima_user_DllExport void case_three( - int32_t _case_three) - { - m_case_three = _case_three; - m__d = 3; - - } - - /*! - * @brief This function returns the value of member case_three - * @return Value of member case_three - * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t case_three() const - { - bool b = false; - - switch (m__d) - { - case 3: - b = true; - break; - default: - break; - } - - if (!b) - { - throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); - } - - return m_case_three; - } - - /*! - * @brief This function returns a reference to member case_three - * @return Reference to member case_three - * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t& case_three() - { - bool b = false; - - switch (m__d) - { - case 3: - b = true; - break; - default: - break; - } - - if (!b) - { - throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); - } - - return m_case_three; - } - - - /*! - * @brief This function sets a value in member case_six - * @param _case_six New value for member case_six - */ - eProsima_user_DllExport void case_six( - int32_t _case_six) - { - m_case_six = _case_six; - m__d = 6; - - } - - /*! - * @brief This function returns the value of member case_six - * @return Value of member case_six - * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t case_six() const - { - bool b = false; - - switch (m__d) - { - case 6: - b = true; - break; - default: - break; - } - - if (!b) - { - throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); - } - - return m_case_six; - } - - /*! - * @brief This function returns a reference to member case_six - * @return Reference to member case_six - * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t& case_six() - { - bool b = false; - - switch (m__d) - { - case 6: - b = true; - break; - default: - break; - } - - if (!b) - { - throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); - } - - return m_case_six; - } - - - -private: - - int8_t m__d; - - int32_t m_case_three{0}; - int32_t m_case_six{0}; -}; -namespace bitmodule { - -/*! - * @brief This class represents the structure ParentBitset defined by the user in the IDL file. - * @ingroup new_features_4_2 - */ -class ParentBitset -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport ParentBitset() - { - } - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~ParentBitset() - { - } - - /*! - * @brief Copy constructor. - * @param x Reference to the object ParentBitset that will be copied. - */ - eProsima_user_DllExport ParentBitset( - const ParentBitset& x) - { - m_bitset = x.m_bitset; - } - - /*! - * @brief Move constructor. - * @param x Reference to the object ParentBitset that will be copied. - */ - eProsima_user_DllExport ParentBitset( - ParentBitset&& x) noexcept - { - m_bitset = x.m_bitset; - } - - /*! - * @brief Copy assignment. - * @param x Reference to the object ParentBitset that will be copied. - */ - eProsima_user_DllExport ParentBitset& operator =( - const ParentBitset& x) - { - - m_bitset = x.m_bitset; - - return *this; - } - - /*! - * @brief Move assignment. - * @param x Reference to the object ParentBitset that will be copied. - */ - eProsima_user_DllExport ParentBitset& operator =( - ParentBitset&& x) noexcept - { - - m_bitset = x.m_bitset; - - return *this; - } - - /*! - * @brief Comparison operator. - * @param x ParentBitset object to compare. - */ - eProsima_user_DllExport bool operator ==( - const ParentBitset& x) const - { - - return m_bitset == x.m_bitset; - } - - /*! - * @brief Comparison operator. - * @param x ParentBitset object to compare. - */ - eProsima_user_DllExport bool operator !=( - const ParentBitset& x) const - { - return !(*this == x); - } - - /*! - * @brief This function sets a value in member parent_bitfield - * @param _parent_bitfield New value for member parent_bitfield - */ - eProsima_user_DllExport void parent_bitfield( - uint32_t _parent_bitfield) - { - int base = 0; - int size = 17; - for (int i = base; i < base + size; ++i) - { - m_bitset.set(i, !!(_parent_bitfield & 0x01)); - _parent_bitfield = _parent_bitfield >> 1; - } - - } - - /*! - * @brief This function returns the value of member parent_bitfield - * @return Value of member parent_bitfield - */ - eProsima_user_DllExport uint32_t parent_bitfield() const - { - int base = 0; - int size = 17; - std::bitset<17> aux; - for (int i = 0; i < size; ++i) - { - aux.set(i, m_bitset.test(i + base)); - } - return static_cast(aux.to_ullong()); - - } - - - eProsima_user_DllExport std::bitset<17> bitset() const - { - std::string str_value; - - str_value = m_bitset.to_string() + str_value; - - return std::bitset<17>(str_value); - } - - eProsima_user_DllExport void bitset( - const std::bitset<17>& bitset) - { - std::string str_value {bitset.to_string()}; - size_t base_diff {0}; - size_t last_post {std::string::npos}; - - base_diff += 17; - m_bitset = std::bitset<17>(str_value.substr(str_value.length() - base_diff, last_post)); - } - - -private: - - std::bitset<17> m_bitset; -}; -/*! - * @brief This class represents the structure MyBitset defined by the user in the IDL file. - * @ingroup new_features_4_2 - */ -class MyBitset : public ParentBitset -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MyBitset() - : ParentBitset() - { - } - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MyBitset() - { - } - - /*! - * @brief Copy constructor. - * @param x Reference to the object MyBitset that will be copied. - */ - eProsima_user_DllExport MyBitset( - const MyBitset& x) - : ParentBitset(x) - { - m_bitset = x.m_bitset; - } - - /*! - * @brief Move constructor. - * @param x Reference to the object MyBitset that will be copied. - */ - eProsima_user_DllExport MyBitset( - MyBitset&& x) noexcept - : ParentBitset(std::move(x)) - { - m_bitset = x.m_bitset; - } - - /*! - * @brief Copy assignment. - * @param x Reference to the object MyBitset that will be copied. - */ - eProsima_user_DllExport MyBitset& operator =( - const MyBitset& x) - { - ParentBitset::operator =(x); - - m_bitset = x.m_bitset; - - return *this; - } - - /*! - * @brief Move assignment. - * @param x Reference to the object MyBitset that will be copied. - */ - eProsima_user_DllExport MyBitset& operator =( - MyBitset&& x) noexcept - { - ParentBitset::operator =(std::move(x)); - - m_bitset = x.m_bitset; - - return *this; - } - - /*! - * @brief Comparison operator. - * @param x MyBitset object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MyBitset& x) const - { - if (ParentBitset::operator !=(x)) return false; - - return m_bitset == x.m_bitset; - } - - /*! - * @brief Comparison operator. - * @param x MyBitset object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MyBitset& x) const - { - return !(*this == x); - } - - /*! - * @brief This function sets a value in member a - * @param _a New value for member a - */ - eProsima_user_DllExport void a( - uint8_t _a) - { - int base = 0; - int size = 3; - for (int i = base; i < base + size; ++i) - { - m_bitset.set(i, !!(_a & 0x01)); - _a = _a >> 1; - } - - } - - /*! - * @brief This function returns the value of member a - * @return Value of member a - */ - eProsima_user_DllExport uint8_t a() const - { - int base = 0; - int size = 3; - std::bitset<3> aux; - for (int i = 0; i < size; ++i) - { - aux.set(i, m_bitset.test(i + base)); - } - return static_cast(aux.to_ullong()); - - } - - - /*! - * @brief This function sets a value in member b - * @param _b New value for member b - */ - eProsima_user_DllExport void b( - bool _b) - { - int base = 3; - m_bitset.set(base, _b); - } - - /*! - * @brief This function returns the value of member b - * @return Value of member b - */ - eProsima_user_DllExport bool b() const - { - int base = 3; - return m_bitset.test(base); - } - - - /*! - * @brief This function sets a value in member c - * @param _c New value for member c - */ - eProsima_user_DllExport void c( - uint16_t _c) - { - int base = 8; - int size = 10; - for (int i = base; i < base + size; ++i) - { - m_bitset.set(i, !!(_c & 0x01)); - _c = _c >> 1; - } - - } - - /*! - * @brief This function returns the value of member c - * @return Value of member c - */ - eProsima_user_DllExport uint16_t c() const - { - int base = 8; - int size = 10; - std::bitset<10> aux; - for (int i = 0; i < size; ++i) - { - aux.set(i, m_bitset.test(i + base)); - } - return static_cast(aux.to_ullong()); - - } - - - /*! - * @brief This function sets a value in member d - * @param _d New value for member d - */ - eProsima_user_DllExport void d( - int16_t _d) - { - int base = 18; - int size = 5; - for (int i = base; i < base + size; ++i) - { - m_bitset.set(i, !!(_d & 0x01)); - _d = _d >> 1; - } - - } - - /*! - * @brief This function returns the value of member d - * @return Value of member d - */ - eProsima_user_DllExport int16_t d() const - { - int base = 18; - int size = 5; - std::bitset<5> aux; - for (int i = 0; i < size; ++i) - { - aux.set(i, m_bitset.test(i + base)); - } - return static_cast(aux.to_ullong()); - - } - - - /*! - * @brief This function sets a value in member e - * @param _e New value for member e - */ - eProsima_user_DllExport void e( - int16_t _e) - { - int base = 23; - int size = 5; - for (int i = base; i < base + size; ++i) - { - m_bitset.set(i, !!(_e & 0x01)); - _e = _e >> 1; - } - - } - - /*! - * @brief This function returns the value of member e - * @return Value of member e - */ - eProsima_user_DllExport int16_t e() const - { - int base = 23; - int size = 5; - std::bitset<5> aux; - for (int i = 0; i < size; ++i) - { - aux.set(i, m_bitset.test(i + base)); - } - return static_cast(aux.to_ullong()); - - } - - - /*! - * @brief This function sets a value in member f - * @param _f New value for member f - */ - eProsima_user_DllExport void f( - int16_t _f) - { - int base = 28; - int size = 5; - for (int i = base; i < base + size; ++i) - { - m_bitset.set(i, !!(_f & 0x01)); - _f = _f >> 1; - } - - } - - /*! - * @brief This function returns the value of member f - * @return Value of member f - */ - eProsima_user_DllExport int16_t f() const - { - int base = 28; - int size = 5; - std::bitset<5> aux; - for (int i = 0; i < size; ++i) - { - aux.set(i, m_bitset.test(i + base)); - } - return static_cast(aux.to_ullong()); - - } - - - eProsima_user_DllExport std::bitset<50> bitset() const - { - std::string str_value; - - str_value = static_cast(this)->bitset().to_string() + str_value; - - str_value = m_bitset.to_string() + str_value; - - return std::bitset<50>(str_value); - } - - eProsima_user_DllExport void bitset( - const std::bitset<50>& bitset) - { - std::string str_value {bitset.to_string()}; - size_t base_diff {0}; - size_t last_post {std::string::npos}; - - { - base_diff += 17; - std::bitset<17> internal_bitset(str_value.substr(str_value.length() - base_diff, last_post)); - static_cast(this)->bitset(internal_bitset); - last_post = base_diff; - } - - base_diff += 33; - m_bitset = std::bitset<33>(str_value.substr(str_value.length() - base_diff, last_post)); - } - - -private: - - std::bitset<33> m_bitset; -}; -/*! - * @brief This enumeration represents the MyBitMask bitflags defined by the user in the IDL file. - * @ingroup new_features_4_2 - */ -enum MyBitMaskBits : uint8_t -{ - flag0 = 0x01ull << 0, - flag1 = 0x01ull << 1, - flag4 = 0x01ull << 4, - flag6 = 0x01ull << 6, - flag7 = 0x01ull << 7 -}; -typedef uint8_t MyBitMask; -/*! - * @brief This class represents the structure BitsetBitmask defined by the user in the IDL file. - * @ingroup new_features_4_2 - */ -class BitsetBitmask -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport BitsetBitmask() - { - } - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~BitsetBitmask() - { - } - - /*! - * @brief Copy constructor. - * @param x Reference to the object BitsetBitmask that will be copied. - */ - eProsima_user_DllExport BitsetBitmask( - const BitsetBitmask& x) - { - m_mybitset = x.m_mybitset; - - m_mybitmask = x.m_mybitmask; - - } - - /*! - * @brief Move constructor. - * @param x Reference to the object BitsetBitmask that will be copied. - */ - eProsima_user_DllExport BitsetBitmask( - BitsetBitmask&& x) noexcept - { - m_mybitset = std::move(x.m_mybitset); - m_mybitmask = std::move(x.m_mybitmask); - } - - /*! - * @brief Copy assignment. - * @param x Reference to the object BitsetBitmask that will be copied. - */ - eProsima_user_DllExport BitsetBitmask& operator =( - const BitsetBitmask& x) - { - - m_mybitset = x.m_mybitset; - - m_mybitmask = x.m_mybitmask; - - return *this; - } - - /*! - * @brief Move assignment. - * @param x Reference to the object BitsetBitmask that will be copied. - */ - eProsima_user_DllExport BitsetBitmask& operator =( - BitsetBitmask&& x) noexcept - { - - m_mybitset = std::move(x.m_mybitset); - m_mybitmask = std::move(x.m_mybitmask); - return *this; - } - - /*! - * @brief Comparison operator. - * @param x BitsetBitmask object to compare. - */ - eProsima_user_DllExport bool operator ==( - const BitsetBitmask& x) const - { - return (m_mybitset == x.m_mybitset && - m_mybitmask == x.m_mybitmask); - } - - /*! - * @brief Comparison operator. - * @param x BitsetBitmask object to compare. - */ - eProsima_user_DllExport bool operator !=( - const BitsetBitmask& x) const - { - return !(*this == x); - } - - /*! - * @brief This function copies the value in member mybitset - * @param _mybitset New value to be copied in member mybitset - */ - eProsima_user_DllExport void mybitset( - const MyBitset& _mybitset) - { - m_mybitset = _mybitset; - } - - /*! - * @brief This function moves the value in member mybitset - * @param _mybitset New value to be moved in member mybitset - */ - eProsima_user_DllExport void mybitset( - MyBitset&& _mybitset) - { - m_mybitset = std::move(_mybitset); - } - - /*! - * @brief This function returns a constant reference to member mybitset - * @return Constant reference to member mybitset - */ - eProsima_user_DllExport const MyBitset& mybitset() const - { - return m_mybitset; - } - - /*! - * @brief This function returns a reference to member mybitset - * @return Reference to member mybitset - */ - eProsima_user_DllExport MyBitset& mybitset() - { - return m_mybitset; - } - - - /*! - * @brief This function copies the value in member mybitmask - * @param _mybitmask New value to be copied in member mybitmask - */ - eProsima_user_DllExport void mybitmask( - const MyBitMask& _mybitmask) - { - m_mybitmask = _mybitmask; - } - - /*! - * @brief This function moves the value in member mybitmask - * @param _mybitmask New value to be moved in member mybitmask - */ - eProsima_user_DllExport void mybitmask( - MyBitMask&& _mybitmask) - { - m_mybitmask = std::move(_mybitmask); - } - - /*! - * @brief This function returns a constant reference to member mybitmask - * @return Constant reference to member mybitmask - */ - eProsima_user_DllExport const MyBitMask& mybitmask() const - { - return m_mybitmask; - } - - /*! - * @brief This function returns a reference to member mybitmask - * @return Reference to member mybitmask - */ - eProsima_user_DllExport MyBitMask& mybitmask() - { - return m_mybitmask; - } - - - -private: - - MyBitset m_mybitset; - MyBitMask m_mybitmask{0}; - -}; -/*! - * @brief This class represents the structure BM2 defined by the user in the IDL file. - * @ingroup new_features_4_2 - */ -class BM2 : public BitsetBitmask -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport BM2() - : BitsetBitmask() - { - } - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~BM2() - { - } - - /*! - * @brief Copy constructor. - * @param x Reference to the object BM2 that will be copied. - */ - eProsima_user_DllExport BM2( - const BM2& x) - : BitsetBitmask(x) - { - m_two = x.m_two; - - m_mylong = x.m_mylong; - - } - - /*! - * @brief Move constructor. - * @param x Reference to the object BM2 that will be copied. - */ - eProsima_user_DllExport BM2( - BM2&& x) noexcept - : BitsetBitmask(std::move(x)) - - { - m_two = std::move(x.m_two); - m_mylong = x.m_mylong; - } - - /*! - * @brief Copy assignment. - * @param x Reference to the object BM2 that will be copied. - */ - eProsima_user_DllExport BM2& operator =( - const BM2& x) - { - BitsetBitmask::operator =(x); - - m_two = x.m_two; - - m_mylong = x.m_mylong; - - return *this; - } - - /*! - * @brief Move assignment. - * @param x Reference to the object BM2 that will be copied. - */ - eProsima_user_DllExport BM2& operator =( - BM2&& x) noexcept - { - BitsetBitmask::operator =(std::move(x)); - - m_two = std::move(x.m_two); - m_mylong = x.m_mylong; - return *this; - } - - /*! - * @brief Comparison operator. - * @param x BM2 object to compare. - */ - eProsima_user_DllExport bool operator ==( - const BM2& x) const - { - if (BitsetBitmask::operator !=(x)) - { - return false; - } - return (m_two == x.m_two && - m_mylong == x.m_mylong); - } - - /*! - * @brief Comparison operator. - * @param x BM2 object to compare. - */ - eProsima_user_DllExport bool operator !=( - const BM2& x) const - { - return !(*this == x); - } - - /*! - * @brief This function copies the value in member two - * @param _two New value to be copied in member two - */ - eProsima_user_DllExport void two( - const MyBitMask& _two) - { - m_two = _two; - } - - /*! - * @brief This function moves the value in member two - * @param _two New value to be moved in member two - */ - eProsima_user_DllExport void two( - MyBitMask&& _two) - { - m_two = std::move(_two); - } - - /*! - * @brief This function returns a constant reference to member two - * @return Constant reference to member two - */ - eProsima_user_DllExport const MyBitMask& two() const - { - return m_two; - } - - /*! - * @brief This function returns a reference to member two - * @return Reference to member two - */ - eProsima_user_DllExport MyBitMask& two() - { - return m_two; - } - - - /*! - * @brief This function sets a value in member mylong - * @param _mylong New value for member mylong - */ - eProsima_user_DllExport void mylong( - int32_t _mylong) - { - m_mylong = _mylong; - } - - /*! - * @brief This function returns the value of member mylong - * @return Value of member mylong - */ - eProsima_user_DllExport int32_t mylong() const - { - return m_mylong; - } - - /*! - * @brief This function returns a reference to member mylong - * @return Reference to member mylong - */ - eProsima_user_DllExport int32_t& mylong() - { - return m_mylong; - } - - - -private: - - MyBitMask m_two{0}; - int32_t m_mylong{0}; - -}; - -} // namespace bitmodule -/*! - * @brief This class represents the structure StructTest defined by the user in the IDL file. - * @ingroup new_features_4_2 - */ -class StructTest : public NewAliases -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport StructTest() - : NewAliases() - { - } - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~StructTest() - { - } - - /*! - * @brief Copy constructor. - * @param x Reference to the object StructTest that will be copied. - */ - eProsima_user_DllExport StructTest( - const StructTest& x) - : NewAliases(x) - { - m_octetUnion = x.m_octetUnion; - - m_int8Union = x.m_int8Union; - - m_myStructBits = x.m_myStructBits; - - } - - /*! - * @brief Move constructor. - * @param x Reference to the object StructTest that will be copied. - */ - eProsima_user_DllExport StructTest( - StructTest&& x) noexcept - : NewAliases(std::move(x)) - - { - m_octetUnion = std::move(x.m_octetUnion); - m_int8Union = std::move(x.m_int8Union); - m_myStructBits = std::move(x.m_myStructBits); - } - - /*! - * @brief Copy assignment. - * @param x Reference to the object StructTest that will be copied. - */ - eProsima_user_DllExport StructTest& operator =( - const StructTest& x) - { - NewAliases::operator =(x); - - m_octetUnion = x.m_octetUnion; - - m_int8Union = x.m_int8Union; - - m_myStructBits = x.m_myStructBits; - - return *this; - } - - /*! - * @brief Move assignment. - * @param x Reference to the object StructTest that will be copied. - */ - eProsima_user_DllExport StructTest& operator =( - StructTest&& x) noexcept - { - NewAliases::operator =(std::move(x)); - - m_octetUnion = std::move(x.m_octetUnion); - m_int8Union = std::move(x.m_int8Union); - m_myStructBits = std::move(x.m_myStructBits); - return *this; - } - - /*! - * @brief Comparison operator. - * @param x StructTest object to compare. - */ - eProsima_user_DllExport bool operator ==( - const StructTest& x) const - { - if (NewAliases::operator !=(x)) - { - return false; - } - return (m_octetUnion == x.m_octetUnion && - m_int8Union == x.m_int8Union && - m_myStructBits == x.m_myStructBits); - } - - /*! - * @brief Comparison operator. - * @param x StructTest object to compare. - */ - eProsima_user_DllExport bool operator !=( - const StructTest& x) const - { - return !(*this == x); - } - - /*! - * @brief This function copies the value in member octetUnion - * @param _octetUnion New value to be copied in member octetUnion - */ - eProsima_user_DllExport void octetUnion( - const OctetUnion& _octetUnion) - { - m_octetUnion = _octetUnion; - } - - /*! - * @brief This function moves the value in member octetUnion - * @param _octetUnion New value to be moved in member octetUnion - */ - eProsima_user_DllExport void octetUnion( - OctetUnion&& _octetUnion) - { - m_octetUnion = std::move(_octetUnion); - } - - /*! - * @brief This function returns a constant reference to member octetUnion - * @return Constant reference to member octetUnion - */ - eProsima_user_DllExport const OctetUnion& octetUnion() const - { - return m_octetUnion; - } - - /*! - * @brief This function returns a reference to member octetUnion - * @return Reference to member octetUnion - */ - eProsima_user_DllExport OctetUnion& octetUnion() - { - return m_octetUnion; - } - - - /*! - * @brief This function copies the value in member int8Union - * @param _int8Union New value to be copied in member int8Union - */ - eProsima_user_DllExport void int8Union( - const Int8Union& _int8Union) - { - m_int8Union = _int8Union; - } - - /*! - * @brief This function moves the value in member int8Union - * @param _int8Union New value to be moved in member int8Union - */ - eProsima_user_DllExport void int8Union( - Int8Union&& _int8Union) - { - m_int8Union = std::move(_int8Union); - } - - /*! - * @brief This function returns a constant reference to member int8Union - * @return Constant reference to member int8Union - */ - eProsima_user_DllExport const Int8Union& int8Union() const - { - return m_int8Union; - } - - /*! - * @brief This function returns a reference to member int8Union - * @return Reference to member int8Union - */ - eProsima_user_DllExport Int8Union& int8Union() - { - return m_int8Union; - } - - - /*! - * @brief This function copies the value in member myStructBits - * @param _myStructBits New value to be copied in member myStructBits - */ - eProsima_user_DllExport void myStructBits( - const bitmodule::BM2& _myStructBits) - { - m_myStructBits = _myStructBits; - } - - /*! - * @brief This function moves the value in member myStructBits - * @param _myStructBits New value to be moved in member myStructBits - */ - eProsima_user_DllExport void myStructBits( - bitmodule::BM2&& _myStructBits) - { - m_myStructBits = std::move(_myStructBits); - } - - /*! - * @brief This function returns a constant reference to member myStructBits - * @return Constant reference to member myStructBits - */ - eProsima_user_DllExport const bitmodule::BM2& myStructBits() const - { - return m_myStructBits; - } - - /*! - * @brief This function returns a reference to member myStructBits - * @return Reference to member myStructBits - */ - eProsima_user_DllExport bitmodule::BM2& myStructBits() - { - return m_myStructBits; - } - - - -private: - - OctetUnion m_octetUnion; - Int8Union m_int8Union; - bitmodule::BM2 m_myStructBits; - -}; - -#endif // _FAST_DDS_GENERATED_NEW_FEATURES_4_2_HPP_ - - diff --git a/test/unittest/dynamic_types/idl/new_features_4_2.idl b/test/unittest/dynamic_types/idl/new_features_4_2.idl deleted file mode 100644 index 533096f4353..00000000000 --- a/test/unittest/dynamic_types/idl/new_features_4_2.idl +++ /dev/null @@ -1,85 +0,0 @@ -struct NewAliases -{ - int8 int8_; - uint8 uint8_; - int16 int16_; - uint16 uint16_; - int32 int32_; - uint32 uint32_; - int64 int64_; - @default(555) uint64 uint64_; - @non_serialized string local_string; -}; - -union WCharUnion switch (wchar) -{ - case 'a': - long case_zero; - case 'b': - long case_one; -}; - -union OctetUnion switch (octet) -{ - case 5: - long case_five; - case 7: - long case_seven; -}; - - -union Int8Union switch (int8) -{ - case 3: - long case_three; - case 6: - long case_six; -}; - -module bitmodule -{ - bitset ParentBitset - { - bitfield<17> parent_bitfield; - }; - - bitset MyBitset : ParentBitset - { - bitfield<3> a; - bitfield<1> b; - bitfield<4>; - bitfield<10> c; - bitfield<5, short> d, e, f; - }; - - @bit_bound(8) - bitmask MyBitMask - { - @position(0) flag0, - @position(1) flag1, - @position(4) flag4, - @position(6) flag6, - flag7 - }; - - - struct BitsetBitmask - { - MyBitset mybitset; - MyBitMask mybitmask; - }; - - struct BM2 : BitsetBitmask - { - MyBitMask two; - long mylong; - }; -}; - -struct StructTest : NewAliases -{ - //WCharUnion charUnion; //TODO(richiware) Remove when xtype 1.3. Uncomment also in DynamicTypes_4_2_Tests.cpp - OctetUnion octetUnion; - Int8Union int8Union; - bitmodule::BM2 myStructBits; -}; diff --git a/test/unittest/dynamic_types/idl/new_features_4_2CdrAux.hpp b/test/unittest/dynamic_types/idl/new_features_4_2CdrAux.hpp deleted file mode 100644 index a48b8bd12c4..00000000000 --- a/test/unittest/dynamic_types/idl/new_features_4_2CdrAux.hpp +++ /dev/null @@ -1,74 +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 new_features_4_2CdrAux.hpp - * This source file contains some definitions of CDR related functions. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_NEW_FEATURES_4_2CDRAUX_HPP_ -#define _FAST_DDS_GENERATED_NEW_FEATURES_4_2CDRAUX_HPP_ - -#include "new_features_4_2.hpp" - -constexpr uint32_t bitmodule_BM2_max_cdr_typesize {24UL}; -constexpr uint32_t bitmodule_BM2_max_key_cdr_typesize {0UL}; - -constexpr uint32_t NewAliases_max_cdr_typesize {40UL}; -constexpr uint32_t NewAliases_max_key_cdr_typesize {0UL}; - - -constexpr uint32_t StructTest_max_cdr_typesize {88UL}; -constexpr uint32_t StructTest_max_key_cdr_typesize {0UL}; - - - - -constexpr uint32_t bitmodule_BitsetBitmask_max_cdr_typesize {17UL}; -constexpr uint32_t bitmodule_BitsetBitmask_max_key_cdr_typesize {0UL}; - - -namespace eprosima { -namespace fastcdr { - -class Cdr; -class CdrSizeCalculator; - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const NewAliases& data); - - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const bitmodule::BitsetBitmask& data); - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const bitmodule::BM2& data); - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const StructTest& data); - - -} // namespace fastcdr -} // namespace eprosima - -#endif // _FAST_DDS_GENERATED_NEW_FEATURES_4_2CDRAUX_HPP_ - diff --git a/test/unittest/dynamic_types/idl/new_features_4_2CdrAux.ipp b/test/unittest/dynamic_types/idl/new_features_4_2CdrAux.ipp deleted file mode 100644 index 3e5cc86c57e..00000000000 --- a/test/unittest/dynamic_types/idl/new_features_4_2CdrAux.ipp +++ /dev/null @@ -1,926 +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 new_features_4_2CdrAux.ipp - * This source file contains some declarations of CDR related functions. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_NEW_FEATURES_4_2CDRAUX_IPP_ -#define _FAST_DDS_GENERATED_NEW_FEATURES_4_2CDRAUX_IPP_ - -#include "new_features_4_2CdrAux.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 NewAliases& 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.int8_(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.uint8_(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), - data.int16_(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), - data.uint16_(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(4), - data.int32_(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(5), - data.uint32_(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(6), - data.int64_(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(7), - data.uint64_(), 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 NewAliases& 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.int8_() - << eprosima::fastcdr::MemberId(1) << data.uint8_() - << eprosima::fastcdr::MemberId(2) << data.int16_() - << eprosima::fastcdr::MemberId(3) << data.uint16_() - << eprosima::fastcdr::MemberId(4) << data.int32_() - << eprosima::fastcdr::MemberId(5) << data.uint32_() - << eprosima::fastcdr::MemberId(6) << data.int64_() - << eprosima::fastcdr::MemberId(7) << data.uint64_() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - NewAliases& 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.int8_(); - break; - - case 1: - dcdr >> data.uint8_(); - break; - - case 2: - dcdr >> data.int16_(); - break; - - case 3: - dcdr >> data.uint16_(); - break; - - case 4: - dcdr >> data.int32_(); - break; - - case 5: - dcdr >> data.uint32_(); - break; - - case 6: - dcdr >> data.int64_(); - break; - - case 7: - dcdr >> data.uint64_(); - break; - - case 8: - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const NewAliases& data) -{ - static_cast(scdr); - static_cast(data); -} - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const WCharUnion& 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.case_zero(), current_alignment); - break; - - case 'b': - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), - data.case_one(), 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 WCharUnion& 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.case_zero(); - break; - - case 'b': - scdr << eprosima::fastcdr::MemberId(2) << data.case_one(); - break; - - default: - break; - } - - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - WCharUnion& 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.case_zero(); - break; - - case 'b': - dcdr >> data.case_one(); - break; - - default: - break; - } - ret_value = false; - break; - } - return ret_value; - }); -} - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const OctetUnion& 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 5: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.case_five(), current_alignment); - break; - - case 7: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), - data.case_seven(), 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 OctetUnion& 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 5: - scdr << eprosima::fastcdr::MemberId(1) << data.case_five(); - break; - - case 7: - scdr << eprosima::fastcdr::MemberId(2) << data.case_seven(); - break; - - default: - break; - } - - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - OctetUnion& 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 5: - dcdr >> data.case_five(); - break; - - case 7: - dcdr >> data.case_seven(); - break; - - default: - break; - } - ret_value = false; - break; - } - return ret_value; - }); -} - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const Int8Union& 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 3: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.case_three(), current_alignment); - break; - - case 6: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), - data.case_six(), 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 Int8Union& 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 3: - scdr << eprosima::fastcdr::MemberId(1) << data.case_three(); - break; - - case 6: - scdr << eprosima::fastcdr::MemberId(2) << data.case_six(); - break; - - default: - break; - } - - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - Int8Union& 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 3: - dcdr >> data.case_three(); - break; - - case 6: - dcdr >> data.case_six(); - break; - - default: - break; - } - ret_value = false; - break; - } - return ret_value; - }); -} - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const bitmodule::ParentBitset& data, - size_t& current_alignment) -{ - using namespace bitmodule; - - return calculator.calculate_serialized_size(data.bitset(), current_alignment); -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const bitmodule::ParentBitset& data) -{ - using namespace bitmodule; - - scdr << data.bitset(); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& dcdr, - bitmodule::ParentBitset& data) -{ - using namespace bitmodule; - - std::bitset<17> bitset; - dcdr >> bitset; - data.bitset(bitset); -} - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const bitmodule::MyBitset& data, - size_t& current_alignment) -{ - using namespace bitmodule; - - return calculator.calculate_serialized_size(data.bitset(), current_alignment); -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const bitmodule::MyBitset& data) -{ - using namespace bitmodule; - - scdr << data.bitset(); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& dcdr, - bitmodule::MyBitset& data) -{ - using namespace bitmodule; - - std::bitset<50> bitset; - dcdr >> bitset; - data.bitset(bitset); -} - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const bitmodule::BitsetBitmask& data, - size_t& current_alignment) -{ - using namespace bitmodule; - - 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.mybitset(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.mybitmask(), 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 bitmodule::BitsetBitmask& data) -{ - using namespace bitmodule; - - 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.mybitset() - << eprosima::fastcdr::MemberId(1) << data.mybitmask() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - bitmodule::BitsetBitmask& data) -{ - using namespace bitmodule; - - 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.mybitset(); - break; - - case 1: - dcdr >> data.mybitmask(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const bitmodule::BitsetBitmask& data) -{ - using namespace bitmodule; - - static_cast(scdr); - static_cast(data); -} - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const bitmodule::BM2& data, - size_t& current_alignment) -{ - using namespace bitmodule; - - 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.mybitset(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.mybitmask(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), - data.two(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), - data.mylong(), 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 bitmodule::BM2& data) -{ - using namespace bitmodule; - - 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.mybitset() - << eprosima::fastcdr::MemberId(1) << data.mybitmask() - << eprosima::fastcdr::MemberId(2) << data.two() - << eprosima::fastcdr::MemberId(3) << data.mylong() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - bitmodule::BM2& data) -{ - using namespace bitmodule; - - 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.mybitset(); - break; - - case 1: - dcdr >> data.mybitmask(); - break; - - case 2: - dcdr >> data.two(); - break; - - case 3: - dcdr >> data.mylong(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const bitmodule::BM2& data) -{ - using namespace bitmodule; - - static_cast(scdr); - static_cast(data); -} - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const StructTest& 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.int8_(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.uint8_(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), - data.int16_(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), - data.uint16_(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(4), - data.int32_(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(5), - data.uint32_(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(6), - data.int64_(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(7), - data.uint64_(), current_alignment); - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(9), - data.octetUnion(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(10), - data.int8Union(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(11), - data.myStructBits(), 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 StructTest& 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.int8_() - << eprosima::fastcdr::MemberId(1) << data.uint8_() - << eprosima::fastcdr::MemberId(2) << data.int16_() - << eprosima::fastcdr::MemberId(3) << data.uint16_() - << eprosima::fastcdr::MemberId(4) << data.int32_() - << eprosima::fastcdr::MemberId(5) << data.uint32_() - << eprosima::fastcdr::MemberId(6) << data.int64_() - << eprosima::fastcdr::MemberId(7) << data.uint64_() - << eprosima::fastcdr::MemberId(9) << data.octetUnion() - << eprosima::fastcdr::MemberId(10) << data.int8Union() - << eprosima::fastcdr::MemberId(11) << data.myStructBits() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - StructTest& 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.int8_(); - break; - - case 1: - dcdr >> data.uint8_(); - break; - - case 2: - dcdr >> data.int16_(); - break; - - case 3: - dcdr >> data.uint16_(); - break; - - case 4: - dcdr >> data.int32_(); - break; - - case 5: - dcdr >> data.uint32_(); - break; - - case 6: - dcdr >> data.int64_(); - break; - - case 7: - dcdr >> data.uint64_(); - break; - - case 8: - break; - - case 9: - dcdr >> data.octetUnion(); - break; - - case 10: - dcdr >> data.int8Union(); - break; - - case 11: - dcdr >> data.myStructBits(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const StructTest& data) -{ - static_cast(scdr); - static_cast(data); -} - - - -} // namespace fastcdr -} // namespace eprosima - -#endif // _FAST_DDS_GENERATED_NEW_FEATURES_4_2CDRAUX_IPP_ - diff --git a/test/unittest/dynamic_types/idl/new_features_4_2PubSubTypes.cxx b/test/unittest/dynamic_types/idl/new_features_4_2PubSubTypes.cxx deleted file mode 100644 index e672ee3f3ac..00000000000 --- a/test/unittest/dynamic_types/idl/new_features_4_2PubSubTypes.cxx +++ /dev/null @@ -1,814 +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 new_features_4_2PubSubTypes.cpp - * This header file contains the implementation of the serialization functions. - * - * This file was generated by the tool fastddsgen. - */ - -#include "new_features_4_2PubSubTypes.h" - -#include -#include - -#include "new_features_4_2CdrAux.hpp" -#include "new_features_4_2TypeObjectSupport.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; - -NewAliasesPubSubType::NewAliasesPubSubType() -{ - setName("NewAliases"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(NewAliases::getMaxCdrSerializedSize()); -#else - NewAliases_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 = NewAliases_max_key_cdr_typesize > 16 ? NewAliases_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -NewAliasesPubSubType::~NewAliasesPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool NewAliasesPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - NewAliases* 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 NewAliasesPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - NewAliases* 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 NewAliasesPubSubType::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* NewAliasesPubSubType::createData() -{ - return reinterpret_cast(new NewAliases()); -} - -void NewAliasesPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool NewAliasesPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - NewAliases* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - NewAliases_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 || NewAliases_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} - -void NewAliasesPubSubType::register_type_object_representation() const -{ - register_new_features_4_2_type_objects(); -} - - - - -namespace bitmodule { - BitsetBitmaskPubSubType::BitsetBitmaskPubSubType() - { - setName("bitmodule::BitsetBitmask"); - uint32_t type_size = - #if FASTCDR_VERSION_MAJOR == 1 - static_cast(BitsetBitmask::getMaxCdrSerializedSize()); - #else - bitmodule_BitsetBitmask_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 = bitmodule_BitsetBitmask_max_key_cdr_typesize > 16 ? bitmodule_BitsetBitmask_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - BitsetBitmaskPubSubType::~BitsetBitmaskPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool BitsetBitmaskPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) - { - BitsetBitmask* 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 BitsetBitmaskPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - try - { - // Convert DATA to pointer of your type - BitsetBitmask* 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 BitsetBitmaskPubSubType::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* BitsetBitmaskPubSubType::createData() - { - return reinterpret_cast(new BitsetBitmask()); - } - - void BitsetBitmaskPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool BitsetBitmaskPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - BitsetBitmask* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - bitmodule_BitsetBitmask_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 || bitmodule_BitsetBitmask_max_key_cdr_typesize > 16) - { - m_md5.init(); - #if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - #else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); - #endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - void BitsetBitmaskPubSubType::register_type_object_representation() const - { - register_new_features_4_2_type_objects(); - } - - BM2PubSubType::BM2PubSubType() - { - setName("bitmodule::BM2"); - uint32_t type_size = - #if FASTCDR_VERSION_MAJOR == 1 - static_cast(BM2::getMaxCdrSerializedSize()); - #else - bitmodule_BM2_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 = bitmodule_BM2_max_key_cdr_typesize > 16 ? bitmodule_BM2_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - BM2PubSubType::~BM2PubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool BM2PubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) - { - BM2* 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 BM2PubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - try - { - // Convert DATA to pointer of your type - BM2* 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 BM2PubSubType::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* BM2PubSubType::createData() - { - return reinterpret_cast(new BM2()); - } - - void BM2PubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool BM2PubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - BM2* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - bitmodule_BM2_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 || bitmodule_BM2_max_key_cdr_typesize > 16) - { - m_md5.init(); - #if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - #else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); - #endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - void BM2PubSubType::register_type_object_representation() const - { - register_new_features_4_2_type_objects(); - } - -} // namespace bitmodule - -StructTestPubSubType::StructTestPubSubType() -{ - setName("StructTest"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(StructTest::getMaxCdrSerializedSize()); -#else - StructTest_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 = StructTest_max_key_cdr_typesize > 16 ? StructTest_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -StructTestPubSubType::~StructTestPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool StructTestPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - StructTest* 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 StructTestPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - StructTest* 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 StructTestPubSubType::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* StructTestPubSubType::createData() -{ - return reinterpret_cast(new StructTest()); -} - -void StructTestPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool StructTestPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - StructTest* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - StructTest_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 || StructTest_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} - -void StructTestPubSubType::register_type_object_representation() const -{ - register_new_features_4_2_type_objects(); -} - - -// Include auxiliary functions like for serializing/deserializing. -#include "new_features_4_2CdrAux.ipp" diff --git a/test/unittest/dynamic_types/idl/new_features_4_2PubSubTypes.h b/test/unittest/dynamic_types/idl/new_features_4_2PubSubTypes.h deleted file mode 100644 index 4fe6a8d8422..00000000000 --- a/test/unittest/dynamic_types/idl/new_features_4_2PubSubTypes.h +++ /dev/null @@ -1,412 +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 new_features_4_2PubSubTypes.h - * This header file contains the declaration of the serialization functions. - * - * This file was generated by the tool fastddsgen. - */ - - -#ifndef _FAST_DDS_GENERATED_NEW_FEATURES_4_2_PUBSUBTYPES_H_ -#define _FAST_DDS_GENERATED_NEW_FEATURES_4_2_PUBSUBTYPES_H_ - -#include -#include -#include -#include -#include - -#include "new_features_4_2.hpp" - - -#if !defined(GEN_API_VER) || (GEN_API_VER != 2) -#error \ - Generated new_features_4_2 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 NewAliases defined by the user in the IDL file. - * @ingroup new_features_4_2 - */ -class NewAliasesPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef NewAliases type; - - eProsima_user_DllExport NewAliasesPubSubType(); - - eProsima_user_DllExport ~NewAliasesPubSubType() 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; - -}; - - - -namespace bitmodule -{ - - /*! - * @brief This class represents the TopicDataType of the type BitsetBitmask defined by the user in the IDL file. - * @ingroup new_features_4_2 - */ - class BitsetBitmaskPubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: - - typedef BitsetBitmask type; - - eProsima_user_DllExport BitsetBitmaskPubSubType(); - - eProsima_user_DllExport ~BitsetBitmaskPubSubType() 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 BM2 defined by the user in the IDL file. - * @ingroup new_features_4_2 - */ - class BM2PubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: - - typedef BM2 type; - - eProsima_user_DllExport BM2PubSubType(); - - eProsima_user_DllExport ~BM2PubSubType() 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; - - }; -} // namespace bitmodule - -/*! - * @brief This class represents the TopicDataType of the type StructTest defined by the user in the IDL file. - * @ingroup new_features_4_2 - */ -class StructTestPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef StructTest type; - - eProsima_user_DllExport StructTestPubSubType(); - - eProsima_user_DllExport ~StructTestPubSubType() 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; - -}; - -#endif // _FAST_DDS_GENERATED_NEW_FEATURES_4_2_PUBSUBTYPES_H_ - diff --git a/test/unittest/dynamic_types/idl/new_features_4_2TypeObjectSupport.cxx b/test/unittest/dynamic_types/idl/new_features_4_2TypeObjectSupport.cxx deleted file mode 100644 index 0f86e6e0bee..00000000000 --- a/test/unittest/dynamic_types/idl/new_features_4_2TypeObjectSupport.cxx +++ /dev/null @@ -1,4274 +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 new_features_4_2TypeObjectSupport.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 "new_features_4_2TypeObjectSupport.hpp" - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "new_features_4_2.hpp" - - -using namespace eprosima::fastdds::dds::xtypes; - -void register_new_features_4_2_type_objects() -{ - static std::once_flag once_flag; - std::call_once(once_flag, []() - { - register_NewAliases_type_identifier(); - - register_WCharUnion_type_identifier(); - - register_OctetUnion_type_identifier(); - - register_Int8Union_type_identifier(); - - bitmodule::register_bitmodule_BitsetBitmask_type_identifier(); - - bitmodule::register_bitmodule_BM2_type_identifier(); - - register_StructTest_type_identifier(); - - }); -} - -void register_NewAliases_type_identifier() -{ - { - StructTypeFlag struct_flags_NewAliases = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_NewAliases; - TypeIdentifierPair type_ids_NewAliases; - QualifiedTypeName type_name_NewAliases = "NewAliases"; - eprosima::fastcdr::optional type_ann_builtin_NewAliases; - eprosima::fastcdr::optional ann_custom_NewAliases; - CompleteTypeDetail detail_NewAliases = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_NewAliases, ann_custom_NewAliases, type_name_NewAliases.to_string()); - CompleteStructHeader header_NewAliases; - header_NewAliases = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_NewAliases); - CompleteStructMemberSeq member_seq_NewAliases; - { - return_code_NewAliases = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int8_t", type_ids_NewAliases); - - if (return_code_NewAliases != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "int8_ Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_int8_ = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_int8_; - MemberId member_id_int8_ = 0x00000000; - if (EK_COMPLETE == type_ids_NewAliases.type_identifier1()._d() || TK_NONE == type_ids_NewAliases.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_NewAliases.type_identifier1()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_NewAliases.type_identifier1()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_NewAliases.type_identifier1()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_NewAliases.type_identifier1()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_NewAliases.type_identifier1()._d() && - (EK_COMPLETE == type_ids_NewAliases.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_NewAliases.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_NewAliases.type_identifier1()._d() && - (EK_COMPLETE == type_ids_NewAliases.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_NewAliases.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_int8_ = TypeObjectUtils::build_common_struct_member(member_id_int8_, member_flags_int8_, type_ids_NewAliases.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_NewAliases.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_NewAliases.type_identifier2()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_NewAliases.type_identifier2()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_NewAliases.type_identifier2()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_NewAliases.type_identifier2()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_NewAliases.type_identifier2()._d() && - (EK_COMPLETE == type_ids_NewAliases.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_NewAliases.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_NewAliases.type_identifier2()._d() && - (EK_COMPLETE == type_ids_NewAliases.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_NewAliases.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_int8_ = TypeObjectUtils::build_common_struct_member(member_id_int8_, member_flags_int8_, type_ids_NewAliases.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure int8_ member TypeIdentifier inconsistent."); - return; - } - MemberName name_int8_ = "int8_"; - eprosima::fastcdr::optional member_ann_builtin_int8_; - ann_custom_NewAliases.reset(); - CompleteMemberDetail detail_int8_ = TypeObjectUtils::build_complete_member_detail(name_int8_, member_ann_builtin_int8_, ann_custom_NewAliases); - CompleteStructMember member_int8_ = TypeObjectUtils::build_complete_struct_member(common_int8_, detail_int8_); - TypeObjectUtils::add_complete_struct_member(member_seq_NewAliases, member_int8_); - } - { - return_code_NewAliases = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_uint8_t", type_ids_NewAliases); - - if (return_code_NewAliases != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "uint8_ Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_uint8_ = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_uint8_; - MemberId member_id_uint8_ = 0x00000001; - if (EK_COMPLETE == type_ids_NewAliases.type_identifier1()._d() || TK_NONE == type_ids_NewAliases.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_NewAliases.type_identifier1()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_NewAliases.type_identifier1()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_NewAliases.type_identifier1()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_NewAliases.type_identifier1()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_NewAliases.type_identifier1()._d() && - (EK_COMPLETE == type_ids_NewAliases.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_NewAliases.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_NewAliases.type_identifier1()._d() && - (EK_COMPLETE == type_ids_NewAliases.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_NewAliases.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_uint8_ = TypeObjectUtils::build_common_struct_member(member_id_uint8_, member_flags_uint8_, type_ids_NewAliases.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_NewAliases.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_NewAliases.type_identifier2()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_NewAliases.type_identifier2()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_NewAliases.type_identifier2()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_NewAliases.type_identifier2()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_NewAliases.type_identifier2()._d() && - (EK_COMPLETE == type_ids_NewAliases.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_NewAliases.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_NewAliases.type_identifier2()._d() && - (EK_COMPLETE == type_ids_NewAliases.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_NewAliases.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_uint8_ = TypeObjectUtils::build_common_struct_member(member_id_uint8_, member_flags_uint8_, type_ids_NewAliases.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure uint8_ member TypeIdentifier inconsistent."); - return; - } - MemberName name_uint8_ = "uint8_"; - eprosima::fastcdr::optional member_ann_builtin_uint8_; - ann_custom_NewAliases.reset(); - CompleteMemberDetail detail_uint8_ = TypeObjectUtils::build_complete_member_detail(name_uint8_, member_ann_builtin_uint8_, ann_custom_NewAliases); - CompleteStructMember member_uint8_ = TypeObjectUtils::build_complete_struct_member(common_uint8_, detail_uint8_); - TypeObjectUtils::add_complete_struct_member(member_seq_NewAliases, member_uint8_); - } - { - return_code_NewAliases = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int16_t", type_ids_NewAliases); - - if (return_code_NewAliases != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "int16_ Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_int16_ = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_int16_; - MemberId member_id_int16_ = 0x00000002; - if (EK_COMPLETE == type_ids_NewAliases.type_identifier1()._d() || TK_NONE == type_ids_NewAliases.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_NewAliases.type_identifier1()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_NewAliases.type_identifier1()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_NewAliases.type_identifier1()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_NewAliases.type_identifier1()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_NewAliases.type_identifier1()._d() && - (EK_COMPLETE == type_ids_NewAliases.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_NewAliases.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_NewAliases.type_identifier1()._d() && - (EK_COMPLETE == type_ids_NewAliases.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_NewAliases.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_int16_ = TypeObjectUtils::build_common_struct_member(member_id_int16_, member_flags_int16_, type_ids_NewAliases.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_NewAliases.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_NewAliases.type_identifier2()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_NewAliases.type_identifier2()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_NewAliases.type_identifier2()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_NewAliases.type_identifier2()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_NewAliases.type_identifier2()._d() && - (EK_COMPLETE == type_ids_NewAliases.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_NewAliases.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_NewAliases.type_identifier2()._d() && - (EK_COMPLETE == type_ids_NewAliases.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_NewAliases.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_int16_ = TypeObjectUtils::build_common_struct_member(member_id_int16_, member_flags_int16_, type_ids_NewAliases.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure int16_ member TypeIdentifier inconsistent."); - return; - } - MemberName name_int16_ = "int16_"; - eprosima::fastcdr::optional member_ann_builtin_int16_; - ann_custom_NewAliases.reset(); - CompleteMemberDetail detail_int16_ = TypeObjectUtils::build_complete_member_detail(name_int16_, member_ann_builtin_int16_, ann_custom_NewAliases); - CompleteStructMember member_int16_ = TypeObjectUtils::build_complete_struct_member(common_int16_, detail_int16_); - TypeObjectUtils::add_complete_struct_member(member_seq_NewAliases, member_int16_); - } - { - return_code_NewAliases = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_uint16_t", type_ids_NewAliases); - - if (return_code_NewAliases != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "uint16_ Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_uint16_ = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_uint16_; - MemberId member_id_uint16_ = 0x00000003; - if (EK_COMPLETE == type_ids_NewAliases.type_identifier1()._d() || TK_NONE == type_ids_NewAliases.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_NewAliases.type_identifier1()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_NewAliases.type_identifier1()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_NewAliases.type_identifier1()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_NewAliases.type_identifier1()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_NewAliases.type_identifier1()._d() && - (EK_COMPLETE == type_ids_NewAliases.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_NewAliases.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_NewAliases.type_identifier1()._d() && - (EK_COMPLETE == type_ids_NewAliases.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_NewAliases.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_uint16_ = TypeObjectUtils::build_common_struct_member(member_id_uint16_, member_flags_uint16_, type_ids_NewAliases.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_NewAliases.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_NewAliases.type_identifier2()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_NewAliases.type_identifier2()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_NewAliases.type_identifier2()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_NewAliases.type_identifier2()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_NewAliases.type_identifier2()._d() && - (EK_COMPLETE == type_ids_NewAliases.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_NewAliases.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_NewAliases.type_identifier2()._d() && - (EK_COMPLETE == type_ids_NewAliases.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_NewAliases.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_uint16_ = TypeObjectUtils::build_common_struct_member(member_id_uint16_, member_flags_uint16_, type_ids_NewAliases.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure uint16_ member TypeIdentifier inconsistent."); - return; - } - MemberName name_uint16_ = "uint16_"; - eprosima::fastcdr::optional member_ann_builtin_uint16_; - ann_custom_NewAliases.reset(); - CompleteMemberDetail detail_uint16_ = TypeObjectUtils::build_complete_member_detail(name_uint16_, member_ann_builtin_uint16_, ann_custom_NewAliases); - CompleteStructMember member_uint16_ = TypeObjectUtils::build_complete_struct_member(common_uint16_, detail_uint16_); - TypeObjectUtils::add_complete_struct_member(member_seq_NewAliases, member_uint16_); - } - { - return_code_NewAliases = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_NewAliases); - - if (return_code_NewAliases != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "int32_ Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_int32_ = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_int32_; - MemberId member_id_int32_ = 0x00000004; - if (EK_COMPLETE == type_ids_NewAliases.type_identifier1()._d() || TK_NONE == type_ids_NewAliases.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_NewAliases.type_identifier1()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_NewAliases.type_identifier1()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_NewAliases.type_identifier1()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_NewAliases.type_identifier1()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_NewAliases.type_identifier1()._d() && - (EK_COMPLETE == type_ids_NewAliases.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_NewAliases.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_NewAliases.type_identifier1()._d() && - (EK_COMPLETE == type_ids_NewAliases.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_NewAliases.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_int32_ = TypeObjectUtils::build_common_struct_member(member_id_int32_, member_flags_int32_, type_ids_NewAliases.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_NewAliases.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_NewAliases.type_identifier2()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_NewAliases.type_identifier2()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_NewAliases.type_identifier2()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_NewAliases.type_identifier2()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_NewAliases.type_identifier2()._d() && - (EK_COMPLETE == type_ids_NewAliases.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_NewAliases.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_NewAliases.type_identifier2()._d() && - (EK_COMPLETE == type_ids_NewAliases.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_NewAliases.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_int32_ = TypeObjectUtils::build_common_struct_member(member_id_int32_, member_flags_int32_, type_ids_NewAliases.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure int32_ member TypeIdentifier inconsistent."); - return; - } - MemberName name_int32_ = "int32_"; - eprosima::fastcdr::optional member_ann_builtin_int32_; - ann_custom_NewAliases.reset(); - CompleteMemberDetail detail_int32_ = TypeObjectUtils::build_complete_member_detail(name_int32_, member_ann_builtin_int32_, ann_custom_NewAliases); - CompleteStructMember member_int32_ = TypeObjectUtils::build_complete_struct_member(common_int32_, detail_int32_); - TypeObjectUtils::add_complete_struct_member(member_seq_NewAliases, member_int32_); - } - { - return_code_NewAliases = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_uint32_t", type_ids_NewAliases); - - if (return_code_NewAliases != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "uint32_ Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_uint32_ = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_uint32_; - MemberId member_id_uint32_ = 0x00000005; - if (EK_COMPLETE == type_ids_NewAliases.type_identifier1()._d() || TK_NONE == type_ids_NewAliases.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_NewAliases.type_identifier1()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_NewAliases.type_identifier1()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_NewAliases.type_identifier1()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_NewAliases.type_identifier1()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_NewAliases.type_identifier1()._d() && - (EK_COMPLETE == type_ids_NewAliases.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_NewAliases.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_NewAliases.type_identifier1()._d() && - (EK_COMPLETE == type_ids_NewAliases.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_NewAliases.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_uint32_ = TypeObjectUtils::build_common_struct_member(member_id_uint32_, member_flags_uint32_, type_ids_NewAliases.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_NewAliases.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_NewAliases.type_identifier2()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_NewAliases.type_identifier2()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_NewAliases.type_identifier2()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_NewAliases.type_identifier2()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_NewAliases.type_identifier2()._d() && - (EK_COMPLETE == type_ids_NewAliases.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_NewAliases.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_NewAliases.type_identifier2()._d() && - (EK_COMPLETE == type_ids_NewAliases.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_NewAliases.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_uint32_ = TypeObjectUtils::build_common_struct_member(member_id_uint32_, member_flags_uint32_, type_ids_NewAliases.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure uint32_ member TypeIdentifier inconsistent."); - return; - } - MemberName name_uint32_ = "uint32_"; - eprosima::fastcdr::optional member_ann_builtin_uint32_; - ann_custom_NewAliases.reset(); - CompleteMemberDetail detail_uint32_ = TypeObjectUtils::build_complete_member_detail(name_uint32_, member_ann_builtin_uint32_, ann_custom_NewAliases); - CompleteStructMember member_uint32_ = TypeObjectUtils::build_complete_struct_member(common_uint32_, detail_uint32_); - TypeObjectUtils::add_complete_struct_member(member_seq_NewAliases, member_uint32_); - } - { - return_code_NewAliases = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int64_t", type_ids_NewAliases); - - if (return_code_NewAliases != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "int64_ Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_int64_ = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_int64_; - MemberId member_id_int64_ = 0x00000006; - if (EK_COMPLETE == type_ids_NewAliases.type_identifier1()._d() || TK_NONE == type_ids_NewAliases.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_NewAliases.type_identifier1()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_NewAliases.type_identifier1()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_NewAliases.type_identifier1()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_NewAliases.type_identifier1()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_NewAliases.type_identifier1()._d() && - (EK_COMPLETE == type_ids_NewAliases.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_NewAliases.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_NewAliases.type_identifier1()._d() && - (EK_COMPLETE == type_ids_NewAliases.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_NewAliases.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_int64_ = TypeObjectUtils::build_common_struct_member(member_id_int64_, member_flags_int64_, type_ids_NewAliases.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_NewAliases.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_NewAliases.type_identifier2()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_NewAliases.type_identifier2()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_NewAliases.type_identifier2()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_NewAliases.type_identifier2()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_NewAliases.type_identifier2()._d() && - (EK_COMPLETE == type_ids_NewAliases.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_NewAliases.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_NewAliases.type_identifier2()._d() && - (EK_COMPLETE == type_ids_NewAliases.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_NewAliases.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_int64_ = TypeObjectUtils::build_common_struct_member(member_id_int64_, member_flags_int64_, type_ids_NewAliases.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure int64_ member TypeIdentifier inconsistent."); - return; - } - MemberName name_int64_ = "int64_"; - eprosima::fastcdr::optional member_ann_builtin_int64_; - ann_custom_NewAliases.reset(); - CompleteMemberDetail detail_int64_ = TypeObjectUtils::build_complete_member_detail(name_int64_, member_ann_builtin_int64_, ann_custom_NewAliases); - CompleteStructMember member_int64_ = TypeObjectUtils::build_complete_struct_member(common_int64_, detail_int64_); - TypeObjectUtils::add_complete_struct_member(member_seq_NewAliases, member_int64_); - } - { - return_code_NewAliases = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_uint64_t", type_ids_NewAliases); - - if (return_code_NewAliases != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "uint64_ Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_uint64_ = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_uint64_; - MemberId member_id_uint64_ = 0x00000007; - if (EK_COMPLETE == type_ids_NewAliases.type_identifier1()._d() || TK_NONE == type_ids_NewAliases.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_NewAliases.type_identifier1()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_NewAliases.type_identifier1()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_NewAliases.type_identifier1()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_NewAliases.type_identifier1()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_NewAliases.type_identifier1()._d() && - (EK_COMPLETE == type_ids_NewAliases.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_NewAliases.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_NewAliases.type_identifier1()._d() && - (EK_COMPLETE == type_ids_NewAliases.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_NewAliases.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_uint64_ = TypeObjectUtils::build_common_struct_member(member_id_uint64_, member_flags_uint64_, type_ids_NewAliases.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_NewAliases.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_NewAliases.type_identifier2()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_NewAliases.type_identifier2()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_NewAliases.type_identifier2()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_NewAliases.type_identifier2()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_NewAliases.type_identifier2()._d() && - (EK_COMPLETE == type_ids_NewAliases.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_NewAliases.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_NewAliases.type_identifier2()._d() && - (EK_COMPLETE == type_ids_NewAliases.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_NewAliases.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_uint64_ = TypeObjectUtils::build_common_struct_member(member_id_uint64_, member_flags_uint64_, type_ids_NewAliases.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure uint64_ member TypeIdentifier inconsistent."); - return; - } - MemberName name_uint64_ = "uint64_"; - eprosima::fastcdr::optional member_ann_builtin_uint64_; - ann_custom_NewAliases.reset(); - AppliedAnnotationSeq tmp_ann_custom_uint64_; - eprosima::fastcdr::optional unit_uint64_; - eprosima::fastcdr::optional min_uint64_; - eprosima::fastcdr::optional max_uint64_; - eprosima::fastcdr::optional hash_id_uint64_; - if (unit_uint64_.has_value() || min_uint64_.has_value() || max_uint64_.has_value() || hash_id_uint64_.has_value()) - { - member_ann_builtin_uint64_ = TypeObjectUtils::build_applied_builtin_member_annotations(unit_uint64_, min_uint64_, max_uint64_, hash_id_uint64_); - } - if (!tmp_ann_custom_uint64_.empty()) - { - ann_custom_NewAliases = tmp_ann_custom_uint64_; - } - CompleteMemberDetail detail_uint64_ = TypeObjectUtils::build_complete_member_detail(name_uint64_, member_ann_builtin_uint64_, ann_custom_NewAliases); - CompleteStructMember member_uint64_ = TypeObjectUtils::build_complete_struct_member(common_uint64_, detail_uint64_); - TypeObjectUtils::add_complete_struct_member(member_seq_NewAliases, member_uint64_); - } - { - return_code_NewAliases = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_string_unbounded", type_ids_NewAliases); - - if (return_code_NewAliases != 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_NewAliases = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_string_unbounded", type_ids_NewAliases); - if (return_code_NewAliases != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_string_unbounded: Given String TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_local_string = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_local_string; - MemberId member_id_local_string = 0x00000008; - if (EK_COMPLETE == type_ids_NewAliases.type_identifier1()._d() || TK_NONE == type_ids_NewAliases.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_NewAliases.type_identifier1()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_NewAliases.type_identifier1()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_NewAliases.type_identifier1()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_NewAliases.type_identifier1()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_NewAliases.type_identifier1()._d() && - (EK_COMPLETE == type_ids_NewAliases.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_NewAliases.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_NewAliases.type_identifier1()._d() && - (EK_COMPLETE == type_ids_NewAliases.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_NewAliases.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_local_string = TypeObjectUtils::build_common_struct_member(member_id_local_string, member_flags_local_string, type_ids_NewAliases.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_NewAliases.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_NewAliases.type_identifier2()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_NewAliases.type_identifier2()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_NewAliases.type_identifier2()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_NewAliases.type_identifier2()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_NewAliases.type_identifier2()._d() && - (EK_COMPLETE == type_ids_NewAliases.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_NewAliases.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_NewAliases.type_identifier2()._d() && - (EK_COMPLETE == type_ids_NewAliases.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_NewAliases.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_local_string = TypeObjectUtils::build_common_struct_member(member_id_local_string, member_flags_local_string, type_ids_NewAliases.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure local_string member TypeIdentifier inconsistent."); - return; - } - MemberName name_local_string = "local_string"; - eprosima::fastcdr::optional member_ann_builtin_local_string; - ann_custom_NewAliases.reset(); - AppliedAnnotationSeq tmp_ann_custom_local_string; - eprosima::fastcdr::optional unit_local_string; - eprosima::fastcdr::optional min_local_string; - eprosima::fastcdr::optional max_local_string; - eprosima::fastcdr::optional hash_id_local_string; - if (unit_local_string.has_value() || min_local_string.has_value() || max_local_string.has_value() || hash_id_local_string.has_value()) - { - member_ann_builtin_local_string = TypeObjectUtils::build_applied_builtin_member_annotations(unit_local_string, min_local_string, max_local_string, hash_id_local_string); - } - if (!tmp_ann_custom_local_string.empty()) - { - ann_custom_NewAliases = tmp_ann_custom_local_string; - } - CompleteMemberDetail detail_local_string = TypeObjectUtils::build_complete_member_detail(name_local_string, member_ann_builtin_local_string, ann_custom_NewAliases); - CompleteStructMember member_local_string = TypeObjectUtils::build_complete_struct_member(common_local_string, detail_local_string); - TypeObjectUtils::add_complete_struct_member(member_seq_NewAliases, member_local_string); - } - CompleteStructType struct_type_NewAliases = TypeObjectUtils::build_complete_struct_type(struct_flags_NewAliases, header_NewAliases, member_seq_NewAliases); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_NewAliases, type_name_NewAliases.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "NewAliases already registered in TypeObjectRegistry for a different type."); - } - return_code_NewAliases = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "NewAliases", type_ids_NewAliases); - if (return_code_NewAliases != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "NewAliases: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } -} -void register_WCharUnion_type_identifier() -{ - { - ReturnCode_t return_code_WCharUnion; - TypeIdentifierPair type_ids_WCharUnion; - UnionTypeFlag union_flags_WCharUnion = TypeObjectUtils::build_union_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - QualifiedTypeName type_name_WCharUnion = "WCharUnion"; - eprosima::fastcdr::optional type_ann_builtin_WCharUnion; - eprosima::fastcdr::optional ann_custom_WCharUnion; - CompleteTypeDetail detail_WCharUnion = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_WCharUnion, ann_custom_WCharUnion, type_name_WCharUnion.to_string()); - CompleteUnionHeader header_WCharUnion = TypeObjectUtils::build_complete_union_header(detail_WCharUnion); - UnionDiscriminatorFlag member_flags_WCharUnion = TypeObjectUtils::build_union_discriminator_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false); - return_code_WCharUnion = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_wchar_t", type_ids_WCharUnion); - - if (return_code_WCharUnion != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Union discriminator TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - CommonDiscriminatorMember common_WCharUnion; - if (EK_COMPLETE == type_ids_WCharUnion.type_identifier1()._d() || TK_NONE == type_ids_WCharUnion.type_identifier2()._d()) - { - common_WCharUnion = TypeObjectUtils::build_common_discriminator_member(member_flags_WCharUnion, type_ids_WCharUnion.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_WCharUnion.type_identifier2()._d()) - { - common_WCharUnion = TypeObjectUtils::build_common_discriminator_member(member_flags_WCharUnion, type_ids_WCharUnion.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "WCharUnion discriminator TypeIdentifier inconsistent."); - return; - } - type_ann_builtin_WCharUnion.reset(); - ann_custom_WCharUnion.reset(); - CompleteDiscriminatorMember discriminator_WCharUnion = TypeObjectUtils::build_complete_discriminator_member(common_WCharUnion, - type_ann_builtin_WCharUnion, ann_custom_WCharUnion); - CompleteUnionMemberSeq member_seq_WCharUnion; - { - return_code_WCharUnion = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_WCharUnion); - - if (return_code_WCharUnion != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "case_zero Union member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - UnionMemberFlag member_flags_case_zero = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false); - UnionCaseLabelSeq label_seq_case_zero; - TypeObjectUtils::add_union_case_label(label_seq_case_zero, static_cast('a')); - CommonUnionMember common_case_zero; - MemberId member_id_case_zero = 0x00000001; - if (EK_COMPLETE == type_ids_WCharUnion.type_identifier1()._d() || TK_NONE == type_ids_WCharUnion.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_WCharUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_WCharUnion.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_WCharUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_WCharUnion.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_WCharUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_WCharUnion.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_WCharUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_WCharUnion.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_WCharUnion.type_identifier1()._d() && - (EK_COMPLETE == type_ids_WCharUnion.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_WCharUnion.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_WCharUnion.type_identifier1()._d() && - (EK_COMPLETE == type_ids_WCharUnion.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_WCharUnion.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_case_zero = TypeObjectUtils::build_common_union_member(member_id_case_zero, member_flags_case_zero, type_ids_WCharUnion.type_identifier1(), - label_seq_case_zero); - } - else if (EK_COMPLETE == type_ids_WCharUnion.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_WCharUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_WCharUnion.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_WCharUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_WCharUnion.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_WCharUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_WCharUnion.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_WCharUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_WCharUnion.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_WCharUnion.type_identifier2()._d() && - (EK_COMPLETE == type_ids_WCharUnion.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_WCharUnion.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_WCharUnion.type_identifier2()._d() && - (EK_COMPLETE == type_ids_WCharUnion.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_WCharUnion.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_case_zero = TypeObjectUtils::build_common_union_member(member_id_case_zero, member_flags_case_zero, type_ids_WCharUnion.type_identifier2(), - label_seq_case_zero); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Union case_zero member TypeIdentifier inconsistent."); - return; - } - MemberName name_case_zero = "case_zero"; - eprosima::fastcdr::optional member_ann_builtin_case_zero; - ann_custom_WCharUnion.reset(); - CompleteMemberDetail detail_case_zero = TypeObjectUtils::build_complete_member_detail(name_case_zero, member_ann_builtin_case_zero, ann_custom_WCharUnion); - CompleteUnionMember member_case_zero = TypeObjectUtils::build_complete_union_member(common_case_zero, detail_case_zero); - TypeObjectUtils::add_complete_union_member(member_seq_WCharUnion, member_case_zero); - } - { - return_code_WCharUnion = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_WCharUnion); - - if (return_code_WCharUnion != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "case_one Union member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - UnionMemberFlag member_flags_case_one = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false); - UnionCaseLabelSeq label_seq_case_one; - TypeObjectUtils::add_union_case_label(label_seq_case_one, static_cast('b')); - CommonUnionMember common_case_one; - MemberId member_id_case_one = 0x00000002; - if (EK_COMPLETE == type_ids_WCharUnion.type_identifier1()._d() || TK_NONE == type_ids_WCharUnion.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_WCharUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_WCharUnion.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_WCharUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_WCharUnion.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_WCharUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_WCharUnion.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_WCharUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_WCharUnion.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_WCharUnion.type_identifier1()._d() && - (EK_COMPLETE == type_ids_WCharUnion.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_WCharUnion.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_WCharUnion.type_identifier1()._d() && - (EK_COMPLETE == type_ids_WCharUnion.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_WCharUnion.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_case_one = TypeObjectUtils::build_common_union_member(member_id_case_one, member_flags_case_one, type_ids_WCharUnion.type_identifier1(), - label_seq_case_one); - } - else if (EK_COMPLETE == type_ids_WCharUnion.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_WCharUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_WCharUnion.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_WCharUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_WCharUnion.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_WCharUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_WCharUnion.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_WCharUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_WCharUnion.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_WCharUnion.type_identifier2()._d() && - (EK_COMPLETE == type_ids_WCharUnion.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_WCharUnion.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_WCharUnion.type_identifier2()._d() && - (EK_COMPLETE == type_ids_WCharUnion.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_WCharUnion.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_case_one = TypeObjectUtils::build_common_union_member(member_id_case_one, member_flags_case_one, type_ids_WCharUnion.type_identifier2(), - label_seq_case_one); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Union case_one member TypeIdentifier inconsistent."); - return; - } - MemberName name_case_one = "case_one"; - eprosima::fastcdr::optional member_ann_builtin_case_one; - ann_custom_WCharUnion.reset(); - CompleteMemberDetail detail_case_one = TypeObjectUtils::build_complete_member_detail(name_case_one, member_ann_builtin_case_one, ann_custom_WCharUnion); - CompleteUnionMember member_case_one = TypeObjectUtils::build_complete_union_member(common_case_one, detail_case_one); - TypeObjectUtils::add_complete_union_member(member_seq_WCharUnion, member_case_one); - } - CompleteUnionType union_type_WCharUnion = TypeObjectUtils::build_complete_union_type(union_flags_WCharUnion, header_WCharUnion, discriminator_WCharUnion, - member_seq_WCharUnion); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_union_type_object(union_type_WCharUnion, type_name_WCharUnion.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "WCharUnion already registered in TypeObjectRegistry for a different type."); - } - return_code_WCharUnion = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "WCharUnion", type_ids_WCharUnion); - if (return_code_WCharUnion != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "WCharUnion: Given Union TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } -} -void register_OctetUnion_type_identifier() -{ - { - ReturnCode_t return_code_OctetUnion; - TypeIdentifierPair type_ids_OctetUnion; - UnionTypeFlag union_flags_OctetUnion = TypeObjectUtils::build_union_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - QualifiedTypeName type_name_OctetUnion = "OctetUnion"; - eprosima::fastcdr::optional type_ann_builtin_OctetUnion; - eprosima::fastcdr::optional ann_custom_OctetUnion; - CompleteTypeDetail detail_OctetUnion = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_OctetUnion, ann_custom_OctetUnion, type_name_OctetUnion.to_string()); - CompleteUnionHeader header_OctetUnion = TypeObjectUtils::build_complete_union_header(detail_OctetUnion); - UnionDiscriminatorFlag member_flags_OctetUnion = TypeObjectUtils::build_union_discriminator_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false); - return_code_OctetUnion = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_byte", type_ids_OctetUnion); - - if (return_code_OctetUnion != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Union discriminator TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - CommonDiscriminatorMember common_OctetUnion; - if (EK_COMPLETE == type_ids_OctetUnion.type_identifier1()._d() || TK_NONE == type_ids_OctetUnion.type_identifier2()._d()) - { - common_OctetUnion = TypeObjectUtils::build_common_discriminator_member(member_flags_OctetUnion, type_ids_OctetUnion.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_OctetUnion.type_identifier2()._d()) - { - common_OctetUnion = TypeObjectUtils::build_common_discriminator_member(member_flags_OctetUnion, type_ids_OctetUnion.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "OctetUnion discriminator TypeIdentifier inconsistent."); - return; - } - type_ann_builtin_OctetUnion.reset(); - ann_custom_OctetUnion.reset(); - CompleteDiscriminatorMember discriminator_OctetUnion = TypeObjectUtils::build_complete_discriminator_member(common_OctetUnion, - type_ann_builtin_OctetUnion, ann_custom_OctetUnion); - CompleteUnionMemberSeq member_seq_OctetUnion; - { - return_code_OctetUnion = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_OctetUnion); - - if (return_code_OctetUnion != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "case_five Union member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - UnionMemberFlag member_flags_case_five = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false); - UnionCaseLabelSeq label_seq_case_five; - TypeObjectUtils::add_union_case_label(label_seq_case_five, static_cast(5)); - CommonUnionMember common_case_five; - MemberId member_id_case_five = 0x00000001; - if (EK_COMPLETE == type_ids_OctetUnion.type_identifier1()._d() || TK_NONE == type_ids_OctetUnion.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_OctetUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_OctetUnion.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_OctetUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_OctetUnion.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_OctetUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_OctetUnion.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_OctetUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_OctetUnion.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_OctetUnion.type_identifier1()._d() && - (EK_COMPLETE == type_ids_OctetUnion.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_OctetUnion.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_OctetUnion.type_identifier1()._d() && - (EK_COMPLETE == type_ids_OctetUnion.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_OctetUnion.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_case_five = TypeObjectUtils::build_common_union_member(member_id_case_five, member_flags_case_five, type_ids_OctetUnion.type_identifier1(), - label_seq_case_five); - } - else if (EK_COMPLETE == type_ids_OctetUnion.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_OctetUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_OctetUnion.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_OctetUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_OctetUnion.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_OctetUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_OctetUnion.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_OctetUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_OctetUnion.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_OctetUnion.type_identifier2()._d() && - (EK_COMPLETE == type_ids_OctetUnion.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_OctetUnion.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_OctetUnion.type_identifier2()._d() && - (EK_COMPLETE == type_ids_OctetUnion.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_OctetUnion.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_case_five = TypeObjectUtils::build_common_union_member(member_id_case_five, member_flags_case_five, type_ids_OctetUnion.type_identifier2(), - label_seq_case_five); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Union case_five member TypeIdentifier inconsistent."); - return; - } - MemberName name_case_five = "case_five"; - eprosima::fastcdr::optional member_ann_builtin_case_five; - ann_custom_OctetUnion.reset(); - CompleteMemberDetail detail_case_five = TypeObjectUtils::build_complete_member_detail(name_case_five, member_ann_builtin_case_five, ann_custom_OctetUnion); - CompleteUnionMember member_case_five = TypeObjectUtils::build_complete_union_member(common_case_five, detail_case_five); - TypeObjectUtils::add_complete_union_member(member_seq_OctetUnion, member_case_five); - } - { - return_code_OctetUnion = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_OctetUnion); - - if (return_code_OctetUnion != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "case_seven Union member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - UnionMemberFlag member_flags_case_seven = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false); - UnionCaseLabelSeq label_seq_case_seven; - TypeObjectUtils::add_union_case_label(label_seq_case_seven, static_cast(7)); - CommonUnionMember common_case_seven; - MemberId member_id_case_seven = 0x00000002; - if (EK_COMPLETE == type_ids_OctetUnion.type_identifier1()._d() || TK_NONE == type_ids_OctetUnion.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_OctetUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_OctetUnion.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_OctetUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_OctetUnion.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_OctetUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_OctetUnion.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_OctetUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_OctetUnion.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_OctetUnion.type_identifier1()._d() && - (EK_COMPLETE == type_ids_OctetUnion.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_OctetUnion.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_OctetUnion.type_identifier1()._d() && - (EK_COMPLETE == type_ids_OctetUnion.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_OctetUnion.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_case_seven = TypeObjectUtils::build_common_union_member(member_id_case_seven, member_flags_case_seven, type_ids_OctetUnion.type_identifier1(), - label_seq_case_seven); - } - else if (EK_COMPLETE == type_ids_OctetUnion.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_OctetUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_OctetUnion.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_OctetUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_OctetUnion.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_OctetUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_OctetUnion.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_OctetUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_OctetUnion.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_OctetUnion.type_identifier2()._d() && - (EK_COMPLETE == type_ids_OctetUnion.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_OctetUnion.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_OctetUnion.type_identifier2()._d() && - (EK_COMPLETE == type_ids_OctetUnion.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_OctetUnion.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_case_seven = TypeObjectUtils::build_common_union_member(member_id_case_seven, member_flags_case_seven, type_ids_OctetUnion.type_identifier2(), - label_seq_case_seven); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Union case_seven member TypeIdentifier inconsistent."); - return; - } - MemberName name_case_seven = "case_seven"; - eprosima::fastcdr::optional member_ann_builtin_case_seven; - ann_custom_OctetUnion.reset(); - CompleteMemberDetail detail_case_seven = TypeObjectUtils::build_complete_member_detail(name_case_seven, member_ann_builtin_case_seven, ann_custom_OctetUnion); - CompleteUnionMember member_case_seven = TypeObjectUtils::build_complete_union_member(common_case_seven, detail_case_seven); - TypeObjectUtils::add_complete_union_member(member_seq_OctetUnion, member_case_seven); - } - CompleteUnionType union_type_OctetUnion = TypeObjectUtils::build_complete_union_type(union_flags_OctetUnion, header_OctetUnion, discriminator_OctetUnion, - member_seq_OctetUnion); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_union_type_object(union_type_OctetUnion, type_name_OctetUnion.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "OctetUnion already registered in TypeObjectRegistry for a different type."); - } - return_code_OctetUnion = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "OctetUnion", type_ids_OctetUnion); - if (return_code_OctetUnion != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "OctetUnion: Given Union TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } -} -void register_Int8Union_type_identifier() -{ - { - ReturnCode_t return_code_Int8Union; - TypeIdentifierPair type_ids_Int8Union; - UnionTypeFlag union_flags_Int8Union = TypeObjectUtils::build_union_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - QualifiedTypeName type_name_Int8Union = "Int8Union"; - eprosima::fastcdr::optional type_ann_builtin_Int8Union; - eprosima::fastcdr::optional ann_custom_Int8Union; - CompleteTypeDetail detail_Int8Union = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_Int8Union, ann_custom_Int8Union, type_name_Int8Union.to_string()); - CompleteUnionHeader header_Int8Union = TypeObjectUtils::build_complete_union_header(detail_Int8Union); - UnionDiscriminatorFlag member_flags_Int8Union = TypeObjectUtils::build_union_discriminator_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false); - return_code_Int8Union = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int8_t", type_ids_Int8Union); - - if (return_code_Int8Union != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Union discriminator TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - CommonDiscriminatorMember common_Int8Union; - if (EK_COMPLETE == type_ids_Int8Union.type_identifier1()._d() || TK_NONE == type_ids_Int8Union.type_identifier2()._d()) - { - common_Int8Union = TypeObjectUtils::build_common_discriminator_member(member_flags_Int8Union, type_ids_Int8Union.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_Int8Union.type_identifier2()._d()) - { - common_Int8Union = TypeObjectUtils::build_common_discriminator_member(member_flags_Int8Union, type_ids_Int8Union.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Int8Union discriminator TypeIdentifier inconsistent."); - return; - } - type_ann_builtin_Int8Union.reset(); - ann_custom_Int8Union.reset(); - CompleteDiscriminatorMember discriminator_Int8Union = TypeObjectUtils::build_complete_discriminator_member(common_Int8Union, - type_ann_builtin_Int8Union, ann_custom_Int8Union); - CompleteUnionMemberSeq member_seq_Int8Union; - { - return_code_Int8Union = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_Int8Union); - - if (return_code_Int8Union != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "case_three Union member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - UnionMemberFlag member_flags_case_three = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false); - UnionCaseLabelSeq label_seq_case_three; - TypeObjectUtils::add_union_case_label(label_seq_case_three, static_cast(3)); - CommonUnionMember common_case_three; - MemberId member_id_case_three = 0x00000001; - if (EK_COMPLETE == type_ids_Int8Union.type_identifier1()._d() || TK_NONE == type_ids_Int8Union.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_Int8Union.type_identifier1()._d() && - EK_COMPLETE == type_ids_Int8Union.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_Int8Union.type_identifier1()._d() && - EK_COMPLETE == type_ids_Int8Union.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_Int8Union.type_identifier1()._d() && - EK_COMPLETE == type_ids_Int8Union.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_Int8Union.type_identifier1()._d() && - EK_COMPLETE == type_ids_Int8Union.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_Int8Union.type_identifier1()._d() && - (EK_COMPLETE == type_ids_Int8Union.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_Int8Union.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_Int8Union.type_identifier1()._d() && - (EK_COMPLETE == type_ids_Int8Union.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_Int8Union.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_case_three = TypeObjectUtils::build_common_union_member(member_id_case_three, member_flags_case_three, type_ids_Int8Union.type_identifier1(), - label_seq_case_three); - } - else if (EK_COMPLETE == type_ids_Int8Union.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_Int8Union.type_identifier2()._d() && - EK_COMPLETE == type_ids_Int8Union.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_Int8Union.type_identifier2()._d() && - EK_COMPLETE == type_ids_Int8Union.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_Int8Union.type_identifier2()._d() && - EK_COMPLETE == type_ids_Int8Union.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_Int8Union.type_identifier2()._d() && - EK_COMPLETE == type_ids_Int8Union.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_Int8Union.type_identifier2()._d() && - (EK_COMPLETE == type_ids_Int8Union.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_Int8Union.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_Int8Union.type_identifier2()._d() && - (EK_COMPLETE == type_ids_Int8Union.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_Int8Union.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_case_three = TypeObjectUtils::build_common_union_member(member_id_case_three, member_flags_case_three, type_ids_Int8Union.type_identifier2(), - label_seq_case_three); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Union case_three member TypeIdentifier inconsistent."); - return; - } - MemberName name_case_three = "case_three"; - eprosima::fastcdr::optional member_ann_builtin_case_three; - ann_custom_Int8Union.reset(); - CompleteMemberDetail detail_case_three = TypeObjectUtils::build_complete_member_detail(name_case_three, member_ann_builtin_case_three, ann_custom_Int8Union); - CompleteUnionMember member_case_three = TypeObjectUtils::build_complete_union_member(common_case_three, detail_case_three); - TypeObjectUtils::add_complete_union_member(member_seq_Int8Union, member_case_three); - } - { - return_code_Int8Union = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_Int8Union); - - if (return_code_Int8Union != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "case_six Union member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - UnionMemberFlag member_flags_case_six = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false); - UnionCaseLabelSeq label_seq_case_six; - TypeObjectUtils::add_union_case_label(label_seq_case_six, static_cast(6)); - CommonUnionMember common_case_six; - MemberId member_id_case_six = 0x00000002; - if (EK_COMPLETE == type_ids_Int8Union.type_identifier1()._d() || TK_NONE == type_ids_Int8Union.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_Int8Union.type_identifier1()._d() && - EK_COMPLETE == type_ids_Int8Union.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_Int8Union.type_identifier1()._d() && - EK_COMPLETE == type_ids_Int8Union.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_Int8Union.type_identifier1()._d() && - EK_COMPLETE == type_ids_Int8Union.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_Int8Union.type_identifier1()._d() && - EK_COMPLETE == type_ids_Int8Union.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_Int8Union.type_identifier1()._d() && - (EK_COMPLETE == type_ids_Int8Union.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_Int8Union.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_Int8Union.type_identifier1()._d() && - (EK_COMPLETE == type_ids_Int8Union.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_Int8Union.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_case_six = TypeObjectUtils::build_common_union_member(member_id_case_six, member_flags_case_six, type_ids_Int8Union.type_identifier1(), - label_seq_case_six); - } - else if (EK_COMPLETE == type_ids_Int8Union.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_Int8Union.type_identifier2()._d() && - EK_COMPLETE == type_ids_Int8Union.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_Int8Union.type_identifier2()._d() && - EK_COMPLETE == type_ids_Int8Union.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_Int8Union.type_identifier2()._d() && - EK_COMPLETE == type_ids_Int8Union.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_Int8Union.type_identifier2()._d() && - EK_COMPLETE == type_ids_Int8Union.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_Int8Union.type_identifier2()._d() && - (EK_COMPLETE == type_ids_Int8Union.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_Int8Union.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_Int8Union.type_identifier2()._d() && - (EK_COMPLETE == type_ids_Int8Union.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_Int8Union.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_case_six = TypeObjectUtils::build_common_union_member(member_id_case_six, member_flags_case_six, type_ids_Int8Union.type_identifier2(), - label_seq_case_six); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Union case_six member TypeIdentifier inconsistent."); - return; - } - MemberName name_case_six = "case_six"; - eprosima::fastcdr::optional member_ann_builtin_case_six; - ann_custom_Int8Union.reset(); - CompleteMemberDetail detail_case_six = TypeObjectUtils::build_complete_member_detail(name_case_six, member_ann_builtin_case_six, ann_custom_Int8Union); - CompleteUnionMember member_case_six = TypeObjectUtils::build_complete_union_member(common_case_six, detail_case_six); - TypeObjectUtils::add_complete_union_member(member_seq_Int8Union, member_case_six); - } - CompleteUnionType union_type_Int8Union = TypeObjectUtils::build_complete_union_type(union_flags_Int8Union, header_Int8Union, discriminator_Int8Union, - member_seq_Int8Union); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_union_type_object(union_type_Int8Union, type_name_Int8Union.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Int8Union already registered in TypeObjectRegistry for a different type."); - } - return_code_Int8Union = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "Int8Union", type_ids_Int8Union); - if (return_code_Int8Union != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Int8Union: Given Union TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } -} -namespace bitmodule { -void register_bitmodule_BitsetBitmask_type_identifier() -{ - { - StructTypeFlag struct_flags_BitsetBitmask = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_BitsetBitmask; - TypeIdentifierPair type_ids_BitsetBitmask; - QualifiedTypeName type_name_BitsetBitmask = "bitmodule::BitsetBitmask"; - eprosima::fastcdr::optional type_ann_builtin_BitsetBitmask; - eprosima::fastcdr::optional ann_custom_BitsetBitmask; - CompleteTypeDetail detail_BitsetBitmask = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_BitsetBitmask, ann_custom_BitsetBitmask, type_name_BitsetBitmask.to_string()); - CompleteStructHeader header_BitsetBitmask; - header_BitsetBitmask = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_BitsetBitmask); - CompleteStructMemberSeq member_seq_BitsetBitmask; - { - return_code_BitsetBitmask = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "bitmodule::MyBitset", type_ids_BitsetBitmask); - - if (return_code_BitsetBitmask != eprosima::fastdds::dds::RETCODE_OK) - { - BitsetTypeFlag bitset_flags_MyBitset = 0; - QualifiedTypeName type_name_MyBitset = "bitmodule::MyBitset"; - eprosima::fastcdr::optional type_ann_builtin_MyBitset; - eprosima::fastcdr::optional ann_custom_MyBitset; - CompleteTypeDetail detail_MyBitset = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_MyBitset, ann_custom_MyBitset, type_name_MyBitset.to_string()); - CompleteBitsetHeader header_MyBitset = TypeObjectUtils::build_complete_bitset_header(detail_MyBitset); - CompleteBitfieldSeq field_seq_MyBitset; - { - uint16_t position_a = 0; - BitsetMemberFlag flags_a = 0; - uint8_t bitcount_a = 3; - TypeKind holder_type_a = TK_BYTE; - CommonBitfield common_a = TypeObjectUtils::build_common_bitfield(position_a, flags_a, bitcount_a, holder_type_a); - eprosima::fastcdr::optional member_ann_builtin_a; - ann_custom_MyBitset.reset(); - MemberName name_a = "a"; - CompleteMemberDetail detail_a = TypeObjectUtils::build_complete_member_detail(name_a, member_ann_builtin_a, ann_custom_MyBitset); - CompleteBitfield bitfield_a = TypeObjectUtils::build_complete_bitfield(common_a, detail_a); - TypeObjectUtils::add_complete_bitfield(field_seq_MyBitset, bitfield_a); - } - { - uint16_t position_b = 3; - BitsetMemberFlag flags_b = 0; - uint8_t bitcount_b = 1; - TypeKind holder_type_b = TK_BOOLEAN; - CommonBitfield common_b = TypeObjectUtils::build_common_bitfield(position_b, flags_b, bitcount_b, holder_type_b); - eprosima::fastcdr::optional member_ann_builtin_b; - ann_custom_MyBitset.reset(); - MemberName name_b = "b"; - CompleteMemberDetail detail_b = TypeObjectUtils::build_complete_member_detail(name_b, member_ann_builtin_b, ann_custom_MyBitset); - CompleteBitfield bitfield_b = TypeObjectUtils::build_complete_bitfield(common_b, detail_b); - TypeObjectUtils::add_complete_bitfield(field_seq_MyBitset, bitfield_b); - } - { - uint16_t position_c = 8; - BitsetMemberFlag flags_c = 0; - uint8_t bitcount_c = 10; - TypeKind holder_type_c = TK_UINT16; - CommonBitfield common_c = TypeObjectUtils::build_common_bitfield(position_c, flags_c, bitcount_c, holder_type_c); - eprosima::fastcdr::optional member_ann_builtin_c; - ann_custom_MyBitset.reset(); - MemberName name_c = "c"; - CompleteMemberDetail detail_c = TypeObjectUtils::build_complete_member_detail(name_c, member_ann_builtin_c, ann_custom_MyBitset); - CompleteBitfield bitfield_c = TypeObjectUtils::build_complete_bitfield(common_c, detail_c); - TypeObjectUtils::add_complete_bitfield(field_seq_MyBitset, bitfield_c); - } - { - uint16_t position_d = 18; - BitsetMemberFlag flags_d = 0; - uint8_t bitcount_d = 5; - TypeKind holder_type_d = TK_INT16; - CommonBitfield common_d = TypeObjectUtils::build_common_bitfield(position_d, flags_d, bitcount_d, holder_type_d); - eprosima::fastcdr::optional member_ann_builtin_d; - ann_custom_MyBitset.reset(); - MemberName name_d = "d"; - CompleteMemberDetail detail_d = TypeObjectUtils::build_complete_member_detail(name_d, member_ann_builtin_d, ann_custom_MyBitset); - CompleteBitfield bitfield_d = TypeObjectUtils::build_complete_bitfield(common_d, detail_d); - TypeObjectUtils::add_complete_bitfield(field_seq_MyBitset, bitfield_d); - } - { - uint16_t position_e = 23; - BitsetMemberFlag flags_e = 0; - uint8_t bitcount_e = 5; - TypeKind holder_type_e = TK_INT16; - CommonBitfield common_e = TypeObjectUtils::build_common_bitfield(position_e, flags_e, bitcount_e, holder_type_e); - eprosima::fastcdr::optional member_ann_builtin_e; - ann_custom_MyBitset.reset(); - MemberName name_e = "e"; - CompleteMemberDetail detail_e = TypeObjectUtils::build_complete_member_detail(name_e, member_ann_builtin_e, ann_custom_MyBitset); - CompleteBitfield bitfield_e = TypeObjectUtils::build_complete_bitfield(common_e, detail_e); - TypeObjectUtils::add_complete_bitfield(field_seq_MyBitset, bitfield_e); - } - { - uint16_t position_f = 28; - BitsetMemberFlag flags_f = 0; - uint8_t bitcount_f = 5; - TypeKind holder_type_f = TK_INT16; - CommonBitfield common_f = TypeObjectUtils::build_common_bitfield(position_f, flags_f, bitcount_f, holder_type_f); - eprosima::fastcdr::optional member_ann_builtin_f; - ann_custom_MyBitset.reset(); - MemberName name_f = "f"; - CompleteMemberDetail detail_f = TypeObjectUtils::build_complete_member_detail(name_f, member_ann_builtin_f, ann_custom_MyBitset); - CompleteBitfield bitfield_f = TypeObjectUtils::build_complete_bitfield(common_f, detail_f); - TypeObjectUtils::add_complete_bitfield(field_seq_MyBitset, bitfield_f); - } - CompleteBitsetType bitset_type_MyBitset = TypeObjectUtils::build_complete_bitset_type(bitset_flags_MyBitset, header_MyBitset, field_seq_MyBitset); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_bitset_type_object(bitset_type_MyBitset, type_name_MyBitset.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "bitmodule::MyBitset already registered in TypeObjectRegistry for a different type."); - } - return_code_BitsetBitmask = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "bitmodule::MyBitset", type_ids_BitsetBitmask); - if (return_code_BitsetBitmask != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "bitmodule::MyBitset: Given Bitset TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_mybitset = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_mybitset; - MemberId member_id_mybitset = 0x00000000; - if (EK_COMPLETE == type_ids_BitsetBitmask.type_identifier1()._d() || TK_NONE == type_ids_BitsetBitmask.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BitsetBitmask.type_identifier1()._d() && - EK_COMPLETE == type_ids_BitsetBitmask.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BitsetBitmask.type_identifier1()._d() && - EK_COMPLETE == type_ids_BitsetBitmask.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BitsetBitmask.type_identifier1()._d() && - EK_COMPLETE == type_ids_BitsetBitmask.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BitsetBitmask.type_identifier1()._d() && - EK_COMPLETE == type_ids_BitsetBitmask.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BitsetBitmask.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BitsetBitmask.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BitsetBitmask.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BitsetBitmask.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BitsetBitmask.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BitsetBitmask.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_mybitset = TypeObjectUtils::build_common_struct_member(member_id_mybitset, member_flags_mybitset, type_ids_BitsetBitmask.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BitsetBitmask.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BitsetBitmask.type_identifier2()._d() && - EK_COMPLETE == type_ids_BitsetBitmask.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BitsetBitmask.type_identifier2()._d() && - EK_COMPLETE == type_ids_BitsetBitmask.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BitsetBitmask.type_identifier2()._d() && - EK_COMPLETE == type_ids_BitsetBitmask.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BitsetBitmask.type_identifier2()._d() && - EK_COMPLETE == type_ids_BitsetBitmask.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BitsetBitmask.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BitsetBitmask.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BitsetBitmask.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BitsetBitmask.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BitsetBitmask.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BitsetBitmask.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_mybitset = TypeObjectUtils::build_common_struct_member(member_id_mybitset, member_flags_mybitset, type_ids_BitsetBitmask.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure mybitset member TypeIdentifier inconsistent."); - return; - } - MemberName name_mybitset = "mybitset"; - eprosima::fastcdr::optional member_ann_builtin_mybitset; - ann_custom_BitsetBitmask.reset(); - CompleteMemberDetail detail_mybitset = TypeObjectUtils::build_complete_member_detail(name_mybitset, member_ann_builtin_mybitset, ann_custom_BitsetBitmask); - CompleteStructMember member_mybitset = TypeObjectUtils::build_complete_struct_member(common_mybitset, detail_mybitset); - TypeObjectUtils::add_complete_struct_member(member_seq_BitsetBitmask, member_mybitset); - } - { - return_code_BitsetBitmask = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "bitmodule::MyBitMask", type_ids_BitsetBitmask); - - if (return_code_BitsetBitmask != eprosima::fastdds::dds::RETCODE_OK) - { - BitmaskTypeFlag bitmask_flags_MyBitMask = 0; - BitBound bit_bound_MyBitMask = 8; - CommonEnumeratedHeader common_MyBitMask = TypeObjectUtils::build_common_enumerated_header(bit_bound_MyBitMask, true); - QualifiedTypeName type_name_MyBitMask = "bitmodule::MyBitMask"; - eprosima::fastcdr::optional type_ann_builtin_MyBitMask; - eprosima::fastcdr::optional ann_custom_MyBitMask; - AppliedAnnotationSeq tmp_ann_custom_MyBitMask; - eprosima::fastcdr::optional verbatim_MyBitMask; - if (!tmp_ann_custom_MyBitMask.empty()) - { - ann_custom_MyBitMask = tmp_ann_custom_MyBitMask; - } - - CompleteTypeDetail detail_MyBitMask = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_MyBitMask, ann_custom_MyBitMask, type_name_MyBitMask.to_string()); - CompleteEnumeratedHeader header_MyBitMask = TypeObjectUtils::build_complete_enumerated_header(common_MyBitMask, detail_MyBitMask, true); - CompleteBitflagSeq flag_seq_MyBitMask; - { - uint16_t position_flag0 = 0; - BitflagFlag flags_flag0 = 0; - CommonBitflag common_flag0 = TypeObjectUtils::build_common_bitflag(position_flag0, flags_flag0); - eprosima::fastcdr::optional member_ann_builtin_flag0; - ann_custom_MyBitMask.reset(); - AppliedAnnotationSeq tmp_ann_custom_flag0; - if (!tmp_ann_custom_flag0.empty()) - { - ann_custom_MyBitMask = tmp_ann_custom_flag0; - } - MemberName name_flag0 = "flag0"; - CompleteMemberDetail detail_flag0 = TypeObjectUtils::build_complete_member_detail(name_flag0, member_ann_builtin_flag0, ann_custom_MyBitMask); - CompleteBitflag bitflag_flag0 = TypeObjectUtils::build_complete_bitflag(common_flag0, detail_flag0); - TypeObjectUtils::add_complete_bitflag(flag_seq_MyBitMask, bitflag_flag0); - } - { - uint16_t position_flag1 = 1; - BitflagFlag flags_flag1 = 0; - CommonBitflag common_flag1 = TypeObjectUtils::build_common_bitflag(position_flag1, flags_flag1); - eprosima::fastcdr::optional member_ann_builtin_flag1; - ann_custom_MyBitMask.reset(); - AppliedAnnotationSeq tmp_ann_custom_flag1; - if (!tmp_ann_custom_flag1.empty()) - { - ann_custom_MyBitMask = tmp_ann_custom_flag1; - } - MemberName name_flag1 = "flag1"; - CompleteMemberDetail detail_flag1 = TypeObjectUtils::build_complete_member_detail(name_flag1, member_ann_builtin_flag1, ann_custom_MyBitMask); - CompleteBitflag bitflag_flag1 = TypeObjectUtils::build_complete_bitflag(common_flag1, detail_flag1); - TypeObjectUtils::add_complete_bitflag(flag_seq_MyBitMask, bitflag_flag1); - } - { - uint16_t position_flag4 = 4; - BitflagFlag flags_flag4 = 0; - CommonBitflag common_flag4 = TypeObjectUtils::build_common_bitflag(position_flag4, flags_flag4); - eprosima::fastcdr::optional member_ann_builtin_flag4; - ann_custom_MyBitMask.reset(); - AppliedAnnotationSeq tmp_ann_custom_flag4; - if (!tmp_ann_custom_flag4.empty()) - { - ann_custom_MyBitMask = tmp_ann_custom_flag4; - } - MemberName name_flag4 = "flag4"; - CompleteMemberDetail detail_flag4 = TypeObjectUtils::build_complete_member_detail(name_flag4, member_ann_builtin_flag4, ann_custom_MyBitMask); - CompleteBitflag bitflag_flag4 = TypeObjectUtils::build_complete_bitflag(common_flag4, detail_flag4); - TypeObjectUtils::add_complete_bitflag(flag_seq_MyBitMask, bitflag_flag4); - } - { - uint16_t position_flag6 = 6; - BitflagFlag flags_flag6 = 0; - CommonBitflag common_flag6 = TypeObjectUtils::build_common_bitflag(position_flag6, flags_flag6); - eprosima::fastcdr::optional member_ann_builtin_flag6; - ann_custom_MyBitMask.reset(); - AppliedAnnotationSeq tmp_ann_custom_flag6; - if (!tmp_ann_custom_flag6.empty()) - { - ann_custom_MyBitMask = tmp_ann_custom_flag6; - } - MemberName name_flag6 = "flag6"; - CompleteMemberDetail detail_flag6 = TypeObjectUtils::build_complete_member_detail(name_flag6, member_ann_builtin_flag6, ann_custom_MyBitMask); - CompleteBitflag bitflag_flag6 = TypeObjectUtils::build_complete_bitflag(common_flag6, detail_flag6); - TypeObjectUtils::add_complete_bitflag(flag_seq_MyBitMask, bitflag_flag6); - } - { - uint16_t position_flag7 = 7; - BitflagFlag flags_flag7 = 0; - CommonBitflag common_flag7 = TypeObjectUtils::build_common_bitflag(position_flag7, flags_flag7); - eprosima::fastcdr::optional member_ann_builtin_flag7; - ann_custom_MyBitMask.reset(); - MemberName name_flag7 = "flag7"; - CompleteMemberDetail detail_flag7 = TypeObjectUtils::build_complete_member_detail(name_flag7, member_ann_builtin_flag7, ann_custom_MyBitMask); - CompleteBitflag bitflag_flag7 = TypeObjectUtils::build_complete_bitflag(common_flag7, detail_flag7); - TypeObjectUtils::add_complete_bitflag(flag_seq_MyBitMask, bitflag_flag7); - } - CompleteBitmaskType bitmask_type_MyBitMask = TypeObjectUtils::build_complete_bitmask_type(bitmask_flags_MyBitMask, header_MyBitMask, flag_seq_MyBitMask); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_bitmask_type_object(bitmask_type_MyBitMask, type_name_MyBitMask.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "bitmodule::MyBitMask already registered in TypeObjectRegistry for a different type."); - } - return_code_BitsetBitmask = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "bitmodule::MyBitMask", type_ids_BitsetBitmask); - if (return_code_BitsetBitmask != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "bitmodule::MyBitMask: Given Enum TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_mybitmask = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_mybitmask; - MemberId member_id_mybitmask = 0x00000001; - if (EK_COMPLETE == type_ids_BitsetBitmask.type_identifier1()._d() || TK_NONE == type_ids_BitsetBitmask.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BitsetBitmask.type_identifier1()._d() && - EK_COMPLETE == type_ids_BitsetBitmask.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BitsetBitmask.type_identifier1()._d() && - EK_COMPLETE == type_ids_BitsetBitmask.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BitsetBitmask.type_identifier1()._d() && - EK_COMPLETE == type_ids_BitsetBitmask.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BitsetBitmask.type_identifier1()._d() && - EK_COMPLETE == type_ids_BitsetBitmask.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BitsetBitmask.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BitsetBitmask.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BitsetBitmask.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BitsetBitmask.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BitsetBitmask.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BitsetBitmask.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_mybitmask = TypeObjectUtils::build_common_struct_member(member_id_mybitmask, member_flags_mybitmask, type_ids_BitsetBitmask.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BitsetBitmask.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BitsetBitmask.type_identifier2()._d() && - EK_COMPLETE == type_ids_BitsetBitmask.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BitsetBitmask.type_identifier2()._d() && - EK_COMPLETE == type_ids_BitsetBitmask.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BitsetBitmask.type_identifier2()._d() && - EK_COMPLETE == type_ids_BitsetBitmask.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BitsetBitmask.type_identifier2()._d() && - EK_COMPLETE == type_ids_BitsetBitmask.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BitsetBitmask.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BitsetBitmask.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BitsetBitmask.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BitsetBitmask.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BitsetBitmask.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BitsetBitmask.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_mybitmask = TypeObjectUtils::build_common_struct_member(member_id_mybitmask, member_flags_mybitmask, type_ids_BitsetBitmask.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure mybitmask member TypeIdentifier inconsistent."); - return; - } - MemberName name_mybitmask = "mybitmask"; - eprosima::fastcdr::optional member_ann_builtin_mybitmask; - ann_custom_BitsetBitmask.reset(); - CompleteMemberDetail detail_mybitmask = TypeObjectUtils::build_complete_member_detail(name_mybitmask, member_ann_builtin_mybitmask, ann_custom_BitsetBitmask); - CompleteStructMember member_mybitmask = TypeObjectUtils::build_complete_struct_member(common_mybitmask, detail_mybitmask); - TypeObjectUtils::add_complete_struct_member(member_seq_BitsetBitmask, member_mybitmask); - } - CompleteStructType struct_type_BitsetBitmask = TypeObjectUtils::build_complete_struct_type(struct_flags_BitsetBitmask, header_BitsetBitmask, member_seq_BitsetBitmask); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_BitsetBitmask, type_name_BitsetBitmask.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "bitmodule::BitsetBitmask already registered in TypeObjectRegistry for a different type."); - } - return_code_BitsetBitmask = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "bitmodule::BitsetBitmask", type_ids_BitsetBitmask); - if (return_code_BitsetBitmask != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "bitmodule::BitsetBitmask: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } -} -void register_bitmodule_BM2_type_identifier() -{ - { - StructTypeFlag struct_flags_BM2 = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_BM2; - TypeIdentifierPair type_ids_BM2; - return_code_BM2 = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "bitmodule::BitsetBitmask", type_ids_BM2); - - if (return_code_BM2 != eprosima::fastdds::dds::RETCODE_OK) - { - { - StructTypeFlag struct_flags_BitsetBitmask = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_BitsetBitmask; - TypeIdentifierPair type_ids_BitsetBitmask; - QualifiedTypeName type_name_BitsetBitmask = "bitmodule::BitsetBitmask"; - eprosima::fastcdr::optional type_ann_builtin_BitsetBitmask; - eprosima::fastcdr::optional ann_custom_BitsetBitmask; - CompleteTypeDetail detail_BitsetBitmask = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_BitsetBitmask, ann_custom_BitsetBitmask, type_name_BitsetBitmask.to_string()); - CompleteStructHeader header_BitsetBitmask; - header_BitsetBitmask = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_BitsetBitmask); - CompleteStructMemberSeq member_seq_BitsetBitmask; - { - return_code_BitsetBitmask = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "bitmodule::MyBitset", type_ids_BitsetBitmask); - - if (return_code_BitsetBitmask != eprosima::fastdds::dds::RETCODE_OK) - { - BitsetTypeFlag bitset_flags_MyBitset = 0; - QualifiedTypeName type_name_MyBitset = "bitmodule::MyBitset"; - eprosima::fastcdr::optional type_ann_builtin_MyBitset; - eprosima::fastcdr::optional ann_custom_MyBitset; - CompleteTypeDetail detail_MyBitset = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_MyBitset, ann_custom_MyBitset, type_name_MyBitset.to_string()); - CompleteBitsetHeader header_MyBitset = TypeObjectUtils::build_complete_bitset_header(detail_MyBitset); - CompleteBitfieldSeq field_seq_MyBitset; - { - uint16_t position_a = 0; - BitsetMemberFlag flags_a = 0; - uint8_t bitcount_a = 3; - TypeKind holder_type_a = TK_BYTE; - CommonBitfield common_a = TypeObjectUtils::build_common_bitfield(position_a, flags_a, bitcount_a, holder_type_a); - eprosima::fastcdr::optional member_ann_builtin_a; - ann_custom_MyBitset.reset(); - MemberName name_a = "a"; - CompleteMemberDetail detail_a = TypeObjectUtils::build_complete_member_detail(name_a, member_ann_builtin_a, ann_custom_MyBitset); - CompleteBitfield bitfield_a = TypeObjectUtils::build_complete_bitfield(common_a, detail_a); - TypeObjectUtils::add_complete_bitfield(field_seq_MyBitset, bitfield_a); - } - { - uint16_t position_b = 3; - BitsetMemberFlag flags_b = 0; - uint8_t bitcount_b = 1; - TypeKind holder_type_b = TK_BOOLEAN; - CommonBitfield common_b = TypeObjectUtils::build_common_bitfield(position_b, flags_b, bitcount_b, holder_type_b); - eprosima::fastcdr::optional member_ann_builtin_b; - ann_custom_MyBitset.reset(); - MemberName name_b = "b"; - CompleteMemberDetail detail_b = TypeObjectUtils::build_complete_member_detail(name_b, member_ann_builtin_b, ann_custom_MyBitset); - CompleteBitfield bitfield_b = TypeObjectUtils::build_complete_bitfield(common_b, detail_b); - TypeObjectUtils::add_complete_bitfield(field_seq_MyBitset, bitfield_b); - } - { - uint16_t position_c = 8; - BitsetMemberFlag flags_c = 0; - uint8_t bitcount_c = 10; - TypeKind holder_type_c = TK_UINT16; - CommonBitfield common_c = TypeObjectUtils::build_common_bitfield(position_c, flags_c, bitcount_c, holder_type_c); - eprosima::fastcdr::optional member_ann_builtin_c; - ann_custom_MyBitset.reset(); - MemberName name_c = "c"; - CompleteMemberDetail detail_c = TypeObjectUtils::build_complete_member_detail(name_c, member_ann_builtin_c, ann_custom_MyBitset); - CompleteBitfield bitfield_c = TypeObjectUtils::build_complete_bitfield(common_c, detail_c); - TypeObjectUtils::add_complete_bitfield(field_seq_MyBitset, bitfield_c); - } - { - uint16_t position_d = 18; - BitsetMemberFlag flags_d = 0; - uint8_t bitcount_d = 5; - TypeKind holder_type_d = TK_INT16; - CommonBitfield common_d = TypeObjectUtils::build_common_bitfield(position_d, flags_d, bitcount_d, holder_type_d); - eprosima::fastcdr::optional member_ann_builtin_d; - ann_custom_MyBitset.reset(); - MemberName name_d = "d"; - CompleteMemberDetail detail_d = TypeObjectUtils::build_complete_member_detail(name_d, member_ann_builtin_d, ann_custom_MyBitset); - CompleteBitfield bitfield_d = TypeObjectUtils::build_complete_bitfield(common_d, detail_d); - TypeObjectUtils::add_complete_bitfield(field_seq_MyBitset, bitfield_d); - } - { - uint16_t position_e = 23; - BitsetMemberFlag flags_e = 0; - uint8_t bitcount_e = 5; - TypeKind holder_type_e = TK_INT16; - CommonBitfield common_e = TypeObjectUtils::build_common_bitfield(position_e, flags_e, bitcount_e, holder_type_e); - eprosima::fastcdr::optional member_ann_builtin_e; - ann_custom_MyBitset.reset(); - MemberName name_e = "e"; - CompleteMemberDetail detail_e = TypeObjectUtils::build_complete_member_detail(name_e, member_ann_builtin_e, ann_custom_MyBitset); - CompleteBitfield bitfield_e = TypeObjectUtils::build_complete_bitfield(common_e, detail_e); - TypeObjectUtils::add_complete_bitfield(field_seq_MyBitset, bitfield_e); - } - { - uint16_t position_f = 28; - BitsetMemberFlag flags_f = 0; - uint8_t bitcount_f = 5; - TypeKind holder_type_f = TK_INT16; - CommonBitfield common_f = TypeObjectUtils::build_common_bitfield(position_f, flags_f, bitcount_f, holder_type_f); - eprosima::fastcdr::optional member_ann_builtin_f; - ann_custom_MyBitset.reset(); - MemberName name_f = "f"; - CompleteMemberDetail detail_f = TypeObjectUtils::build_complete_member_detail(name_f, member_ann_builtin_f, ann_custom_MyBitset); - CompleteBitfield bitfield_f = TypeObjectUtils::build_complete_bitfield(common_f, detail_f); - TypeObjectUtils::add_complete_bitfield(field_seq_MyBitset, bitfield_f); - } - CompleteBitsetType bitset_type_MyBitset = TypeObjectUtils::build_complete_bitset_type(bitset_flags_MyBitset, header_MyBitset, field_seq_MyBitset); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_bitset_type_object(bitset_type_MyBitset, type_name_MyBitset.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "bitmodule::MyBitset already registered in TypeObjectRegistry for a different type."); - } - return_code_BitsetBitmask = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "bitmodule::MyBitset", type_ids_BitsetBitmask); - if (return_code_BitsetBitmask != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "bitmodule::MyBitset: Given Bitset TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_mybitset = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_mybitset; - MemberId member_id_mybitset = 0x00000000; - if (EK_COMPLETE == type_ids_BitsetBitmask.type_identifier1()._d() || TK_NONE == type_ids_BitsetBitmask.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BitsetBitmask.type_identifier1()._d() && - EK_COMPLETE == type_ids_BitsetBitmask.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BitsetBitmask.type_identifier1()._d() && - EK_COMPLETE == type_ids_BitsetBitmask.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BitsetBitmask.type_identifier1()._d() && - EK_COMPLETE == type_ids_BitsetBitmask.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BitsetBitmask.type_identifier1()._d() && - EK_COMPLETE == type_ids_BitsetBitmask.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BitsetBitmask.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BitsetBitmask.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BitsetBitmask.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BitsetBitmask.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BitsetBitmask.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BitsetBitmask.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_mybitset = TypeObjectUtils::build_common_struct_member(member_id_mybitset, member_flags_mybitset, type_ids_BitsetBitmask.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BitsetBitmask.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BitsetBitmask.type_identifier2()._d() && - EK_COMPLETE == type_ids_BitsetBitmask.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BitsetBitmask.type_identifier2()._d() && - EK_COMPLETE == type_ids_BitsetBitmask.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BitsetBitmask.type_identifier2()._d() && - EK_COMPLETE == type_ids_BitsetBitmask.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BitsetBitmask.type_identifier2()._d() && - EK_COMPLETE == type_ids_BitsetBitmask.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BitsetBitmask.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BitsetBitmask.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BitsetBitmask.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BitsetBitmask.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BitsetBitmask.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BitsetBitmask.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_mybitset = TypeObjectUtils::build_common_struct_member(member_id_mybitset, member_flags_mybitset, type_ids_BitsetBitmask.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure mybitset member TypeIdentifier inconsistent."); - return; - } - MemberName name_mybitset = "mybitset"; - eprosima::fastcdr::optional member_ann_builtin_mybitset; - ann_custom_BitsetBitmask.reset(); - CompleteMemberDetail detail_mybitset = TypeObjectUtils::build_complete_member_detail(name_mybitset, member_ann_builtin_mybitset, ann_custom_BitsetBitmask); - CompleteStructMember member_mybitset = TypeObjectUtils::build_complete_struct_member(common_mybitset, detail_mybitset); - TypeObjectUtils::add_complete_struct_member(member_seq_BitsetBitmask, member_mybitset); - } - { - return_code_BitsetBitmask = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "bitmodule::MyBitMask", type_ids_BitsetBitmask); - - if (return_code_BitsetBitmask != eprosima::fastdds::dds::RETCODE_OK) - { - BitmaskTypeFlag bitmask_flags_MyBitMask = 0; - BitBound bit_bound_MyBitMask = 8; - CommonEnumeratedHeader common_MyBitMask = TypeObjectUtils::build_common_enumerated_header(bit_bound_MyBitMask, true); - QualifiedTypeName type_name_MyBitMask = "bitmodule::MyBitMask"; - eprosima::fastcdr::optional type_ann_builtin_MyBitMask; - eprosima::fastcdr::optional ann_custom_MyBitMask; - AppliedAnnotationSeq tmp_ann_custom_MyBitMask; - eprosima::fastcdr::optional verbatim_MyBitMask; - if (!tmp_ann_custom_MyBitMask.empty()) - { - ann_custom_MyBitMask = tmp_ann_custom_MyBitMask; - } - - CompleteTypeDetail detail_MyBitMask = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_MyBitMask, ann_custom_MyBitMask, type_name_MyBitMask.to_string()); - CompleteEnumeratedHeader header_MyBitMask = TypeObjectUtils::build_complete_enumerated_header(common_MyBitMask, detail_MyBitMask, true); - CompleteBitflagSeq flag_seq_MyBitMask; - { - uint16_t position_flag0 = 0; - BitflagFlag flags_flag0 = 0; - CommonBitflag common_flag0 = TypeObjectUtils::build_common_bitflag(position_flag0, flags_flag0); - eprosima::fastcdr::optional member_ann_builtin_flag0; - ann_custom_MyBitMask.reset(); - AppliedAnnotationSeq tmp_ann_custom_flag0; - if (!tmp_ann_custom_flag0.empty()) - { - ann_custom_MyBitMask = tmp_ann_custom_flag0; - } - MemberName name_flag0 = "flag0"; - CompleteMemberDetail detail_flag0 = TypeObjectUtils::build_complete_member_detail(name_flag0, member_ann_builtin_flag0, ann_custom_MyBitMask); - CompleteBitflag bitflag_flag0 = TypeObjectUtils::build_complete_bitflag(common_flag0, detail_flag0); - TypeObjectUtils::add_complete_bitflag(flag_seq_MyBitMask, bitflag_flag0); - } - { - uint16_t position_flag1 = 1; - BitflagFlag flags_flag1 = 0; - CommonBitflag common_flag1 = TypeObjectUtils::build_common_bitflag(position_flag1, flags_flag1); - eprosima::fastcdr::optional member_ann_builtin_flag1; - ann_custom_MyBitMask.reset(); - AppliedAnnotationSeq tmp_ann_custom_flag1; - if (!tmp_ann_custom_flag1.empty()) - { - ann_custom_MyBitMask = tmp_ann_custom_flag1; - } - MemberName name_flag1 = "flag1"; - CompleteMemberDetail detail_flag1 = TypeObjectUtils::build_complete_member_detail(name_flag1, member_ann_builtin_flag1, ann_custom_MyBitMask); - CompleteBitflag bitflag_flag1 = TypeObjectUtils::build_complete_bitflag(common_flag1, detail_flag1); - TypeObjectUtils::add_complete_bitflag(flag_seq_MyBitMask, bitflag_flag1); - } - { - uint16_t position_flag4 = 4; - BitflagFlag flags_flag4 = 0; - CommonBitflag common_flag4 = TypeObjectUtils::build_common_bitflag(position_flag4, flags_flag4); - eprosima::fastcdr::optional member_ann_builtin_flag4; - ann_custom_MyBitMask.reset(); - AppliedAnnotationSeq tmp_ann_custom_flag4; - if (!tmp_ann_custom_flag4.empty()) - { - ann_custom_MyBitMask = tmp_ann_custom_flag4; - } - MemberName name_flag4 = "flag4"; - CompleteMemberDetail detail_flag4 = TypeObjectUtils::build_complete_member_detail(name_flag4, member_ann_builtin_flag4, ann_custom_MyBitMask); - CompleteBitflag bitflag_flag4 = TypeObjectUtils::build_complete_bitflag(common_flag4, detail_flag4); - TypeObjectUtils::add_complete_bitflag(flag_seq_MyBitMask, bitflag_flag4); - } - { - uint16_t position_flag6 = 6; - BitflagFlag flags_flag6 = 0; - CommonBitflag common_flag6 = TypeObjectUtils::build_common_bitflag(position_flag6, flags_flag6); - eprosima::fastcdr::optional member_ann_builtin_flag6; - ann_custom_MyBitMask.reset(); - AppliedAnnotationSeq tmp_ann_custom_flag6; - if (!tmp_ann_custom_flag6.empty()) - { - ann_custom_MyBitMask = tmp_ann_custom_flag6; - } - MemberName name_flag6 = "flag6"; - CompleteMemberDetail detail_flag6 = TypeObjectUtils::build_complete_member_detail(name_flag6, member_ann_builtin_flag6, ann_custom_MyBitMask); - CompleteBitflag bitflag_flag6 = TypeObjectUtils::build_complete_bitflag(common_flag6, detail_flag6); - TypeObjectUtils::add_complete_bitflag(flag_seq_MyBitMask, bitflag_flag6); - } - { - uint16_t position_flag7 = 7; - BitflagFlag flags_flag7 = 0; - CommonBitflag common_flag7 = TypeObjectUtils::build_common_bitflag(position_flag7, flags_flag7); - eprosima::fastcdr::optional member_ann_builtin_flag7; - ann_custom_MyBitMask.reset(); - MemberName name_flag7 = "flag7"; - CompleteMemberDetail detail_flag7 = TypeObjectUtils::build_complete_member_detail(name_flag7, member_ann_builtin_flag7, ann_custom_MyBitMask); - CompleteBitflag bitflag_flag7 = TypeObjectUtils::build_complete_bitflag(common_flag7, detail_flag7); - TypeObjectUtils::add_complete_bitflag(flag_seq_MyBitMask, bitflag_flag7); - } - CompleteBitmaskType bitmask_type_MyBitMask = TypeObjectUtils::build_complete_bitmask_type(bitmask_flags_MyBitMask, header_MyBitMask, flag_seq_MyBitMask); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_bitmask_type_object(bitmask_type_MyBitMask, type_name_MyBitMask.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "bitmodule::MyBitMask already registered in TypeObjectRegistry for a different type."); - } - return_code_BitsetBitmask = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "bitmodule::MyBitMask", type_ids_BitsetBitmask); - if (return_code_BitsetBitmask != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "bitmodule::MyBitMask: Given Enum TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_mybitmask = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_mybitmask; - MemberId member_id_mybitmask = 0x00000001; - if (EK_COMPLETE == type_ids_BitsetBitmask.type_identifier1()._d() || TK_NONE == type_ids_BitsetBitmask.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BitsetBitmask.type_identifier1()._d() && - EK_COMPLETE == type_ids_BitsetBitmask.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BitsetBitmask.type_identifier1()._d() && - EK_COMPLETE == type_ids_BitsetBitmask.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BitsetBitmask.type_identifier1()._d() && - EK_COMPLETE == type_ids_BitsetBitmask.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BitsetBitmask.type_identifier1()._d() && - EK_COMPLETE == type_ids_BitsetBitmask.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BitsetBitmask.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BitsetBitmask.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BitsetBitmask.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BitsetBitmask.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BitsetBitmask.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BitsetBitmask.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_mybitmask = TypeObjectUtils::build_common_struct_member(member_id_mybitmask, member_flags_mybitmask, type_ids_BitsetBitmask.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BitsetBitmask.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BitsetBitmask.type_identifier2()._d() && - EK_COMPLETE == type_ids_BitsetBitmask.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BitsetBitmask.type_identifier2()._d() && - EK_COMPLETE == type_ids_BitsetBitmask.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BitsetBitmask.type_identifier2()._d() && - EK_COMPLETE == type_ids_BitsetBitmask.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BitsetBitmask.type_identifier2()._d() && - EK_COMPLETE == type_ids_BitsetBitmask.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BitsetBitmask.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BitsetBitmask.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BitsetBitmask.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BitsetBitmask.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BitsetBitmask.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BitsetBitmask.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_mybitmask = TypeObjectUtils::build_common_struct_member(member_id_mybitmask, member_flags_mybitmask, type_ids_BitsetBitmask.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure mybitmask member TypeIdentifier inconsistent."); - return; - } - MemberName name_mybitmask = "mybitmask"; - eprosima::fastcdr::optional member_ann_builtin_mybitmask; - ann_custom_BitsetBitmask.reset(); - CompleteMemberDetail detail_mybitmask = TypeObjectUtils::build_complete_member_detail(name_mybitmask, member_ann_builtin_mybitmask, ann_custom_BitsetBitmask); - CompleteStructMember member_mybitmask = TypeObjectUtils::build_complete_struct_member(common_mybitmask, detail_mybitmask); - TypeObjectUtils::add_complete_struct_member(member_seq_BitsetBitmask, member_mybitmask); - } - CompleteStructType struct_type_BitsetBitmask = TypeObjectUtils::build_complete_struct_type(struct_flags_BitsetBitmask, header_BitsetBitmask, member_seq_BitsetBitmask); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_BitsetBitmask, type_name_BitsetBitmask.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "bitmodule::BitsetBitmask already registered in TypeObjectRegistry for a different type."); - } - return_code_BitsetBitmask = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "bitmodule::BitsetBitmask", type_ids_BitsetBitmask); - if (return_code_BitsetBitmask != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "bitmodule::BitsetBitmask: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - } - QualifiedTypeName type_name_BM2 = "bitmodule::BM2"; - eprosima::fastcdr::optional type_ann_builtin_BM2; - eprosima::fastcdr::optional ann_custom_BM2; - CompleteTypeDetail detail_BM2 = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_BM2, ann_custom_BM2, type_name_BM2.to_string()); - CompleteStructHeader header_BM2; - if (EK_COMPLETE == type_ids_BM2.type_identifier1()._d()) - { - header_BM2 = TypeObjectUtils::build_complete_struct_header(type_ids_BM2.type_identifier1(), detail_BM2); - } - else if (EK_COMPLETE == type_ids_BM2.type_identifier2()._d()) - { - header_BM2 = TypeObjectUtils::build_complete_struct_header(type_ids_BM2.type_identifier2(), detail_BM2); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "bitmodule::BM2 Structure: base_type TypeIdentifier registered in TypeObjectRegistry is inconsistent."); - return; - } - CompleteStructMemberSeq member_seq_BM2; - { - return_code_BM2 = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "bitmodule::MyBitMask", type_ids_BM2); - - if (return_code_BM2 != eprosima::fastdds::dds::RETCODE_OK) - { - BitmaskTypeFlag bitmask_flags_MyBitMask = 0; - BitBound bit_bound_MyBitMask = 8; - CommonEnumeratedHeader common_MyBitMask = TypeObjectUtils::build_common_enumerated_header(bit_bound_MyBitMask, true); - QualifiedTypeName type_name_MyBitMask = "bitmodule::MyBitMask"; - eprosima::fastcdr::optional type_ann_builtin_MyBitMask; - eprosima::fastcdr::optional ann_custom_MyBitMask; - AppliedAnnotationSeq tmp_ann_custom_MyBitMask; - eprosima::fastcdr::optional verbatim_MyBitMask; - if (!tmp_ann_custom_MyBitMask.empty()) - { - ann_custom_MyBitMask = tmp_ann_custom_MyBitMask; - } - - CompleteTypeDetail detail_MyBitMask = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_MyBitMask, ann_custom_MyBitMask, type_name_MyBitMask.to_string()); - CompleteEnumeratedHeader header_MyBitMask = TypeObjectUtils::build_complete_enumerated_header(common_MyBitMask, detail_MyBitMask, true); - CompleteBitflagSeq flag_seq_MyBitMask; - { - uint16_t position_flag0 = 0; - BitflagFlag flags_flag0 = 0; - CommonBitflag common_flag0 = TypeObjectUtils::build_common_bitflag(position_flag0, flags_flag0); - eprosima::fastcdr::optional member_ann_builtin_flag0; - ann_custom_MyBitMask.reset(); - AppliedAnnotationSeq tmp_ann_custom_flag0; - if (!tmp_ann_custom_flag0.empty()) - { - ann_custom_MyBitMask = tmp_ann_custom_flag0; - } - MemberName name_flag0 = "flag0"; - CompleteMemberDetail detail_flag0 = TypeObjectUtils::build_complete_member_detail(name_flag0, member_ann_builtin_flag0, ann_custom_MyBitMask); - CompleteBitflag bitflag_flag0 = TypeObjectUtils::build_complete_bitflag(common_flag0, detail_flag0); - TypeObjectUtils::add_complete_bitflag(flag_seq_MyBitMask, bitflag_flag0); - } - { - uint16_t position_flag1 = 1; - BitflagFlag flags_flag1 = 0; - CommonBitflag common_flag1 = TypeObjectUtils::build_common_bitflag(position_flag1, flags_flag1); - eprosima::fastcdr::optional member_ann_builtin_flag1; - ann_custom_MyBitMask.reset(); - AppliedAnnotationSeq tmp_ann_custom_flag1; - if (!tmp_ann_custom_flag1.empty()) - { - ann_custom_MyBitMask = tmp_ann_custom_flag1; - } - MemberName name_flag1 = "flag1"; - CompleteMemberDetail detail_flag1 = TypeObjectUtils::build_complete_member_detail(name_flag1, member_ann_builtin_flag1, ann_custom_MyBitMask); - CompleteBitflag bitflag_flag1 = TypeObjectUtils::build_complete_bitflag(common_flag1, detail_flag1); - TypeObjectUtils::add_complete_bitflag(flag_seq_MyBitMask, bitflag_flag1); - } - { - uint16_t position_flag4 = 4; - BitflagFlag flags_flag4 = 0; - CommonBitflag common_flag4 = TypeObjectUtils::build_common_bitflag(position_flag4, flags_flag4); - eprosima::fastcdr::optional member_ann_builtin_flag4; - ann_custom_MyBitMask.reset(); - AppliedAnnotationSeq tmp_ann_custom_flag4; - if (!tmp_ann_custom_flag4.empty()) - { - ann_custom_MyBitMask = tmp_ann_custom_flag4; - } - MemberName name_flag4 = "flag4"; - CompleteMemberDetail detail_flag4 = TypeObjectUtils::build_complete_member_detail(name_flag4, member_ann_builtin_flag4, ann_custom_MyBitMask); - CompleteBitflag bitflag_flag4 = TypeObjectUtils::build_complete_bitflag(common_flag4, detail_flag4); - TypeObjectUtils::add_complete_bitflag(flag_seq_MyBitMask, bitflag_flag4); - } - { - uint16_t position_flag6 = 6; - BitflagFlag flags_flag6 = 0; - CommonBitflag common_flag6 = TypeObjectUtils::build_common_bitflag(position_flag6, flags_flag6); - eprosima::fastcdr::optional member_ann_builtin_flag6; - ann_custom_MyBitMask.reset(); - AppliedAnnotationSeq tmp_ann_custom_flag6; - if (!tmp_ann_custom_flag6.empty()) - { - ann_custom_MyBitMask = tmp_ann_custom_flag6; - } - MemberName name_flag6 = "flag6"; - CompleteMemberDetail detail_flag6 = TypeObjectUtils::build_complete_member_detail(name_flag6, member_ann_builtin_flag6, ann_custom_MyBitMask); - CompleteBitflag bitflag_flag6 = TypeObjectUtils::build_complete_bitflag(common_flag6, detail_flag6); - TypeObjectUtils::add_complete_bitflag(flag_seq_MyBitMask, bitflag_flag6); - } - { - uint16_t position_flag7 = 7; - BitflagFlag flags_flag7 = 0; - CommonBitflag common_flag7 = TypeObjectUtils::build_common_bitflag(position_flag7, flags_flag7); - eprosima::fastcdr::optional member_ann_builtin_flag7; - ann_custom_MyBitMask.reset(); - MemberName name_flag7 = "flag7"; - CompleteMemberDetail detail_flag7 = TypeObjectUtils::build_complete_member_detail(name_flag7, member_ann_builtin_flag7, ann_custom_MyBitMask); - CompleteBitflag bitflag_flag7 = TypeObjectUtils::build_complete_bitflag(common_flag7, detail_flag7); - TypeObjectUtils::add_complete_bitflag(flag_seq_MyBitMask, bitflag_flag7); - } - CompleteBitmaskType bitmask_type_MyBitMask = TypeObjectUtils::build_complete_bitmask_type(bitmask_flags_MyBitMask, header_MyBitMask, flag_seq_MyBitMask); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_bitmask_type_object(bitmask_type_MyBitMask, type_name_MyBitMask.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "bitmodule::MyBitMask already registered in TypeObjectRegistry for a different type."); - } - return_code_BM2 = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "bitmodule::MyBitMask", type_ids_BM2); - if (return_code_BM2 != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "bitmodule::MyBitMask: Given Enum TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_two = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_two; - MemberId member_id_two = 0x00000002; - if (EK_COMPLETE == type_ids_BM2.type_identifier1()._d() || TK_NONE == type_ids_BM2.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BM2.type_identifier1()._d() && - EK_COMPLETE == type_ids_BM2.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BM2.type_identifier1()._d() && - EK_COMPLETE == type_ids_BM2.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BM2.type_identifier1()._d() && - EK_COMPLETE == type_ids_BM2.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BM2.type_identifier1()._d() && - EK_COMPLETE == type_ids_BM2.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BM2.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BM2.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BM2.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BM2.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BM2.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BM2.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_two = TypeObjectUtils::build_common_struct_member(member_id_two, member_flags_two, type_ids_BM2.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BM2.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BM2.type_identifier2()._d() && - EK_COMPLETE == type_ids_BM2.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BM2.type_identifier2()._d() && - EK_COMPLETE == type_ids_BM2.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BM2.type_identifier2()._d() && - EK_COMPLETE == type_ids_BM2.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BM2.type_identifier2()._d() && - EK_COMPLETE == type_ids_BM2.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BM2.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BM2.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BM2.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BM2.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BM2.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BM2.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_two = TypeObjectUtils::build_common_struct_member(member_id_two, member_flags_two, type_ids_BM2.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure two member TypeIdentifier inconsistent."); - return; - } - MemberName name_two = "two"; - eprosima::fastcdr::optional member_ann_builtin_two; - ann_custom_BM2.reset(); - CompleteMemberDetail detail_two = TypeObjectUtils::build_complete_member_detail(name_two, member_ann_builtin_two, ann_custom_BM2); - CompleteStructMember member_two = TypeObjectUtils::build_complete_struct_member(common_two, detail_two); - TypeObjectUtils::add_complete_struct_member(member_seq_BM2, member_two); - } - { - return_code_BM2 = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_BM2); - - if (return_code_BM2 != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "mylong Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_mylong = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_mylong; - MemberId member_id_mylong = 0x00000003; - if (EK_COMPLETE == type_ids_BM2.type_identifier1()._d() || TK_NONE == type_ids_BM2.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BM2.type_identifier1()._d() && - EK_COMPLETE == type_ids_BM2.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BM2.type_identifier1()._d() && - EK_COMPLETE == type_ids_BM2.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BM2.type_identifier1()._d() && - EK_COMPLETE == type_ids_BM2.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BM2.type_identifier1()._d() && - EK_COMPLETE == type_ids_BM2.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BM2.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BM2.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BM2.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BM2.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BM2.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BM2.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_mylong = TypeObjectUtils::build_common_struct_member(member_id_mylong, member_flags_mylong, type_ids_BM2.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BM2.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BM2.type_identifier2()._d() && - EK_COMPLETE == type_ids_BM2.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BM2.type_identifier2()._d() && - EK_COMPLETE == type_ids_BM2.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BM2.type_identifier2()._d() && - EK_COMPLETE == type_ids_BM2.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BM2.type_identifier2()._d() && - EK_COMPLETE == type_ids_BM2.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BM2.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BM2.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BM2.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BM2.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BM2.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BM2.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_mylong = TypeObjectUtils::build_common_struct_member(member_id_mylong, member_flags_mylong, type_ids_BM2.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure mylong member TypeIdentifier inconsistent."); - return; - } - MemberName name_mylong = "mylong"; - eprosima::fastcdr::optional member_ann_builtin_mylong; - ann_custom_BM2.reset(); - CompleteMemberDetail detail_mylong = TypeObjectUtils::build_complete_member_detail(name_mylong, member_ann_builtin_mylong, ann_custom_BM2); - CompleteStructMember member_mylong = TypeObjectUtils::build_complete_struct_member(common_mylong, detail_mylong); - TypeObjectUtils::add_complete_struct_member(member_seq_BM2, member_mylong); - } - CompleteStructType struct_type_BM2 = TypeObjectUtils::build_complete_struct_type(struct_flags_BM2, header_BM2, member_seq_BM2); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_BM2, type_name_BM2.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "bitmodule::BM2 already registered in TypeObjectRegistry for a different type."); - } - return_code_BM2 = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "bitmodule::BM2", type_ids_BM2); - if (return_code_BM2 != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "bitmodule::BM2: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } -} - -} // namespace bitmodule -void register_StructTest_type_identifier() -{ - { - StructTypeFlag struct_flags_StructTest = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_StructTest; - TypeIdentifierPair type_ids_StructTest; - return_code_StructTest = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "NewAliases", type_ids_StructTest); - - if (return_code_StructTest != eprosima::fastdds::dds::RETCODE_OK) - { - { - StructTypeFlag struct_flags_NewAliases = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_NewAliases; - TypeIdentifierPair type_ids_NewAliases; - QualifiedTypeName type_name_NewAliases = "NewAliases"; - eprosima::fastcdr::optional type_ann_builtin_NewAliases; - eprosima::fastcdr::optional ann_custom_NewAliases; - CompleteTypeDetail detail_NewAliases = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_NewAliases, ann_custom_NewAliases, type_name_NewAliases.to_string()); - CompleteStructHeader header_NewAliases; - header_NewAliases = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_NewAliases); - CompleteStructMemberSeq member_seq_NewAliases; - { - return_code_NewAliases = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int8_t", type_ids_NewAliases); - - if (return_code_NewAliases != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "int8_ Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_int8_ = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_int8_; - MemberId member_id_int8_ = 0x00000000; - if (EK_COMPLETE == type_ids_NewAliases.type_identifier1()._d() || TK_NONE == type_ids_NewAliases.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_NewAliases.type_identifier1()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_NewAliases.type_identifier1()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_NewAliases.type_identifier1()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_NewAliases.type_identifier1()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_NewAliases.type_identifier1()._d() && - (EK_COMPLETE == type_ids_NewAliases.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_NewAliases.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_NewAliases.type_identifier1()._d() && - (EK_COMPLETE == type_ids_NewAliases.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_NewAliases.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_int8_ = TypeObjectUtils::build_common_struct_member(member_id_int8_, member_flags_int8_, type_ids_NewAliases.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_NewAliases.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_NewAliases.type_identifier2()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_NewAliases.type_identifier2()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_NewAliases.type_identifier2()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_NewAliases.type_identifier2()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_NewAliases.type_identifier2()._d() && - (EK_COMPLETE == type_ids_NewAliases.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_NewAliases.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_NewAliases.type_identifier2()._d() && - (EK_COMPLETE == type_ids_NewAliases.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_NewAliases.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_int8_ = TypeObjectUtils::build_common_struct_member(member_id_int8_, member_flags_int8_, type_ids_NewAliases.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure int8_ member TypeIdentifier inconsistent."); - return; - } - MemberName name_int8_ = "int8_"; - eprosima::fastcdr::optional member_ann_builtin_int8_; - ann_custom_NewAliases.reset(); - CompleteMemberDetail detail_int8_ = TypeObjectUtils::build_complete_member_detail(name_int8_, member_ann_builtin_int8_, ann_custom_NewAliases); - CompleteStructMember member_int8_ = TypeObjectUtils::build_complete_struct_member(common_int8_, detail_int8_); - TypeObjectUtils::add_complete_struct_member(member_seq_NewAliases, member_int8_); - } - { - return_code_NewAliases = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_uint8_t", type_ids_NewAliases); - - if (return_code_NewAliases != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "uint8_ Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_uint8_ = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_uint8_; - MemberId member_id_uint8_ = 0x00000001; - if (EK_COMPLETE == type_ids_NewAliases.type_identifier1()._d() || TK_NONE == type_ids_NewAliases.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_NewAliases.type_identifier1()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_NewAliases.type_identifier1()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_NewAliases.type_identifier1()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_NewAliases.type_identifier1()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_NewAliases.type_identifier1()._d() && - (EK_COMPLETE == type_ids_NewAliases.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_NewAliases.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_NewAliases.type_identifier1()._d() && - (EK_COMPLETE == type_ids_NewAliases.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_NewAliases.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_uint8_ = TypeObjectUtils::build_common_struct_member(member_id_uint8_, member_flags_uint8_, type_ids_NewAliases.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_NewAliases.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_NewAliases.type_identifier2()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_NewAliases.type_identifier2()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_NewAliases.type_identifier2()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_NewAliases.type_identifier2()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_NewAliases.type_identifier2()._d() && - (EK_COMPLETE == type_ids_NewAliases.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_NewAliases.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_NewAliases.type_identifier2()._d() && - (EK_COMPLETE == type_ids_NewAliases.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_NewAliases.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_uint8_ = TypeObjectUtils::build_common_struct_member(member_id_uint8_, member_flags_uint8_, type_ids_NewAliases.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure uint8_ member TypeIdentifier inconsistent."); - return; - } - MemberName name_uint8_ = "uint8_"; - eprosima::fastcdr::optional member_ann_builtin_uint8_; - ann_custom_NewAliases.reset(); - CompleteMemberDetail detail_uint8_ = TypeObjectUtils::build_complete_member_detail(name_uint8_, member_ann_builtin_uint8_, ann_custom_NewAliases); - CompleteStructMember member_uint8_ = TypeObjectUtils::build_complete_struct_member(common_uint8_, detail_uint8_); - TypeObjectUtils::add_complete_struct_member(member_seq_NewAliases, member_uint8_); - } - { - return_code_NewAliases = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int16_t", type_ids_NewAliases); - - if (return_code_NewAliases != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "int16_ Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_int16_ = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_int16_; - MemberId member_id_int16_ = 0x00000002; - if (EK_COMPLETE == type_ids_NewAliases.type_identifier1()._d() || TK_NONE == type_ids_NewAliases.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_NewAliases.type_identifier1()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_NewAliases.type_identifier1()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_NewAliases.type_identifier1()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_NewAliases.type_identifier1()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_NewAliases.type_identifier1()._d() && - (EK_COMPLETE == type_ids_NewAliases.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_NewAliases.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_NewAliases.type_identifier1()._d() && - (EK_COMPLETE == type_ids_NewAliases.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_NewAliases.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_int16_ = TypeObjectUtils::build_common_struct_member(member_id_int16_, member_flags_int16_, type_ids_NewAliases.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_NewAliases.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_NewAliases.type_identifier2()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_NewAliases.type_identifier2()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_NewAliases.type_identifier2()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_NewAliases.type_identifier2()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_NewAliases.type_identifier2()._d() && - (EK_COMPLETE == type_ids_NewAliases.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_NewAliases.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_NewAliases.type_identifier2()._d() && - (EK_COMPLETE == type_ids_NewAliases.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_NewAliases.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_int16_ = TypeObjectUtils::build_common_struct_member(member_id_int16_, member_flags_int16_, type_ids_NewAliases.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure int16_ member TypeIdentifier inconsistent."); - return; - } - MemberName name_int16_ = "int16_"; - eprosima::fastcdr::optional member_ann_builtin_int16_; - ann_custom_NewAliases.reset(); - CompleteMemberDetail detail_int16_ = TypeObjectUtils::build_complete_member_detail(name_int16_, member_ann_builtin_int16_, ann_custom_NewAliases); - CompleteStructMember member_int16_ = TypeObjectUtils::build_complete_struct_member(common_int16_, detail_int16_); - TypeObjectUtils::add_complete_struct_member(member_seq_NewAliases, member_int16_); - } - { - return_code_NewAliases = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_uint16_t", type_ids_NewAliases); - - if (return_code_NewAliases != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "uint16_ Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_uint16_ = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_uint16_; - MemberId member_id_uint16_ = 0x00000003; - if (EK_COMPLETE == type_ids_NewAliases.type_identifier1()._d() || TK_NONE == type_ids_NewAliases.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_NewAliases.type_identifier1()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_NewAliases.type_identifier1()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_NewAliases.type_identifier1()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_NewAliases.type_identifier1()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_NewAliases.type_identifier1()._d() && - (EK_COMPLETE == type_ids_NewAliases.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_NewAliases.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_NewAliases.type_identifier1()._d() && - (EK_COMPLETE == type_ids_NewAliases.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_NewAliases.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_uint16_ = TypeObjectUtils::build_common_struct_member(member_id_uint16_, member_flags_uint16_, type_ids_NewAliases.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_NewAliases.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_NewAliases.type_identifier2()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_NewAliases.type_identifier2()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_NewAliases.type_identifier2()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_NewAliases.type_identifier2()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_NewAliases.type_identifier2()._d() && - (EK_COMPLETE == type_ids_NewAliases.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_NewAliases.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_NewAliases.type_identifier2()._d() && - (EK_COMPLETE == type_ids_NewAliases.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_NewAliases.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_uint16_ = TypeObjectUtils::build_common_struct_member(member_id_uint16_, member_flags_uint16_, type_ids_NewAliases.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure uint16_ member TypeIdentifier inconsistent."); - return; - } - MemberName name_uint16_ = "uint16_"; - eprosima::fastcdr::optional member_ann_builtin_uint16_; - ann_custom_NewAliases.reset(); - CompleteMemberDetail detail_uint16_ = TypeObjectUtils::build_complete_member_detail(name_uint16_, member_ann_builtin_uint16_, ann_custom_NewAliases); - CompleteStructMember member_uint16_ = TypeObjectUtils::build_complete_struct_member(common_uint16_, detail_uint16_); - TypeObjectUtils::add_complete_struct_member(member_seq_NewAliases, member_uint16_); - } - { - return_code_NewAliases = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_NewAliases); - - if (return_code_NewAliases != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "int32_ Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_int32_ = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_int32_; - MemberId member_id_int32_ = 0x00000004; - if (EK_COMPLETE == type_ids_NewAliases.type_identifier1()._d() || TK_NONE == type_ids_NewAliases.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_NewAliases.type_identifier1()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_NewAliases.type_identifier1()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_NewAliases.type_identifier1()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_NewAliases.type_identifier1()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_NewAliases.type_identifier1()._d() && - (EK_COMPLETE == type_ids_NewAliases.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_NewAliases.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_NewAliases.type_identifier1()._d() && - (EK_COMPLETE == type_ids_NewAliases.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_NewAliases.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_int32_ = TypeObjectUtils::build_common_struct_member(member_id_int32_, member_flags_int32_, type_ids_NewAliases.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_NewAliases.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_NewAliases.type_identifier2()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_NewAliases.type_identifier2()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_NewAliases.type_identifier2()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_NewAliases.type_identifier2()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_NewAliases.type_identifier2()._d() && - (EK_COMPLETE == type_ids_NewAliases.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_NewAliases.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_NewAliases.type_identifier2()._d() && - (EK_COMPLETE == type_ids_NewAliases.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_NewAliases.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_int32_ = TypeObjectUtils::build_common_struct_member(member_id_int32_, member_flags_int32_, type_ids_NewAliases.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure int32_ member TypeIdentifier inconsistent."); - return; - } - MemberName name_int32_ = "int32_"; - eprosima::fastcdr::optional member_ann_builtin_int32_; - ann_custom_NewAliases.reset(); - CompleteMemberDetail detail_int32_ = TypeObjectUtils::build_complete_member_detail(name_int32_, member_ann_builtin_int32_, ann_custom_NewAliases); - CompleteStructMember member_int32_ = TypeObjectUtils::build_complete_struct_member(common_int32_, detail_int32_); - TypeObjectUtils::add_complete_struct_member(member_seq_NewAliases, member_int32_); - } - { - return_code_NewAliases = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_uint32_t", type_ids_NewAliases); - - if (return_code_NewAliases != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "uint32_ Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_uint32_ = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_uint32_; - MemberId member_id_uint32_ = 0x00000005; - if (EK_COMPLETE == type_ids_NewAliases.type_identifier1()._d() || TK_NONE == type_ids_NewAliases.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_NewAliases.type_identifier1()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_NewAliases.type_identifier1()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_NewAliases.type_identifier1()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_NewAliases.type_identifier1()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_NewAliases.type_identifier1()._d() && - (EK_COMPLETE == type_ids_NewAliases.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_NewAliases.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_NewAliases.type_identifier1()._d() && - (EK_COMPLETE == type_ids_NewAliases.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_NewAliases.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_uint32_ = TypeObjectUtils::build_common_struct_member(member_id_uint32_, member_flags_uint32_, type_ids_NewAliases.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_NewAliases.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_NewAliases.type_identifier2()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_NewAliases.type_identifier2()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_NewAliases.type_identifier2()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_NewAliases.type_identifier2()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_NewAliases.type_identifier2()._d() && - (EK_COMPLETE == type_ids_NewAliases.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_NewAliases.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_NewAliases.type_identifier2()._d() && - (EK_COMPLETE == type_ids_NewAliases.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_NewAliases.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_uint32_ = TypeObjectUtils::build_common_struct_member(member_id_uint32_, member_flags_uint32_, type_ids_NewAliases.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure uint32_ member TypeIdentifier inconsistent."); - return; - } - MemberName name_uint32_ = "uint32_"; - eprosima::fastcdr::optional member_ann_builtin_uint32_; - ann_custom_NewAliases.reset(); - CompleteMemberDetail detail_uint32_ = TypeObjectUtils::build_complete_member_detail(name_uint32_, member_ann_builtin_uint32_, ann_custom_NewAliases); - CompleteStructMember member_uint32_ = TypeObjectUtils::build_complete_struct_member(common_uint32_, detail_uint32_); - TypeObjectUtils::add_complete_struct_member(member_seq_NewAliases, member_uint32_); - } - { - return_code_NewAliases = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int64_t", type_ids_NewAliases); - - if (return_code_NewAliases != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "int64_ Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_int64_ = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_int64_; - MemberId member_id_int64_ = 0x00000006; - if (EK_COMPLETE == type_ids_NewAliases.type_identifier1()._d() || TK_NONE == type_ids_NewAliases.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_NewAliases.type_identifier1()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_NewAliases.type_identifier1()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_NewAliases.type_identifier1()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_NewAliases.type_identifier1()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_NewAliases.type_identifier1()._d() && - (EK_COMPLETE == type_ids_NewAliases.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_NewAliases.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_NewAliases.type_identifier1()._d() && - (EK_COMPLETE == type_ids_NewAliases.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_NewAliases.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_int64_ = TypeObjectUtils::build_common_struct_member(member_id_int64_, member_flags_int64_, type_ids_NewAliases.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_NewAliases.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_NewAliases.type_identifier2()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_NewAliases.type_identifier2()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_NewAliases.type_identifier2()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_NewAliases.type_identifier2()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_NewAliases.type_identifier2()._d() && - (EK_COMPLETE == type_ids_NewAliases.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_NewAliases.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_NewAliases.type_identifier2()._d() && - (EK_COMPLETE == type_ids_NewAliases.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_NewAliases.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_int64_ = TypeObjectUtils::build_common_struct_member(member_id_int64_, member_flags_int64_, type_ids_NewAliases.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure int64_ member TypeIdentifier inconsistent."); - return; - } - MemberName name_int64_ = "int64_"; - eprosima::fastcdr::optional member_ann_builtin_int64_; - ann_custom_NewAliases.reset(); - CompleteMemberDetail detail_int64_ = TypeObjectUtils::build_complete_member_detail(name_int64_, member_ann_builtin_int64_, ann_custom_NewAliases); - CompleteStructMember member_int64_ = TypeObjectUtils::build_complete_struct_member(common_int64_, detail_int64_); - TypeObjectUtils::add_complete_struct_member(member_seq_NewAliases, member_int64_); - } - { - return_code_NewAliases = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_uint64_t", type_ids_NewAliases); - - if (return_code_NewAliases != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "uint64_ Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_uint64_ = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_uint64_; - MemberId member_id_uint64_ = 0x00000007; - if (EK_COMPLETE == type_ids_NewAliases.type_identifier1()._d() || TK_NONE == type_ids_NewAliases.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_NewAliases.type_identifier1()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_NewAliases.type_identifier1()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_NewAliases.type_identifier1()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_NewAliases.type_identifier1()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_NewAliases.type_identifier1()._d() && - (EK_COMPLETE == type_ids_NewAliases.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_NewAliases.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_NewAliases.type_identifier1()._d() && - (EK_COMPLETE == type_ids_NewAliases.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_NewAliases.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_uint64_ = TypeObjectUtils::build_common_struct_member(member_id_uint64_, member_flags_uint64_, type_ids_NewAliases.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_NewAliases.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_NewAliases.type_identifier2()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_NewAliases.type_identifier2()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_NewAliases.type_identifier2()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_NewAliases.type_identifier2()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_NewAliases.type_identifier2()._d() && - (EK_COMPLETE == type_ids_NewAliases.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_NewAliases.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_NewAliases.type_identifier2()._d() && - (EK_COMPLETE == type_ids_NewAliases.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_NewAliases.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_uint64_ = TypeObjectUtils::build_common_struct_member(member_id_uint64_, member_flags_uint64_, type_ids_NewAliases.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure uint64_ member TypeIdentifier inconsistent."); - return; - } - MemberName name_uint64_ = "uint64_"; - eprosima::fastcdr::optional member_ann_builtin_uint64_; - ann_custom_NewAliases.reset(); - AppliedAnnotationSeq tmp_ann_custom_uint64_; - eprosima::fastcdr::optional unit_uint64_; - eprosima::fastcdr::optional min_uint64_; - eprosima::fastcdr::optional max_uint64_; - eprosima::fastcdr::optional hash_id_uint64_; - if (unit_uint64_.has_value() || min_uint64_.has_value() || max_uint64_.has_value() || hash_id_uint64_.has_value()) - { - member_ann_builtin_uint64_ = TypeObjectUtils::build_applied_builtin_member_annotations(unit_uint64_, min_uint64_, max_uint64_, hash_id_uint64_); - } - if (!tmp_ann_custom_uint64_.empty()) - { - ann_custom_NewAliases = tmp_ann_custom_uint64_; - } - CompleteMemberDetail detail_uint64_ = TypeObjectUtils::build_complete_member_detail(name_uint64_, member_ann_builtin_uint64_, ann_custom_NewAliases); - CompleteStructMember member_uint64_ = TypeObjectUtils::build_complete_struct_member(common_uint64_, detail_uint64_); - TypeObjectUtils::add_complete_struct_member(member_seq_NewAliases, member_uint64_); - } - { - return_code_NewAliases = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_string_unbounded", type_ids_NewAliases); - - if (return_code_NewAliases != 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_NewAliases = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_string_unbounded", type_ids_NewAliases); - if (return_code_NewAliases != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_string_unbounded: Given String TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_local_string = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_local_string; - MemberId member_id_local_string = 0x00000008; - if (EK_COMPLETE == type_ids_NewAliases.type_identifier1()._d() || TK_NONE == type_ids_NewAliases.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_NewAliases.type_identifier1()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_NewAliases.type_identifier1()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_NewAliases.type_identifier1()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_NewAliases.type_identifier1()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_NewAliases.type_identifier1()._d() && - (EK_COMPLETE == type_ids_NewAliases.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_NewAliases.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_NewAliases.type_identifier1()._d() && - (EK_COMPLETE == type_ids_NewAliases.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_NewAliases.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_local_string = TypeObjectUtils::build_common_struct_member(member_id_local_string, member_flags_local_string, type_ids_NewAliases.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_NewAliases.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_NewAliases.type_identifier2()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_NewAliases.type_identifier2()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_NewAliases.type_identifier2()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_NewAliases.type_identifier2()._d() && - EK_COMPLETE == type_ids_NewAliases.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_NewAliases.type_identifier2()._d() && - (EK_COMPLETE == type_ids_NewAliases.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_NewAliases.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_NewAliases.type_identifier2()._d() && - (EK_COMPLETE == type_ids_NewAliases.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_NewAliases.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_local_string = TypeObjectUtils::build_common_struct_member(member_id_local_string, member_flags_local_string, type_ids_NewAliases.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure local_string member TypeIdentifier inconsistent."); - return; - } - MemberName name_local_string = "local_string"; - eprosima::fastcdr::optional member_ann_builtin_local_string; - ann_custom_NewAliases.reset(); - AppliedAnnotationSeq tmp_ann_custom_local_string; - eprosima::fastcdr::optional unit_local_string; - eprosima::fastcdr::optional min_local_string; - eprosima::fastcdr::optional max_local_string; - eprosima::fastcdr::optional hash_id_local_string; - if (unit_local_string.has_value() || min_local_string.has_value() || max_local_string.has_value() || hash_id_local_string.has_value()) - { - member_ann_builtin_local_string = TypeObjectUtils::build_applied_builtin_member_annotations(unit_local_string, min_local_string, max_local_string, hash_id_local_string); - } - if (!tmp_ann_custom_local_string.empty()) - { - ann_custom_NewAliases = tmp_ann_custom_local_string; - } - CompleteMemberDetail detail_local_string = TypeObjectUtils::build_complete_member_detail(name_local_string, member_ann_builtin_local_string, ann_custom_NewAliases); - CompleteStructMember member_local_string = TypeObjectUtils::build_complete_struct_member(common_local_string, detail_local_string); - TypeObjectUtils::add_complete_struct_member(member_seq_NewAliases, member_local_string); - } - CompleteStructType struct_type_NewAliases = TypeObjectUtils::build_complete_struct_type(struct_flags_NewAliases, header_NewAliases, member_seq_NewAliases); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_NewAliases, type_name_NewAliases.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "NewAliases already registered in TypeObjectRegistry for a different type."); - } - return_code_NewAliases = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "NewAliases", type_ids_NewAliases); - if (return_code_NewAliases != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "NewAliases: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - } - QualifiedTypeName type_name_StructTest = "StructTest"; - eprosima::fastcdr::optional type_ann_builtin_StructTest; - eprosima::fastcdr::optional ann_custom_StructTest; - CompleteTypeDetail detail_StructTest = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_StructTest, ann_custom_StructTest, type_name_StructTest.to_string()); - CompleteStructHeader header_StructTest; - if (EK_COMPLETE == type_ids_StructTest.type_identifier1()._d()) - { - header_StructTest = TypeObjectUtils::build_complete_struct_header(type_ids_StructTest.type_identifier1(), detail_StructTest); - } - else if (EK_COMPLETE == type_ids_StructTest.type_identifier2()._d()) - { - header_StructTest = TypeObjectUtils::build_complete_struct_header(type_ids_StructTest.type_identifier2(), detail_StructTest); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "StructTest Structure: base_type TypeIdentifier registered in TypeObjectRegistry is inconsistent."); - return; - } - CompleteStructMemberSeq member_seq_StructTest; - { - return_code_StructTest = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "OctetUnion", type_ids_StructTest); - - if (return_code_StructTest != eprosima::fastdds::dds::RETCODE_OK) - { - { - ReturnCode_t return_code_OctetUnion; - TypeIdentifierPair type_ids_OctetUnion; - UnionTypeFlag union_flags_OctetUnion = TypeObjectUtils::build_union_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - QualifiedTypeName type_name_OctetUnion = "OctetUnion"; - eprosima::fastcdr::optional type_ann_builtin_OctetUnion; - eprosima::fastcdr::optional ann_custom_OctetUnion; - CompleteTypeDetail detail_OctetUnion = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_OctetUnion, ann_custom_OctetUnion, type_name_OctetUnion.to_string()); - CompleteUnionHeader header_OctetUnion = TypeObjectUtils::build_complete_union_header(detail_OctetUnion); - UnionDiscriminatorFlag member_flags_OctetUnion = TypeObjectUtils::build_union_discriminator_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false); - return_code_OctetUnion = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_byte", type_ids_OctetUnion); - - if (return_code_OctetUnion != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Union discriminator TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - CommonDiscriminatorMember common_OctetUnion; - if (EK_COMPLETE == type_ids_OctetUnion.type_identifier1()._d() || TK_NONE == type_ids_OctetUnion.type_identifier2()._d()) - { - common_OctetUnion = TypeObjectUtils::build_common_discriminator_member(member_flags_OctetUnion, type_ids_OctetUnion.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_OctetUnion.type_identifier2()._d()) - { - common_OctetUnion = TypeObjectUtils::build_common_discriminator_member(member_flags_OctetUnion, type_ids_OctetUnion.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "OctetUnion discriminator TypeIdentifier inconsistent."); - return; - } - type_ann_builtin_OctetUnion.reset(); - ann_custom_OctetUnion.reset(); - CompleteDiscriminatorMember discriminator_OctetUnion = TypeObjectUtils::build_complete_discriminator_member(common_OctetUnion, - type_ann_builtin_OctetUnion, ann_custom_OctetUnion); - CompleteUnionMemberSeq member_seq_OctetUnion; - { - return_code_OctetUnion = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_OctetUnion); - - if (return_code_OctetUnion != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "case_five Union member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - UnionMemberFlag member_flags_case_five = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false); - UnionCaseLabelSeq label_seq_case_five; - TypeObjectUtils::add_union_case_label(label_seq_case_five, static_cast(5)); - CommonUnionMember common_case_five; - MemberId member_id_case_five = 0x00000001; - if (EK_COMPLETE == type_ids_OctetUnion.type_identifier1()._d() || TK_NONE == type_ids_OctetUnion.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_OctetUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_OctetUnion.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_OctetUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_OctetUnion.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_OctetUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_OctetUnion.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_OctetUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_OctetUnion.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_OctetUnion.type_identifier1()._d() && - (EK_COMPLETE == type_ids_OctetUnion.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_OctetUnion.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_OctetUnion.type_identifier1()._d() && - (EK_COMPLETE == type_ids_OctetUnion.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_OctetUnion.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_case_five = TypeObjectUtils::build_common_union_member(member_id_case_five, member_flags_case_five, type_ids_OctetUnion.type_identifier1(), - label_seq_case_five); - } - else if (EK_COMPLETE == type_ids_OctetUnion.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_OctetUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_OctetUnion.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_OctetUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_OctetUnion.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_OctetUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_OctetUnion.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_OctetUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_OctetUnion.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_OctetUnion.type_identifier2()._d() && - (EK_COMPLETE == type_ids_OctetUnion.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_OctetUnion.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_OctetUnion.type_identifier2()._d() && - (EK_COMPLETE == type_ids_OctetUnion.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_OctetUnion.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_case_five = TypeObjectUtils::build_common_union_member(member_id_case_five, member_flags_case_five, type_ids_OctetUnion.type_identifier2(), - label_seq_case_five); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Union case_five member TypeIdentifier inconsistent."); - return; - } - MemberName name_case_five = "case_five"; - eprosima::fastcdr::optional member_ann_builtin_case_five; - ann_custom_OctetUnion.reset(); - CompleteMemberDetail detail_case_five = TypeObjectUtils::build_complete_member_detail(name_case_five, member_ann_builtin_case_five, ann_custom_OctetUnion); - CompleteUnionMember member_case_five = TypeObjectUtils::build_complete_union_member(common_case_five, detail_case_five); - TypeObjectUtils::add_complete_union_member(member_seq_OctetUnion, member_case_five); - } - { - return_code_OctetUnion = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_OctetUnion); - - if (return_code_OctetUnion != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "case_seven Union member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - UnionMemberFlag member_flags_case_seven = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false); - UnionCaseLabelSeq label_seq_case_seven; - TypeObjectUtils::add_union_case_label(label_seq_case_seven, static_cast(7)); - CommonUnionMember common_case_seven; - MemberId member_id_case_seven = 0x00000002; - if (EK_COMPLETE == type_ids_OctetUnion.type_identifier1()._d() || TK_NONE == type_ids_OctetUnion.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_OctetUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_OctetUnion.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_OctetUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_OctetUnion.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_OctetUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_OctetUnion.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_OctetUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_OctetUnion.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_OctetUnion.type_identifier1()._d() && - (EK_COMPLETE == type_ids_OctetUnion.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_OctetUnion.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_OctetUnion.type_identifier1()._d() && - (EK_COMPLETE == type_ids_OctetUnion.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_OctetUnion.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_case_seven = TypeObjectUtils::build_common_union_member(member_id_case_seven, member_flags_case_seven, type_ids_OctetUnion.type_identifier1(), - label_seq_case_seven); - } - else if (EK_COMPLETE == type_ids_OctetUnion.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_OctetUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_OctetUnion.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_OctetUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_OctetUnion.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_OctetUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_OctetUnion.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_OctetUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_OctetUnion.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_OctetUnion.type_identifier2()._d() && - (EK_COMPLETE == type_ids_OctetUnion.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_OctetUnion.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_OctetUnion.type_identifier2()._d() && - (EK_COMPLETE == type_ids_OctetUnion.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_OctetUnion.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_case_seven = TypeObjectUtils::build_common_union_member(member_id_case_seven, member_flags_case_seven, type_ids_OctetUnion.type_identifier2(), - label_seq_case_seven); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Union case_seven member TypeIdentifier inconsistent."); - return; - } - MemberName name_case_seven = "case_seven"; - eprosima::fastcdr::optional member_ann_builtin_case_seven; - ann_custom_OctetUnion.reset(); - CompleteMemberDetail detail_case_seven = TypeObjectUtils::build_complete_member_detail(name_case_seven, member_ann_builtin_case_seven, ann_custom_OctetUnion); - CompleteUnionMember member_case_seven = TypeObjectUtils::build_complete_union_member(common_case_seven, detail_case_seven); - TypeObjectUtils::add_complete_union_member(member_seq_OctetUnion, member_case_seven); - } - CompleteUnionType union_type_OctetUnion = TypeObjectUtils::build_complete_union_type(union_flags_OctetUnion, header_OctetUnion, discriminator_OctetUnion, - member_seq_OctetUnion); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_union_type_object(union_type_OctetUnion, type_name_OctetUnion.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "OctetUnion already registered in TypeObjectRegistry for a different type."); - } - return_code_OctetUnion = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "OctetUnion", type_ids_OctetUnion); - if (return_code_OctetUnion != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "OctetUnion: Given Union TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - } - StructMemberFlag member_flags_octetUnion = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_octetUnion; - MemberId member_id_octetUnion = 0x00000009; - if (EK_COMPLETE == type_ids_StructTest.type_identifier1()._d() || TK_NONE == type_ids_StructTest.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructTest.type_identifier1()._d() && - EK_COMPLETE == type_ids_StructTest.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructTest.type_identifier1()._d() && - EK_COMPLETE == type_ids_StructTest.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_StructTest.type_identifier1()._d() && - EK_COMPLETE == type_ids_StructTest.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_StructTest.type_identifier1()._d() && - EK_COMPLETE == type_ids_StructTest.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_StructTest.type_identifier1()._d() && - (EK_COMPLETE == type_ids_StructTest.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_StructTest.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_StructTest.type_identifier1()._d() && - (EK_COMPLETE == type_ids_StructTest.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_StructTest.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_octetUnion = TypeObjectUtils::build_common_struct_member(member_id_octetUnion, member_flags_octetUnion, type_ids_StructTest.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_StructTest.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructTest.type_identifier2()._d() && - EK_COMPLETE == type_ids_StructTest.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructTest.type_identifier2()._d() && - EK_COMPLETE == type_ids_StructTest.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_StructTest.type_identifier2()._d() && - EK_COMPLETE == type_ids_StructTest.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_StructTest.type_identifier2()._d() && - EK_COMPLETE == type_ids_StructTest.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_StructTest.type_identifier2()._d() && - (EK_COMPLETE == type_ids_StructTest.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_StructTest.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_StructTest.type_identifier2()._d() && - (EK_COMPLETE == type_ids_StructTest.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_StructTest.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_octetUnion = TypeObjectUtils::build_common_struct_member(member_id_octetUnion, member_flags_octetUnion, type_ids_StructTest.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure octetUnion member TypeIdentifier inconsistent."); - return; - } - MemberName name_octetUnion = "octetUnion"; - eprosima::fastcdr::optional member_ann_builtin_octetUnion; - ann_custom_StructTest.reset(); - CompleteMemberDetail detail_octetUnion = TypeObjectUtils::build_complete_member_detail(name_octetUnion, member_ann_builtin_octetUnion, ann_custom_StructTest); - CompleteStructMember member_octetUnion = TypeObjectUtils::build_complete_struct_member(common_octetUnion, detail_octetUnion); - TypeObjectUtils::add_complete_struct_member(member_seq_StructTest, member_octetUnion); - } - { - return_code_StructTest = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "Int8Union", type_ids_StructTest); - - if (return_code_StructTest != eprosima::fastdds::dds::RETCODE_OK) - { - { - ReturnCode_t return_code_Int8Union; - TypeIdentifierPair type_ids_Int8Union; - UnionTypeFlag union_flags_Int8Union = TypeObjectUtils::build_union_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - QualifiedTypeName type_name_Int8Union = "Int8Union"; - eprosima::fastcdr::optional type_ann_builtin_Int8Union; - eprosima::fastcdr::optional ann_custom_Int8Union; - CompleteTypeDetail detail_Int8Union = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_Int8Union, ann_custom_Int8Union, type_name_Int8Union.to_string()); - CompleteUnionHeader header_Int8Union = TypeObjectUtils::build_complete_union_header(detail_Int8Union); - UnionDiscriminatorFlag member_flags_Int8Union = TypeObjectUtils::build_union_discriminator_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false); - return_code_Int8Union = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int8_t", type_ids_Int8Union); - - if (return_code_Int8Union != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Union discriminator TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - CommonDiscriminatorMember common_Int8Union; - if (EK_COMPLETE == type_ids_Int8Union.type_identifier1()._d() || TK_NONE == type_ids_Int8Union.type_identifier2()._d()) - { - common_Int8Union = TypeObjectUtils::build_common_discriminator_member(member_flags_Int8Union, type_ids_Int8Union.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_Int8Union.type_identifier2()._d()) - { - common_Int8Union = TypeObjectUtils::build_common_discriminator_member(member_flags_Int8Union, type_ids_Int8Union.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Int8Union discriminator TypeIdentifier inconsistent."); - return; - } - type_ann_builtin_Int8Union.reset(); - ann_custom_Int8Union.reset(); - CompleteDiscriminatorMember discriminator_Int8Union = TypeObjectUtils::build_complete_discriminator_member(common_Int8Union, - type_ann_builtin_Int8Union, ann_custom_Int8Union); - CompleteUnionMemberSeq member_seq_Int8Union; - { - return_code_Int8Union = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_Int8Union); - - if (return_code_Int8Union != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "case_three Union member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - UnionMemberFlag member_flags_case_three = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false); - UnionCaseLabelSeq label_seq_case_three; - TypeObjectUtils::add_union_case_label(label_seq_case_three, static_cast(3)); - CommonUnionMember common_case_three; - MemberId member_id_case_three = 0x00000001; - if (EK_COMPLETE == type_ids_Int8Union.type_identifier1()._d() || TK_NONE == type_ids_Int8Union.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_Int8Union.type_identifier1()._d() && - EK_COMPLETE == type_ids_Int8Union.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_Int8Union.type_identifier1()._d() && - EK_COMPLETE == type_ids_Int8Union.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_Int8Union.type_identifier1()._d() && - EK_COMPLETE == type_ids_Int8Union.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_Int8Union.type_identifier1()._d() && - EK_COMPLETE == type_ids_Int8Union.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_Int8Union.type_identifier1()._d() && - (EK_COMPLETE == type_ids_Int8Union.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_Int8Union.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_Int8Union.type_identifier1()._d() && - (EK_COMPLETE == type_ids_Int8Union.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_Int8Union.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_case_three = TypeObjectUtils::build_common_union_member(member_id_case_three, member_flags_case_three, type_ids_Int8Union.type_identifier1(), - label_seq_case_three); - } - else if (EK_COMPLETE == type_ids_Int8Union.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_Int8Union.type_identifier2()._d() && - EK_COMPLETE == type_ids_Int8Union.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_Int8Union.type_identifier2()._d() && - EK_COMPLETE == type_ids_Int8Union.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_Int8Union.type_identifier2()._d() && - EK_COMPLETE == type_ids_Int8Union.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_Int8Union.type_identifier2()._d() && - EK_COMPLETE == type_ids_Int8Union.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_Int8Union.type_identifier2()._d() && - (EK_COMPLETE == type_ids_Int8Union.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_Int8Union.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_Int8Union.type_identifier2()._d() && - (EK_COMPLETE == type_ids_Int8Union.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_Int8Union.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_case_three = TypeObjectUtils::build_common_union_member(member_id_case_three, member_flags_case_three, type_ids_Int8Union.type_identifier2(), - label_seq_case_three); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Union case_three member TypeIdentifier inconsistent."); - return; - } - MemberName name_case_three = "case_three"; - eprosima::fastcdr::optional member_ann_builtin_case_three; - ann_custom_Int8Union.reset(); - CompleteMemberDetail detail_case_three = TypeObjectUtils::build_complete_member_detail(name_case_three, member_ann_builtin_case_three, ann_custom_Int8Union); - CompleteUnionMember member_case_three = TypeObjectUtils::build_complete_union_member(common_case_three, detail_case_three); - TypeObjectUtils::add_complete_union_member(member_seq_Int8Union, member_case_three); - } - { - return_code_Int8Union = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_Int8Union); - - if (return_code_Int8Union != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "case_six Union member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - UnionMemberFlag member_flags_case_six = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false); - UnionCaseLabelSeq label_seq_case_six; - TypeObjectUtils::add_union_case_label(label_seq_case_six, static_cast(6)); - CommonUnionMember common_case_six; - MemberId member_id_case_six = 0x00000002; - if (EK_COMPLETE == type_ids_Int8Union.type_identifier1()._d() || TK_NONE == type_ids_Int8Union.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_Int8Union.type_identifier1()._d() && - EK_COMPLETE == type_ids_Int8Union.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_Int8Union.type_identifier1()._d() && - EK_COMPLETE == type_ids_Int8Union.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_Int8Union.type_identifier1()._d() && - EK_COMPLETE == type_ids_Int8Union.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_Int8Union.type_identifier1()._d() && - EK_COMPLETE == type_ids_Int8Union.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_Int8Union.type_identifier1()._d() && - (EK_COMPLETE == type_ids_Int8Union.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_Int8Union.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_Int8Union.type_identifier1()._d() && - (EK_COMPLETE == type_ids_Int8Union.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_Int8Union.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_case_six = TypeObjectUtils::build_common_union_member(member_id_case_six, member_flags_case_six, type_ids_Int8Union.type_identifier1(), - label_seq_case_six); - } - else if (EK_COMPLETE == type_ids_Int8Union.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_Int8Union.type_identifier2()._d() && - EK_COMPLETE == type_ids_Int8Union.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_Int8Union.type_identifier2()._d() && - EK_COMPLETE == type_ids_Int8Union.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_Int8Union.type_identifier2()._d() && - EK_COMPLETE == type_ids_Int8Union.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_Int8Union.type_identifier2()._d() && - EK_COMPLETE == type_ids_Int8Union.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_Int8Union.type_identifier2()._d() && - (EK_COMPLETE == type_ids_Int8Union.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_Int8Union.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_Int8Union.type_identifier2()._d() && - (EK_COMPLETE == type_ids_Int8Union.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_Int8Union.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_case_six = TypeObjectUtils::build_common_union_member(member_id_case_six, member_flags_case_six, type_ids_Int8Union.type_identifier2(), - label_seq_case_six); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Union case_six member TypeIdentifier inconsistent."); - return; - } - MemberName name_case_six = "case_six"; - eprosima::fastcdr::optional member_ann_builtin_case_six; - ann_custom_Int8Union.reset(); - CompleteMemberDetail detail_case_six = TypeObjectUtils::build_complete_member_detail(name_case_six, member_ann_builtin_case_six, ann_custom_Int8Union); - CompleteUnionMember member_case_six = TypeObjectUtils::build_complete_union_member(common_case_six, detail_case_six); - TypeObjectUtils::add_complete_union_member(member_seq_Int8Union, member_case_six); - } - CompleteUnionType union_type_Int8Union = TypeObjectUtils::build_complete_union_type(union_flags_Int8Union, header_Int8Union, discriminator_Int8Union, - member_seq_Int8Union); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_union_type_object(union_type_Int8Union, type_name_Int8Union.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Int8Union already registered in TypeObjectRegistry for a different type."); - } - return_code_Int8Union = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "Int8Union", type_ids_Int8Union); - if (return_code_Int8Union != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Int8Union: Given Union TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - } - StructMemberFlag member_flags_int8Union = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_int8Union; - MemberId member_id_int8Union = 0x0000000a; - if (EK_COMPLETE == type_ids_StructTest.type_identifier1()._d() || TK_NONE == type_ids_StructTest.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructTest.type_identifier1()._d() && - EK_COMPLETE == type_ids_StructTest.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructTest.type_identifier1()._d() && - EK_COMPLETE == type_ids_StructTest.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_StructTest.type_identifier1()._d() && - EK_COMPLETE == type_ids_StructTest.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_StructTest.type_identifier1()._d() && - EK_COMPLETE == type_ids_StructTest.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_StructTest.type_identifier1()._d() && - (EK_COMPLETE == type_ids_StructTest.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_StructTest.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_StructTest.type_identifier1()._d() && - (EK_COMPLETE == type_ids_StructTest.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_StructTest.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_int8Union = TypeObjectUtils::build_common_struct_member(member_id_int8Union, member_flags_int8Union, type_ids_StructTest.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_StructTest.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructTest.type_identifier2()._d() && - EK_COMPLETE == type_ids_StructTest.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructTest.type_identifier2()._d() && - EK_COMPLETE == type_ids_StructTest.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_StructTest.type_identifier2()._d() && - EK_COMPLETE == type_ids_StructTest.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_StructTest.type_identifier2()._d() && - EK_COMPLETE == type_ids_StructTest.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_StructTest.type_identifier2()._d() && - (EK_COMPLETE == type_ids_StructTest.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_StructTest.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_StructTest.type_identifier2()._d() && - (EK_COMPLETE == type_ids_StructTest.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_StructTest.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_int8Union = TypeObjectUtils::build_common_struct_member(member_id_int8Union, member_flags_int8Union, type_ids_StructTest.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure int8Union member TypeIdentifier inconsistent."); - return; - } - MemberName name_int8Union = "int8Union"; - eprosima::fastcdr::optional member_ann_builtin_int8Union; - ann_custom_StructTest.reset(); - CompleteMemberDetail detail_int8Union = TypeObjectUtils::build_complete_member_detail(name_int8Union, member_ann_builtin_int8Union, ann_custom_StructTest); - CompleteStructMember member_int8Union = TypeObjectUtils::build_complete_struct_member(common_int8Union, detail_int8Union); - TypeObjectUtils::add_complete_struct_member(member_seq_StructTest, member_int8Union); - } - { - return_code_StructTest = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "bitmodule::BM2", type_ids_StructTest); - - if (return_code_StructTest != eprosima::fastdds::dds::RETCODE_OK) - { - { - StructTypeFlag struct_flags_BM2 = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_BM2; - TypeIdentifierPair type_ids_BM2; - return_code_BM2 = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "bitmodule::BitsetBitmask", type_ids_BM2); - - if (return_code_BM2 != eprosima::fastdds::dds::RETCODE_OK) - { - { - StructTypeFlag struct_flags_BitsetBitmask = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_BitsetBitmask; - TypeIdentifierPair type_ids_BitsetBitmask; - QualifiedTypeName type_name_BitsetBitmask = "bitmodule::BitsetBitmask"; - eprosima::fastcdr::optional type_ann_builtin_BitsetBitmask; - eprosima::fastcdr::optional ann_custom_BitsetBitmask; - CompleteTypeDetail detail_BitsetBitmask = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_BitsetBitmask, ann_custom_BitsetBitmask, type_name_BitsetBitmask.to_string()); - CompleteStructHeader header_BitsetBitmask; - header_BitsetBitmask = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_BitsetBitmask); - CompleteStructMemberSeq member_seq_BitsetBitmask; - { - return_code_BitsetBitmask = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "bitmodule::MyBitset", type_ids_BitsetBitmask); - - if (return_code_BitsetBitmask != eprosima::fastdds::dds::RETCODE_OK) - { - BitsetTypeFlag bitset_flags_MyBitset = 0; - QualifiedTypeName type_name_MyBitset = "bitmodule::MyBitset"; - eprosima::fastcdr::optional type_ann_builtin_MyBitset; - eprosima::fastcdr::optional ann_custom_MyBitset; - CompleteTypeDetail detail_MyBitset = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_MyBitset, ann_custom_MyBitset, type_name_MyBitset.to_string()); - CompleteBitsetHeader header_MyBitset = TypeObjectUtils::build_complete_bitset_header(detail_MyBitset); - CompleteBitfieldSeq field_seq_MyBitset; - { - uint16_t position_a = 0; - BitsetMemberFlag flags_a = 0; - uint8_t bitcount_a = 3; - TypeKind holder_type_a = TK_BYTE; - CommonBitfield common_a = TypeObjectUtils::build_common_bitfield(position_a, flags_a, bitcount_a, holder_type_a); - eprosima::fastcdr::optional member_ann_builtin_a; - ann_custom_MyBitset.reset(); - MemberName name_a = "a"; - CompleteMemberDetail detail_a = TypeObjectUtils::build_complete_member_detail(name_a, member_ann_builtin_a, ann_custom_MyBitset); - CompleteBitfield bitfield_a = TypeObjectUtils::build_complete_bitfield(common_a, detail_a); - TypeObjectUtils::add_complete_bitfield(field_seq_MyBitset, bitfield_a); - } - { - uint16_t position_b = 3; - BitsetMemberFlag flags_b = 0; - uint8_t bitcount_b = 1; - TypeKind holder_type_b = TK_BOOLEAN; - CommonBitfield common_b = TypeObjectUtils::build_common_bitfield(position_b, flags_b, bitcount_b, holder_type_b); - eprosima::fastcdr::optional member_ann_builtin_b; - ann_custom_MyBitset.reset(); - MemberName name_b = "b"; - CompleteMemberDetail detail_b = TypeObjectUtils::build_complete_member_detail(name_b, member_ann_builtin_b, ann_custom_MyBitset); - CompleteBitfield bitfield_b = TypeObjectUtils::build_complete_bitfield(common_b, detail_b); - TypeObjectUtils::add_complete_bitfield(field_seq_MyBitset, bitfield_b); - } - { - uint16_t position_c = 8; - BitsetMemberFlag flags_c = 0; - uint8_t bitcount_c = 10; - TypeKind holder_type_c = TK_UINT16; - CommonBitfield common_c = TypeObjectUtils::build_common_bitfield(position_c, flags_c, bitcount_c, holder_type_c); - eprosima::fastcdr::optional member_ann_builtin_c; - ann_custom_MyBitset.reset(); - MemberName name_c = "c"; - CompleteMemberDetail detail_c = TypeObjectUtils::build_complete_member_detail(name_c, member_ann_builtin_c, ann_custom_MyBitset); - CompleteBitfield bitfield_c = TypeObjectUtils::build_complete_bitfield(common_c, detail_c); - TypeObjectUtils::add_complete_bitfield(field_seq_MyBitset, bitfield_c); - } - { - uint16_t position_d = 18; - BitsetMemberFlag flags_d = 0; - uint8_t bitcount_d = 5; - TypeKind holder_type_d = TK_INT16; - CommonBitfield common_d = TypeObjectUtils::build_common_bitfield(position_d, flags_d, bitcount_d, holder_type_d); - eprosima::fastcdr::optional member_ann_builtin_d; - ann_custom_MyBitset.reset(); - MemberName name_d = "d"; - CompleteMemberDetail detail_d = TypeObjectUtils::build_complete_member_detail(name_d, member_ann_builtin_d, ann_custom_MyBitset); - CompleteBitfield bitfield_d = TypeObjectUtils::build_complete_bitfield(common_d, detail_d); - TypeObjectUtils::add_complete_bitfield(field_seq_MyBitset, bitfield_d); - } - { - uint16_t position_e = 23; - BitsetMemberFlag flags_e = 0; - uint8_t bitcount_e = 5; - TypeKind holder_type_e = TK_INT16; - CommonBitfield common_e = TypeObjectUtils::build_common_bitfield(position_e, flags_e, bitcount_e, holder_type_e); - eprosima::fastcdr::optional member_ann_builtin_e; - ann_custom_MyBitset.reset(); - MemberName name_e = "e"; - CompleteMemberDetail detail_e = TypeObjectUtils::build_complete_member_detail(name_e, member_ann_builtin_e, ann_custom_MyBitset); - CompleteBitfield bitfield_e = TypeObjectUtils::build_complete_bitfield(common_e, detail_e); - TypeObjectUtils::add_complete_bitfield(field_seq_MyBitset, bitfield_e); - } - { - uint16_t position_f = 28; - BitsetMemberFlag flags_f = 0; - uint8_t bitcount_f = 5; - TypeKind holder_type_f = TK_INT16; - CommonBitfield common_f = TypeObjectUtils::build_common_bitfield(position_f, flags_f, bitcount_f, holder_type_f); - eprosima::fastcdr::optional member_ann_builtin_f; - ann_custom_MyBitset.reset(); - MemberName name_f = "f"; - CompleteMemberDetail detail_f = TypeObjectUtils::build_complete_member_detail(name_f, member_ann_builtin_f, ann_custom_MyBitset); - CompleteBitfield bitfield_f = TypeObjectUtils::build_complete_bitfield(common_f, detail_f); - TypeObjectUtils::add_complete_bitfield(field_seq_MyBitset, bitfield_f); - } - CompleteBitsetType bitset_type_MyBitset = TypeObjectUtils::build_complete_bitset_type(bitset_flags_MyBitset, header_MyBitset, field_seq_MyBitset); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_bitset_type_object(bitset_type_MyBitset, type_name_MyBitset.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "bitmodule::MyBitset already registered in TypeObjectRegistry for a different type."); - } - return_code_BitsetBitmask = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "bitmodule::MyBitset", type_ids_BitsetBitmask); - if (return_code_BitsetBitmask != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "bitmodule::MyBitset: Given Bitset TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_mybitset = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_mybitset; - MemberId member_id_mybitset = 0x00000000; - if (EK_COMPLETE == type_ids_BitsetBitmask.type_identifier1()._d() || TK_NONE == type_ids_BitsetBitmask.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BitsetBitmask.type_identifier1()._d() && - EK_COMPLETE == type_ids_BitsetBitmask.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BitsetBitmask.type_identifier1()._d() && - EK_COMPLETE == type_ids_BitsetBitmask.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BitsetBitmask.type_identifier1()._d() && - EK_COMPLETE == type_ids_BitsetBitmask.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BitsetBitmask.type_identifier1()._d() && - EK_COMPLETE == type_ids_BitsetBitmask.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BitsetBitmask.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BitsetBitmask.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BitsetBitmask.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BitsetBitmask.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BitsetBitmask.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BitsetBitmask.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_mybitset = TypeObjectUtils::build_common_struct_member(member_id_mybitset, member_flags_mybitset, type_ids_BitsetBitmask.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BitsetBitmask.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BitsetBitmask.type_identifier2()._d() && - EK_COMPLETE == type_ids_BitsetBitmask.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BitsetBitmask.type_identifier2()._d() && - EK_COMPLETE == type_ids_BitsetBitmask.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BitsetBitmask.type_identifier2()._d() && - EK_COMPLETE == type_ids_BitsetBitmask.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BitsetBitmask.type_identifier2()._d() && - EK_COMPLETE == type_ids_BitsetBitmask.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BitsetBitmask.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BitsetBitmask.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BitsetBitmask.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BitsetBitmask.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BitsetBitmask.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BitsetBitmask.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_mybitset = TypeObjectUtils::build_common_struct_member(member_id_mybitset, member_flags_mybitset, type_ids_BitsetBitmask.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure mybitset member TypeIdentifier inconsistent."); - return; - } - MemberName name_mybitset = "mybitset"; - eprosima::fastcdr::optional member_ann_builtin_mybitset; - ann_custom_BitsetBitmask.reset(); - CompleteMemberDetail detail_mybitset = TypeObjectUtils::build_complete_member_detail(name_mybitset, member_ann_builtin_mybitset, ann_custom_BitsetBitmask); - CompleteStructMember member_mybitset = TypeObjectUtils::build_complete_struct_member(common_mybitset, detail_mybitset); - TypeObjectUtils::add_complete_struct_member(member_seq_BitsetBitmask, member_mybitset); - } - { - return_code_BitsetBitmask = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "bitmodule::MyBitMask", type_ids_BitsetBitmask); - - if (return_code_BitsetBitmask != eprosima::fastdds::dds::RETCODE_OK) - { - BitmaskTypeFlag bitmask_flags_MyBitMask = 0; - BitBound bit_bound_MyBitMask = 8; - CommonEnumeratedHeader common_MyBitMask = TypeObjectUtils::build_common_enumerated_header(bit_bound_MyBitMask, true); - QualifiedTypeName type_name_MyBitMask = "bitmodule::MyBitMask"; - eprosima::fastcdr::optional type_ann_builtin_MyBitMask; - eprosima::fastcdr::optional ann_custom_MyBitMask; - AppliedAnnotationSeq tmp_ann_custom_MyBitMask; - eprosima::fastcdr::optional verbatim_MyBitMask; - if (!tmp_ann_custom_MyBitMask.empty()) - { - ann_custom_MyBitMask = tmp_ann_custom_MyBitMask; - } - - CompleteTypeDetail detail_MyBitMask = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_MyBitMask, ann_custom_MyBitMask, type_name_MyBitMask.to_string()); - CompleteEnumeratedHeader header_MyBitMask = TypeObjectUtils::build_complete_enumerated_header(common_MyBitMask, detail_MyBitMask, true); - CompleteBitflagSeq flag_seq_MyBitMask; - { - uint16_t position_flag0 = 0; - BitflagFlag flags_flag0 = 0; - CommonBitflag common_flag0 = TypeObjectUtils::build_common_bitflag(position_flag0, flags_flag0); - eprosima::fastcdr::optional member_ann_builtin_flag0; - ann_custom_MyBitMask.reset(); - AppliedAnnotationSeq tmp_ann_custom_flag0; - if (!tmp_ann_custom_flag0.empty()) - { - ann_custom_MyBitMask = tmp_ann_custom_flag0; - } - MemberName name_flag0 = "flag0"; - CompleteMemberDetail detail_flag0 = TypeObjectUtils::build_complete_member_detail(name_flag0, member_ann_builtin_flag0, ann_custom_MyBitMask); - CompleteBitflag bitflag_flag0 = TypeObjectUtils::build_complete_bitflag(common_flag0, detail_flag0); - TypeObjectUtils::add_complete_bitflag(flag_seq_MyBitMask, bitflag_flag0); - } - { - uint16_t position_flag1 = 1; - BitflagFlag flags_flag1 = 0; - CommonBitflag common_flag1 = TypeObjectUtils::build_common_bitflag(position_flag1, flags_flag1); - eprosima::fastcdr::optional member_ann_builtin_flag1; - ann_custom_MyBitMask.reset(); - AppliedAnnotationSeq tmp_ann_custom_flag1; - if (!tmp_ann_custom_flag1.empty()) - { - ann_custom_MyBitMask = tmp_ann_custom_flag1; - } - MemberName name_flag1 = "flag1"; - CompleteMemberDetail detail_flag1 = TypeObjectUtils::build_complete_member_detail(name_flag1, member_ann_builtin_flag1, ann_custom_MyBitMask); - CompleteBitflag bitflag_flag1 = TypeObjectUtils::build_complete_bitflag(common_flag1, detail_flag1); - TypeObjectUtils::add_complete_bitflag(flag_seq_MyBitMask, bitflag_flag1); - } - { - uint16_t position_flag4 = 4; - BitflagFlag flags_flag4 = 0; - CommonBitflag common_flag4 = TypeObjectUtils::build_common_bitflag(position_flag4, flags_flag4); - eprosima::fastcdr::optional member_ann_builtin_flag4; - ann_custom_MyBitMask.reset(); - AppliedAnnotationSeq tmp_ann_custom_flag4; - if (!tmp_ann_custom_flag4.empty()) - { - ann_custom_MyBitMask = tmp_ann_custom_flag4; - } - MemberName name_flag4 = "flag4"; - CompleteMemberDetail detail_flag4 = TypeObjectUtils::build_complete_member_detail(name_flag4, member_ann_builtin_flag4, ann_custom_MyBitMask); - CompleteBitflag bitflag_flag4 = TypeObjectUtils::build_complete_bitflag(common_flag4, detail_flag4); - TypeObjectUtils::add_complete_bitflag(flag_seq_MyBitMask, bitflag_flag4); - } - { - uint16_t position_flag6 = 6; - BitflagFlag flags_flag6 = 0; - CommonBitflag common_flag6 = TypeObjectUtils::build_common_bitflag(position_flag6, flags_flag6); - eprosima::fastcdr::optional member_ann_builtin_flag6; - ann_custom_MyBitMask.reset(); - AppliedAnnotationSeq tmp_ann_custom_flag6; - if (!tmp_ann_custom_flag6.empty()) - { - ann_custom_MyBitMask = tmp_ann_custom_flag6; - } - MemberName name_flag6 = "flag6"; - CompleteMemberDetail detail_flag6 = TypeObjectUtils::build_complete_member_detail(name_flag6, member_ann_builtin_flag6, ann_custom_MyBitMask); - CompleteBitflag bitflag_flag6 = TypeObjectUtils::build_complete_bitflag(common_flag6, detail_flag6); - TypeObjectUtils::add_complete_bitflag(flag_seq_MyBitMask, bitflag_flag6); - } - { - uint16_t position_flag7 = 7; - BitflagFlag flags_flag7 = 0; - CommonBitflag common_flag7 = TypeObjectUtils::build_common_bitflag(position_flag7, flags_flag7); - eprosima::fastcdr::optional member_ann_builtin_flag7; - ann_custom_MyBitMask.reset(); - MemberName name_flag7 = "flag7"; - CompleteMemberDetail detail_flag7 = TypeObjectUtils::build_complete_member_detail(name_flag7, member_ann_builtin_flag7, ann_custom_MyBitMask); - CompleteBitflag bitflag_flag7 = TypeObjectUtils::build_complete_bitflag(common_flag7, detail_flag7); - TypeObjectUtils::add_complete_bitflag(flag_seq_MyBitMask, bitflag_flag7); - } - CompleteBitmaskType bitmask_type_MyBitMask = TypeObjectUtils::build_complete_bitmask_type(bitmask_flags_MyBitMask, header_MyBitMask, flag_seq_MyBitMask); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_bitmask_type_object(bitmask_type_MyBitMask, type_name_MyBitMask.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "bitmodule::MyBitMask already registered in TypeObjectRegistry for a different type."); - } - return_code_BitsetBitmask = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "bitmodule::MyBitMask", type_ids_BitsetBitmask); - if (return_code_BitsetBitmask != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "bitmodule::MyBitMask: Given Enum TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_mybitmask = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_mybitmask; - MemberId member_id_mybitmask = 0x00000001; - if (EK_COMPLETE == type_ids_BitsetBitmask.type_identifier1()._d() || TK_NONE == type_ids_BitsetBitmask.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BitsetBitmask.type_identifier1()._d() && - EK_COMPLETE == type_ids_BitsetBitmask.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BitsetBitmask.type_identifier1()._d() && - EK_COMPLETE == type_ids_BitsetBitmask.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BitsetBitmask.type_identifier1()._d() && - EK_COMPLETE == type_ids_BitsetBitmask.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BitsetBitmask.type_identifier1()._d() && - EK_COMPLETE == type_ids_BitsetBitmask.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BitsetBitmask.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BitsetBitmask.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BitsetBitmask.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BitsetBitmask.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BitsetBitmask.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BitsetBitmask.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_mybitmask = TypeObjectUtils::build_common_struct_member(member_id_mybitmask, member_flags_mybitmask, type_ids_BitsetBitmask.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BitsetBitmask.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BitsetBitmask.type_identifier2()._d() && - EK_COMPLETE == type_ids_BitsetBitmask.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BitsetBitmask.type_identifier2()._d() && - EK_COMPLETE == type_ids_BitsetBitmask.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BitsetBitmask.type_identifier2()._d() && - EK_COMPLETE == type_ids_BitsetBitmask.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BitsetBitmask.type_identifier2()._d() && - EK_COMPLETE == type_ids_BitsetBitmask.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BitsetBitmask.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BitsetBitmask.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BitsetBitmask.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BitsetBitmask.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BitsetBitmask.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BitsetBitmask.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_mybitmask = TypeObjectUtils::build_common_struct_member(member_id_mybitmask, member_flags_mybitmask, type_ids_BitsetBitmask.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure mybitmask member TypeIdentifier inconsistent."); - return; - } - MemberName name_mybitmask = "mybitmask"; - eprosima::fastcdr::optional member_ann_builtin_mybitmask; - ann_custom_BitsetBitmask.reset(); - CompleteMemberDetail detail_mybitmask = TypeObjectUtils::build_complete_member_detail(name_mybitmask, member_ann_builtin_mybitmask, ann_custom_BitsetBitmask); - CompleteStructMember member_mybitmask = TypeObjectUtils::build_complete_struct_member(common_mybitmask, detail_mybitmask); - TypeObjectUtils::add_complete_struct_member(member_seq_BitsetBitmask, member_mybitmask); - } - CompleteStructType struct_type_BitsetBitmask = TypeObjectUtils::build_complete_struct_type(struct_flags_BitsetBitmask, header_BitsetBitmask, member_seq_BitsetBitmask); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_BitsetBitmask, type_name_BitsetBitmask.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "bitmodule::BitsetBitmask already registered in TypeObjectRegistry for a different type."); - } - return_code_BitsetBitmask = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "bitmodule::BitsetBitmask", type_ids_BitsetBitmask); - if (return_code_BitsetBitmask != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "bitmodule::BitsetBitmask: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - } - QualifiedTypeName type_name_BM2 = "bitmodule::BM2"; - eprosima::fastcdr::optional type_ann_builtin_BM2; - eprosima::fastcdr::optional ann_custom_BM2; - CompleteTypeDetail detail_BM2 = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_BM2, ann_custom_BM2, type_name_BM2.to_string()); - CompleteStructHeader header_BM2; - if (EK_COMPLETE == type_ids_BM2.type_identifier1()._d()) - { - header_BM2 = TypeObjectUtils::build_complete_struct_header(type_ids_BM2.type_identifier1(), detail_BM2); - } - else if (EK_COMPLETE == type_ids_BM2.type_identifier2()._d()) - { - header_BM2 = TypeObjectUtils::build_complete_struct_header(type_ids_BM2.type_identifier2(), detail_BM2); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "bitmodule::BM2 Structure: base_type TypeIdentifier registered in TypeObjectRegistry is inconsistent."); - return; - } - CompleteStructMemberSeq member_seq_BM2; - { - return_code_BM2 = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "bitmodule::MyBitMask", type_ids_BM2); - - if (return_code_BM2 != eprosima::fastdds::dds::RETCODE_OK) - { - BitmaskTypeFlag bitmask_flags_MyBitMask = 0; - BitBound bit_bound_MyBitMask = 8; - CommonEnumeratedHeader common_MyBitMask = TypeObjectUtils::build_common_enumerated_header(bit_bound_MyBitMask, true); - QualifiedTypeName type_name_MyBitMask = "bitmodule::MyBitMask"; - eprosima::fastcdr::optional type_ann_builtin_MyBitMask; - eprosima::fastcdr::optional ann_custom_MyBitMask; - AppliedAnnotationSeq tmp_ann_custom_MyBitMask; - eprosima::fastcdr::optional verbatim_MyBitMask; - if (!tmp_ann_custom_MyBitMask.empty()) - { - ann_custom_MyBitMask = tmp_ann_custom_MyBitMask; - } - - CompleteTypeDetail detail_MyBitMask = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_MyBitMask, ann_custom_MyBitMask, type_name_MyBitMask.to_string()); - CompleteEnumeratedHeader header_MyBitMask = TypeObjectUtils::build_complete_enumerated_header(common_MyBitMask, detail_MyBitMask, true); - CompleteBitflagSeq flag_seq_MyBitMask; - { - uint16_t position_flag0 = 0; - BitflagFlag flags_flag0 = 0; - CommonBitflag common_flag0 = TypeObjectUtils::build_common_bitflag(position_flag0, flags_flag0); - eprosima::fastcdr::optional member_ann_builtin_flag0; - ann_custom_MyBitMask.reset(); - AppliedAnnotationSeq tmp_ann_custom_flag0; - if (!tmp_ann_custom_flag0.empty()) - { - ann_custom_MyBitMask = tmp_ann_custom_flag0; - } - MemberName name_flag0 = "flag0"; - CompleteMemberDetail detail_flag0 = TypeObjectUtils::build_complete_member_detail(name_flag0, member_ann_builtin_flag0, ann_custom_MyBitMask); - CompleteBitflag bitflag_flag0 = TypeObjectUtils::build_complete_bitflag(common_flag0, detail_flag0); - TypeObjectUtils::add_complete_bitflag(flag_seq_MyBitMask, bitflag_flag0); - } - { - uint16_t position_flag1 = 1; - BitflagFlag flags_flag1 = 0; - CommonBitflag common_flag1 = TypeObjectUtils::build_common_bitflag(position_flag1, flags_flag1); - eprosima::fastcdr::optional member_ann_builtin_flag1; - ann_custom_MyBitMask.reset(); - AppliedAnnotationSeq tmp_ann_custom_flag1; - if (!tmp_ann_custom_flag1.empty()) - { - ann_custom_MyBitMask = tmp_ann_custom_flag1; - } - MemberName name_flag1 = "flag1"; - CompleteMemberDetail detail_flag1 = TypeObjectUtils::build_complete_member_detail(name_flag1, member_ann_builtin_flag1, ann_custom_MyBitMask); - CompleteBitflag bitflag_flag1 = TypeObjectUtils::build_complete_bitflag(common_flag1, detail_flag1); - TypeObjectUtils::add_complete_bitflag(flag_seq_MyBitMask, bitflag_flag1); - } - { - uint16_t position_flag4 = 4; - BitflagFlag flags_flag4 = 0; - CommonBitflag common_flag4 = TypeObjectUtils::build_common_bitflag(position_flag4, flags_flag4); - eprosima::fastcdr::optional member_ann_builtin_flag4; - ann_custom_MyBitMask.reset(); - AppliedAnnotationSeq tmp_ann_custom_flag4; - if (!tmp_ann_custom_flag4.empty()) - { - ann_custom_MyBitMask = tmp_ann_custom_flag4; - } - MemberName name_flag4 = "flag4"; - CompleteMemberDetail detail_flag4 = TypeObjectUtils::build_complete_member_detail(name_flag4, member_ann_builtin_flag4, ann_custom_MyBitMask); - CompleteBitflag bitflag_flag4 = TypeObjectUtils::build_complete_bitflag(common_flag4, detail_flag4); - TypeObjectUtils::add_complete_bitflag(flag_seq_MyBitMask, bitflag_flag4); - } - { - uint16_t position_flag6 = 6; - BitflagFlag flags_flag6 = 0; - CommonBitflag common_flag6 = TypeObjectUtils::build_common_bitflag(position_flag6, flags_flag6); - eprosima::fastcdr::optional member_ann_builtin_flag6; - ann_custom_MyBitMask.reset(); - AppliedAnnotationSeq tmp_ann_custom_flag6; - if (!tmp_ann_custom_flag6.empty()) - { - ann_custom_MyBitMask = tmp_ann_custom_flag6; - } - MemberName name_flag6 = "flag6"; - CompleteMemberDetail detail_flag6 = TypeObjectUtils::build_complete_member_detail(name_flag6, member_ann_builtin_flag6, ann_custom_MyBitMask); - CompleteBitflag bitflag_flag6 = TypeObjectUtils::build_complete_bitflag(common_flag6, detail_flag6); - TypeObjectUtils::add_complete_bitflag(flag_seq_MyBitMask, bitflag_flag6); - } - { - uint16_t position_flag7 = 7; - BitflagFlag flags_flag7 = 0; - CommonBitflag common_flag7 = TypeObjectUtils::build_common_bitflag(position_flag7, flags_flag7); - eprosima::fastcdr::optional member_ann_builtin_flag7; - ann_custom_MyBitMask.reset(); - MemberName name_flag7 = "flag7"; - CompleteMemberDetail detail_flag7 = TypeObjectUtils::build_complete_member_detail(name_flag7, member_ann_builtin_flag7, ann_custom_MyBitMask); - CompleteBitflag bitflag_flag7 = TypeObjectUtils::build_complete_bitflag(common_flag7, detail_flag7); - TypeObjectUtils::add_complete_bitflag(flag_seq_MyBitMask, bitflag_flag7); - } - CompleteBitmaskType bitmask_type_MyBitMask = TypeObjectUtils::build_complete_bitmask_type(bitmask_flags_MyBitMask, header_MyBitMask, flag_seq_MyBitMask); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_bitmask_type_object(bitmask_type_MyBitMask, type_name_MyBitMask.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "bitmodule::MyBitMask already registered in TypeObjectRegistry for a different type."); - } - return_code_BM2 = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "bitmodule::MyBitMask", type_ids_BM2); - if (return_code_BM2 != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "bitmodule::MyBitMask: Given Enum TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_two = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_two; - MemberId member_id_two = 0x00000002; - if (EK_COMPLETE == type_ids_BM2.type_identifier1()._d() || TK_NONE == type_ids_BM2.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BM2.type_identifier1()._d() && - EK_COMPLETE == type_ids_BM2.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BM2.type_identifier1()._d() && - EK_COMPLETE == type_ids_BM2.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BM2.type_identifier1()._d() && - EK_COMPLETE == type_ids_BM2.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BM2.type_identifier1()._d() && - EK_COMPLETE == type_ids_BM2.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BM2.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BM2.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BM2.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BM2.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BM2.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BM2.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_two = TypeObjectUtils::build_common_struct_member(member_id_two, member_flags_two, type_ids_BM2.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BM2.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BM2.type_identifier2()._d() && - EK_COMPLETE == type_ids_BM2.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BM2.type_identifier2()._d() && - EK_COMPLETE == type_ids_BM2.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BM2.type_identifier2()._d() && - EK_COMPLETE == type_ids_BM2.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BM2.type_identifier2()._d() && - EK_COMPLETE == type_ids_BM2.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BM2.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BM2.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BM2.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BM2.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BM2.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BM2.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_two = TypeObjectUtils::build_common_struct_member(member_id_two, member_flags_two, type_ids_BM2.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure two member TypeIdentifier inconsistent."); - return; - } - MemberName name_two = "two"; - eprosima::fastcdr::optional member_ann_builtin_two; - ann_custom_BM2.reset(); - CompleteMemberDetail detail_two = TypeObjectUtils::build_complete_member_detail(name_two, member_ann_builtin_two, ann_custom_BM2); - CompleteStructMember member_two = TypeObjectUtils::build_complete_struct_member(common_two, detail_two); - TypeObjectUtils::add_complete_struct_member(member_seq_BM2, member_two); - } - { - return_code_BM2 = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_BM2); - - if (return_code_BM2 != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "mylong Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_mylong = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_mylong; - MemberId member_id_mylong = 0x00000003; - if (EK_COMPLETE == type_ids_BM2.type_identifier1()._d() || TK_NONE == type_ids_BM2.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BM2.type_identifier1()._d() && - EK_COMPLETE == type_ids_BM2.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BM2.type_identifier1()._d() && - EK_COMPLETE == type_ids_BM2.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BM2.type_identifier1()._d() && - EK_COMPLETE == type_ids_BM2.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BM2.type_identifier1()._d() && - EK_COMPLETE == type_ids_BM2.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BM2.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BM2.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BM2.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BM2.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BM2.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BM2.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_mylong = TypeObjectUtils::build_common_struct_member(member_id_mylong, member_flags_mylong, type_ids_BM2.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BM2.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BM2.type_identifier2()._d() && - EK_COMPLETE == type_ids_BM2.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BM2.type_identifier2()._d() && - EK_COMPLETE == type_ids_BM2.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BM2.type_identifier2()._d() && - EK_COMPLETE == type_ids_BM2.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BM2.type_identifier2()._d() && - EK_COMPLETE == type_ids_BM2.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BM2.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BM2.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BM2.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BM2.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BM2.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BM2.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_mylong = TypeObjectUtils::build_common_struct_member(member_id_mylong, member_flags_mylong, type_ids_BM2.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure mylong member TypeIdentifier inconsistent."); - return; - } - MemberName name_mylong = "mylong"; - eprosima::fastcdr::optional member_ann_builtin_mylong; - ann_custom_BM2.reset(); - CompleteMemberDetail detail_mylong = TypeObjectUtils::build_complete_member_detail(name_mylong, member_ann_builtin_mylong, ann_custom_BM2); - CompleteStructMember member_mylong = TypeObjectUtils::build_complete_struct_member(common_mylong, detail_mylong); - TypeObjectUtils::add_complete_struct_member(member_seq_BM2, member_mylong); - } - CompleteStructType struct_type_BM2 = TypeObjectUtils::build_complete_struct_type(struct_flags_BM2, header_BM2, member_seq_BM2); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_BM2, type_name_BM2.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "bitmodule::BM2 already registered in TypeObjectRegistry for a different type."); - } - return_code_BM2 = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "bitmodule::BM2", type_ids_BM2); - if (return_code_BM2 != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "bitmodule::BM2: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - } - StructMemberFlag member_flags_myStructBits = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_myStructBits; - MemberId member_id_myStructBits = 0x0000000b; - if (EK_COMPLETE == type_ids_StructTest.type_identifier1()._d() || TK_NONE == type_ids_StructTest.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructTest.type_identifier1()._d() && - EK_COMPLETE == type_ids_StructTest.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructTest.type_identifier1()._d() && - EK_COMPLETE == type_ids_StructTest.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_StructTest.type_identifier1()._d() && - EK_COMPLETE == type_ids_StructTest.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_StructTest.type_identifier1()._d() && - EK_COMPLETE == type_ids_StructTest.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_StructTest.type_identifier1()._d() && - (EK_COMPLETE == type_ids_StructTest.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_StructTest.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_StructTest.type_identifier1()._d() && - (EK_COMPLETE == type_ids_StructTest.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_StructTest.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_myStructBits = TypeObjectUtils::build_common_struct_member(member_id_myStructBits, member_flags_myStructBits, type_ids_StructTest.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_StructTest.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructTest.type_identifier2()._d() && - EK_COMPLETE == type_ids_StructTest.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructTest.type_identifier2()._d() && - EK_COMPLETE == type_ids_StructTest.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_StructTest.type_identifier2()._d() && - EK_COMPLETE == type_ids_StructTest.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_StructTest.type_identifier2()._d() && - EK_COMPLETE == type_ids_StructTest.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_StructTest.type_identifier2()._d() && - (EK_COMPLETE == type_ids_StructTest.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_StructTest.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_StructTest.type_identifier2()._d() && - (EK_COMPLETE == type_ids_StructTest.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_StructTest.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_myStructBits = TypeObjectUtils::build_common_struct_member(member_id_myStructBits, member_flags_myStructBits, type_ids_StructTest.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure myStructBits member TypeIdentifier inconsistent."); - return; - } - MemberName name_myStructBits = "myStructBits"; - eprosima::fastcdr::optional member_ann_builtin_myStructBits; - ann_custom_StructTest.reset(); - CompleteMemberDetail detail_myStructBits = TypeObjectUtils::build_complete_member_detail(name_myStructBits, member_ann_builtin_myStructBits, ann_custom_StructTest); - CompleteStructMember member_myStructBits = TypeObjectUtils::build_complete_struct_member(common_myStructBits, detail_myStructBits); - TypeObjectUtils::add_complete_struct_member(member_seq_StructTest, member_myStructBits); - } - CompleteStructType struct_type_StructTest = TypeObjectUtils::build_complete_struct_type(struct_flags_StructTest, header_StructTest, member_seq_StructTest); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_StructTest, type_name_StructTest.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "StructTest already registered in TypeObjectRegistry for a different type."); - } - return_code_StructTest = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "StructTest", type_ids_StructTest); - if (return_code_StructTest != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "StructTest: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } -} - diff --git a/test/unittest/dynamic_types/idl/new_features_4_2TypeObjectSupport.hpp b/test/unittest/dynamic_types/idl/new_features_4_2TypeObjectSupport.hpp deleted file mode 100644 index e324f8b0fe5..00000000000 --- a/test/unittest/dynamic_types/idl/new_features_4_2TypeObjectSupport.hpp +++ /dev/null @@ -1,100 +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 new_features_4_2TypeObjectSupport.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_NEW_FEATURES_4_2_TYPE_OBJECT_SUPPORT_HPP_ -#define _FAST_DDS_GENERATED_NEW_FEATURES_4_2_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_new_features_4_2_type_objects(); - -#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC - -/** - * @brief Register NewAliases 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_NewAliases_type_identifier(); -/** - * @brief Register WCharUnion 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_WCharUnion_type_identifier(); -/** - * @brief Register OctetUnion 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_OctetUnion_type_identifier(); -/** - * @brief Register Int8Union 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_Int8Union_type_identifier(); -namespace bitmodule { -/** - * @brief Register bitmodule_BitsetBitmask 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_bitmodule_BitsetBitmask_type_identifier(); - -/** - * @brief Register bitmodule_BM2 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_bitmodule_BM2_type_identifier(); - -} // namespace bitmodule -/** - * @brief Register StructTest 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_StructTest_type_identifier(); - - -#endif // DOXYGEN_SHOULD_SKIP_THIS_PUBLIC - -#endif // _FAST_DDS_GENERATED_NEW_FEATURES_4_2_TYPE_OBJECT_SUPPORT_HPP_ diff --git a/test/unittest/dynamic_types/types_profile.xml b/test/unittest/dynamic_types/types_profile.xml deleted file mode 100644 index c65fefba7ec..00000000000 --- a/test/unittest/dynamic_types/types_profile.xml +++ /dev/null @@ -1,270 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/unittest/logging/CMakeLists.txt b/test/unittest/logging/CMakeLists.txt index 1b8a0bc12b3..f9fe89f1cf0 100644 --- a/test/unittest/logging/CMakeLists.txt +++ b/test/unittest/logging/CMakeLists.txt @@ -18,11 +18,7 @@ if(WIN32) add_definitions(-D_WIN32_WINNT=0x0601) 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 +set(COMMON_SOURCE ${PROJECT_SOURCE_DIR}/src/cpp/utils/SystemInfo.cpp ) @@ -30,7 +26,7 @@ set(LOG_COMMON_SOURCE set(LOGTESTS_TEST_SOURCE LogTests.cpp) set(LOGTESTS_SOURCE - ${LOG_COMMON_SOURCE} + ${COMMON_SOURCE} ${LOGTESTS_TEST_SOURCE}) include_directories(mock/) @@ -45,7 +41,10 @@ target_compile_definitions(LogTests PRIVATE target_include_directories(LogTests PRIVATE ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include ${PROJECT_SOURCE_DIR}/src/cpp) -target_link_libraries(LogTests GTest::gtest ${MOCKS} +target_link_libraries(LogTests + fastdds::log + GTest::gtest + ${MOCKS} $<$:iphlpapi$Shlwapi> ) gtest_discover_tests(LogTests) @@ -54,9 +53,9 @@ gtest_discover_tests(LogTests) set(LOGFILETESTS_TEST_SOURCE LogFileTests.cpp) set(LOGFILETESTS_SOURCE - ${LOG_COMMON_SOURCE} - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/FileConsumer.cpp - ${LOGFILETESTS_TEST_SOURCE}) + ${COMMON_SOURCE} + ${LOGFILETESTS_TEST_SOURCE} + ) # External sources if(TINYXML2_SOURCE_DIR) @@ -82,5 +81,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 117d2a32df4..33825ba263b 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/utils/SystemInfo.cpp ) @@ -39,7 +35,10 @@ target_compile_definitions(LogMacrosAllActiveTests PRIVATE target_include_directories(LogMacrosAllActiveTests PRIVATE ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include ${PROJECT_SOURCE_DIR}/src/cpp) -target_link_libraries(LogMacrosAllActiveTests GTest::gtest ${MOCKS} +target_link_libraries(LogMacrosAllActiveTests + fastdds::log + GTest::gtest + ${MOCKS} $<$:iphlpapi$Shlwapi> ) gtest_discover_tests(LogMacrosAllActiveTests) @@ -60,7 +59,10 @@ target_compile_definitions(LogMacrosNoInfoTests PRIVATE target_include_directories(LogMacrosNoInfoTests PRIVATE ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include ${PROJECT_SOURCE_DIR}/src/cpp) -target_link_libraries(LogMacrosNoInfoTests GTest::gtest ${MOCKS} +target_link_libraries(LogMacrosNoInfoTests + fastdds::log + GTest::gtest + ${MOCKS} $<$:iphlpapi$Shlwapi> ) gtest_discover_tests(LogMacrosNoInfoTests) @@ -81,7 +83,10 @@ target_compile_definitions(LogMacrosNoWarningTests PRIVATE target_include_directories(LogMacrosNoWarningTests PRIVATE ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include ${PROJECT_SOURCE_DIR}/src/cpp) -target_link_libraries(LogMacrosNoWarningTests GTest::gtest ${MOCKS} +target_link_libraries(LogMacrosNoWarningTests + fastdds::log + GTest::gtest + ${MOCKS} $<$:iphlpapi$Shlwapi> ) gtest_discover_tests(LogMacrosNoWarningTests) @@ -102,7 +107,10 @@ target_compile_definitions(LogMacrosNoErrorTests PRIVATE target_include_directories(LogMacrosNoErrorTests PRIVATE ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include ${PROJECT_SOURCE_DIR}/src/cpp) -target_link_libraries(LogMacrosNoErrorTests GTest::gtest ${MOCKS} +target_link_libraries(LogMacrosNoErrorTests + fastdds::log + GTest::gtest + ${MOCKS} $<$:iphlpapi$Shlwapi> ) gtest_discover_tests(LogMacrosNoErrorTests) @@ -123,7 +131,10 @@ target_compile_definitions(LogMacrosDefaultTests PRIVATE target_include_directories(LogMacrosDefaultTests PRIVATE ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include ${PROJECT_SOURCE_DIR}/src/cpp) -target_link_libraries(LogMacrosDefaultTests GTest::gtest ${MOCKS} +target_link_libraries(LogMacrosDefaultTests + fastdds::log + GTest::gtest + ${MOCKS} $<$:iphlpapi$Shlwapi> ) gtest_discover_tests(LogMacrosDefaultTests) @@ -146,7 +157,10 @@ target_compile_definitions(LogMacrosInternalDebugOffTests PRIVATE target_include_directories(LogMacrosInternalDebugOffTests PRIVATE ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include ${PROJECT_SOURCE_DIR}/src/cpp) -target_link_libraries(LogMacrosInternalDebugOffTests GTest::gtest ${MOCKS} +target_link_libraries(LogMacrosInternalDebugOffTests + fastdds::log + GTest::gtest + ${MOCKS} $<$:iphlpapi$Shlwapi> ) gtest_discover_tests(LogMacrosInternalDebugOffTests) @@ -166,7 +180,10 @@ target_compile_definitions(OldLogMacrosTests PRIVATE target_include_directories(OldLogMacrosTests PRIVATE ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include ${PROJECT_SOURCE_DIR}/src/cpp) -target_link_libraries(OldLogMacrosTests GTest::gtest ${MOCKS} +target_link_libraries(OldLogMacrosTests + fastdds::log + GTest::gtest + ${MOCKS} $<$:iphlpapi$Shlwapi> ) gtest_discover_tests(OldLogMacrosTests) @@ -187,7 +204,10 @@ target_compile_definitions(OldLogMacrosDisableTests PRIVATE target_include_directories(OldLogMacrosDisableTests PRIVATE ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include ${PROJECT_SOURCE_DIR}/src/cpp) -target_link_libraries(OldLogMacrosDisableTests GTest::gtest ${MOCKS} +target_link_libraries(OldLogMacrosDisableTests + 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 dd3918722ef..6f72b73bc21 100644 --- a/test/unittest/rtps/builtin/CMakeLists.txt +++ b/test/unittest/rtps/builtin/CMakeLists.txt @@ -13,24 +13,7 @@ # 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/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/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 @@ -79,7 +62,9 @@ target_include_directories(BuiltinDataSerializationTests PRIVATE ${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 4589c1d7883..4cb0965183f 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/utils/IPFinder.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPLocator.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/md5.cpp @@ -39,10 +35,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/utils/SystemInfo.cpp) set(TIMETESTS_SOURCE TimeTests.cpp @@ -72,7 +64,10 @@ target_include_directories(GuidUtilsTests PRIVATE ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include ${Asio_INCLUDE_DIR} $<$:${ANDROID_IFADDRS_INCLUDE_DIR}>) -target_link_libraries(GuidUtilsTests GTest::gtest) +target_link_libraries(GuidUtilsTests + GTest::gtest + fastdds::log + ) if(QNX) target_link_libraries(GuidUtilsTests socket) endif() @@ -99,7 +94,10 @@ target_compile_definitions(PortParametersTests PRIVATE target_include_directories(PortParametersTests PRIVATE ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include ${PROJECT_SOURCE_DIR}/src/cpp) -target_link_libraries(PortParametersTests GTest::gtest) +target_link_libraries(PortParametersTests + GTest::gtest + fastdds::log + ) gtest_discover_tests(PortParametersTests PROPERTIES LABELS "NoMemoryCheck") ################### diff --git a/test/unittest/rtps/discovery/CMakeLists.txt b/test/unittest/rtps/discovery/CMakeLists.txt index 5ef52388e55..d219bc647d3 100644 --- a/test/unittest/rtps/discovery/CMakeLists.txt +++ b/test/unittest/rtps/discovery/CMakeLists.txt @@ -14,30 +14,9 @@ #EDP TESTS set(EDPTESTS_SOURCE EdpTests.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/AnnotationDescriptor.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/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/fastdds/xtypes/type_representation/TypeObjectRegistry.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/xtypes/type_representation/TypeObjectUtils.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/attributes/ThreadSettings.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/builtin/discovery/endpoint/EDP.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp @@ -82,7 +61,10 @@ target_include_directories(EdpTests PRIVATE ${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) @@ -130,7 +112,6 @@ set(PDPTESTS_SOURCE PDPTests.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/attributes/PropertyPolicy.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/network/NetworkFactory.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPFinder.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/StringMatching.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/string_convert.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/attributes/ThreadSettings.cpp @@ -139,23 +120,6 @@ set(PDPTESTS_SOURCE PDPTests.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/flowcontrol/ThroughputControllerDescriptor.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/flowcontrol/FlowControllerConsts.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.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/xtypes/type_representation/dds_xtypes_typeobjectPubSubTypes.cxx - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/AnnotationDescriptor.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/DynamicType.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicPubSubType.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypePtr.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicDataPtr.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilder.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilderPtr.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilderFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeMember.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/MemberDescriptor.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 @@ -195,7 +159,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/flowcontrol/CMakeLists.txt b/test/unittest/rtps/flowcontrol/CMakeLists.txt index b043d7ba2f2..7833585df25 100644 --- a/test/unittest/rtps/flowcontrol/CMakeLists.txt +++ b/test/unittest/rtps/flowcontrol/CMakeLists.txt @@ -20,9 +20,6 @@ set(FLOWCONTROLLER_COMMON_SOURCE ${PROJECT_SOURCE_DIR}/src/cpp/rtps/flowcontrol/FlowControllerConsts.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/writer/LocatorSelectorSender.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.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/rtps/attributes/PropertyPolicy.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/flowcontrol/ThroughputControllerDescriptor.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/SystemInfo.cpp @@ -47,6 +44,7 @@ target_include_directories(FlowControllerFactoryTests PRIVATE ) target_link_libraries(FlowControllerFactoryTests fastcdr + fastdds::log GTest::gmock ) if(MSVC OR MSVC_IDE) @@ -78,6 +76,7 @@ target_include_directories(FlowControllerPublishModesTests PRIVATE ) target_link_libraries(FlowControllerPublishModesTests fastcdr + fastdds::log GTest::gmock ) if(MSVC OR MSVC_IDE) @@ -105,6 +104,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 6819d713df4..64b370419f3 100644 --- a/test/unittest/rtps/history/CMakeLists.txt +++ b/test/unittest/rtps/history/CMakeLists.txt @@ -16,28 +16,16 @@ set(READERHISTORYTESTS_SOURCE ReaderHistoryTests.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/history/ReaderHistory.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/history/History.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/history/CacheChangePool.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/Time_t.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/SystemInfo.cpp) set(BASICPOOLSTESTS_SOURCE BasicPoolsTests.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/history/CacheChangePool.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/Time_t.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/SystemInfo.cpp) set(CACHECHANGEPOOLTESTS_SOURCE CacheChangePoolTests.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/history/CacheChangePool.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/Time_t.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/SystemInfo.cpp) @@ -45,10 +33,6 @@ set(TOPICPAYLOADPOOLTESTS_SOURCE TopicPayloadPoolTests.cpp TopicPayloadPoolRegistryTests.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/history/TopicPayloadPool.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/history/TopicPayloadPoolRegistry.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/Time_t.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/SystemInfo.cpp) @@ -78,6 +62,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) @@ -91,6 +76,7 @@ target_include_directories(BasicPoolsTests PRIVATE ${PROJECT_SOURCE_DIR}/src/cpp ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include) target_link_libraries(BasicPoolsTests + fastdds::log GTest::gtest ${CMAKE_DL_LIBS}) gtest_discover_tests(BasicPoolsTests) @@ -104,6 +90,7 @@ target_include_directories(CacheChangePoolTests PRIVATE ${PROJECT_SOURCE_DIR}/src/cpp ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include) target_link_libraries(CacheChangePoolTests + fastdds::log GTest::gtest ${CMAKE_DL_LIBS}) gtest_discover_tests(CacheChangePoolTests) @@ -118,6 +105,7 @@ target_include_directories(TopicPayloadPoolTests PRIVATE ${PROJECT_SOURCE_DIR}/src/cpp ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include) target_link_libraries(TopicPayloadPoolTests + 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 1cf7db3ab3c..b1a5d903c53 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/Time_t.cpp @@ -87,7 +83,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}) @@ -97,22 +96,6 @@ if(QNX) endif() add_executable(ExternalLocatorsProcessorTests ExternalLocatorsProcessorTests.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/AnnotationDescriptor.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/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 @@ -140,7 +123,9 @@ target_include_directories(ExternalLocatorsProcessorTests PRIVATE ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include ${PROJECT_SOURCE_DIR}/src/cpp ) -target_link_libraries(ExternalLocatorsProcessorTests fastcdr +target_link_libraries(ExternalLocatorsProcessorTests + fastcdr + fastdds::log GTest::gtest ${MOCKS} ${CMAKE_THREAD_LIBS_INIT} ${CMAKE_DL_LIBS}) diff --git a/test/unittest/rtps/persistence/CMakeLists.txt b/test/unittest/rtps/persistence/CMakeLists.txt index 6ef468d8d46..8d02112dd8c 100644 --- a/test/unittest/rtps/persistence/CMakeLists.txt +++ b/test/unittest/rtps/persistence/CMakeLists.txt @@ -21,10 +21,6 @@ if(SQLITE3_SUPPORT) ${PROJECT_SOURCE_DIR}/src/cpp/rtps/persistence/PersistenceFactory.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/persistence/SQLite3PersistenceService.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/persistence/sqlite3.c - ${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/history/CacheChangePool.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/attributes/PropertyPolicy.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp @@ -43,6 +39,7 @@ if(SQLITE3_SUPPORT) ) target_link_libraries(PersistenceTests fastcdr + fastdds::log foonathan_memory GTest::gmock ${CMAKE_DL_LIBS} diff --git a/test/unittest/rtps/reader/CMakeLists.txt b/test/unittest/rtps/reader/CMakeLists.txt index 217a431252a..b836cbf76ce 100644 --- a/test/unittest/rtps/reader/CMakeLists.txt +++ b/test/unittest/rtps/reader/CMakeLists.txt @@ -18,10 +18,6 @@ ########################################################################### set(WRITERPROXYTESTS_SOURCE WriterProxyTests.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/publisher/qos/WriterQos.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/Time_t.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/SystemInfo.cpp ) @@ -53,6 +49,7 @@ target_include_directories(WriterProxyTests PRIVATE ) target_link_libraries(WriterProxyTests fastcdr + fastdds::log foonathan_memory GTest::gmock ${CMAKE_DL_LIBS}) @@ -63,10 +60,6 @@ gtest_discover_tests(WriterProxyTests) ########################################################################### set(WRITERPROXYSTOPTEST_SOURCE WriterProxyStopTest.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/publisher/qos/WriterQos.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/Time_t.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/resources/TimedEventImpl.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/resources/TimedEvent.cpp @@ -100,6 +93,7 @@ target_include_directories(WriterProxyStopTest PRIVATE ) target_link_libraries(WriterProxyStopTest fastcdr + fastdds::log foonathan_memory GTest::gmock ${CMAKE_DL_LIBS}) @@ -110,10 +104,6 @@ gtest_discover_tests(WriterProxyStopTest) ########################################################################### set(WRITERPROXYACKNACKTESTS_SOURCE WriterProxyAcknackTests.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/publisher/qos/WriterQos.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/Time_t.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/resources/TimedEvent.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/resources/TimedEventImpl.cpp @@ -146,6 +136,7 @@ target_include_directories(WriterProxyAcknackTests PRIVATE ) target_link_libraries(WriterProxyAcknackTests fastcdr + fastdds::log foonathan_memory GTest::gmock ${CMAKE_DL_LIBS}) diff --git a/test/unittest/rtps/resources/timedevent/CMakeLists.txt b/test/unittest/rtps/resources/timedevent/CMakeLists.txt index e93d73d8e5d..6e237b82380 100644 --- a/test/unittest/rtps/resources/timedevent/CMakeLists.txt +++ b/test/unittest/rtps/resources/timedevent/CMakeLists.txt @@ -18,10 +18,6 @@ set(TIMEDEVENTTESTS_SOURCE mock/MockEvent.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/resources/TimedEvent.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/resources/ResourceEvent.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/TimedConditionVariable.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/Time_t.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/SystemInfo.cpp) @@ -50,5 +46,9 @@ target_include_directories(TimedEventTests PRIVATE ${PROJECT_BINARY_DIR}/include ${PROJECT_SOURCE_DIR}/src/cpp ) -target_link_libraries(TimedEventTests GTest::gtest ${CMAKE_DL_LIBS}) +target_link_libraries(TimedEventTests + 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 0dc80d27d0a..befd5f03339 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/rtps/security/logging/Logging.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/attributes/PropertyPolicy.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/flowcontrol/ThroughputControllerDescriptor.cpp @@ -89,7 +85,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 6a03a34c0a6..e71c74a8727 100644 --- a/test/unittest/rtps/writer/CMakeLists.txt +++ b/test/unittest/rtps/writer/CMakeLists.txt @@ -16,10 +16,6 @@ set(WRITERPROXYTESTS_SOURCE ReaderProxyTests.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/writer/ReaderProxy.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/subscriber/qos/ReaderQos.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/Time_t.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/writer/LocatorSelectorSender.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/flowcontrol/FlowControllerConsts.cpp @@ -57,6 +53,7 @@ target_include_directories(ReaderProxyTests PRIVATE ) target_link_libraries(ReaderProxyTests fastcdr + fastdds::log foonathan_memory GTest::gmock ${CMAKE_DL_LIBS} @@ -64,10 +61,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/writer/LivelinessManager.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/resources/ResourceEvent.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/resources/TimedEvent.cpp @@ -91,7 +84,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 8fa6d3fc9c9..e290e7c5cee 100644 --- a/test/unittest/security/accesscontrol/CMakeLists.txt +++ b/test/unittest/security/accesscontrol/CMakeLists.txt @@ -21,10 +21,6 @@ if(WIN32) endif() set(COMMON_SOURCES_ACCESS_CONTROL_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/fastdds/core/policy/ParameterList.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/flowcontrol/ThroughputControllerDescriptor.cpp @@ -96,6 +92,7 @@ target_link_libraries(AccessControlTests GTest::gmock ${OPENSSL_LIBRARIES} fastcdr + fastdds::log foonathan_memory $<$:ws2_32> ${TINYXML2_LIBRARY} @@ -124,10 +121,6 @@ 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 ${PROJECT_SOURCE_DIR}/src/cpp/utils/SystemInfo.cpp # src files @@ -152,8 +145,8 @@ target_include_directories( ${PROJECT_SOURCE_DIR}/src/cpp ) -target_link_libraries( - ${DISTINGUISHEDNAME_TEST_NAME} +target_link_libraries(${DISTINGUISHEDNAME_TEST_NAME} + fastdds::log GTest::gtest ) diff --git a/test/unittest/security/authentication/CMakeLists.txt b/test/unittest/security/authentication/CMakeLists.txt index 53dfcbad85e..12f81f2c3b6 100644 --- a/test/unittest/security/authentication/CMakeLists.txt +++ b/test/unittest/security/authentication/CMakeLists.txt @@ -21,10 +21,6 @@ if(WIN32) endif() set(COMMON_SOURCES_AUTH_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/builtin/data/ParticipantProxyData.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/core/policy/ParameterList.cpp @@ -69,6 +65,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 99cdf927461..2cbf23a2044 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/Token.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp @@ -52,7 +48,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 0adc0cf058a..0667b958b7c 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/Token.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp @@ -42,5 +38,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 4cfc2de8dbc..f8d717532df 100644 --- a/test/unittest/statistics/dds/CMakeLists.txt +++ b/test/unittest/statistics/dds/CMakeLists.txt @@ -38,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 @@ -62,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 @@ -71,16 +80,7 @@ if (FASTDDS_STATISTICS) DomainParticipantStatisticsListenerTests.cpp) add_executable(DomainParticipantStatisticsListenerTests - ${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/topic/TopicDataType.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/xtypes/exception/Exception.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/xtypes/type_representation/TypeObjectRegistry.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/xtypes/type_representation/TypeObjectUtils.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/statistics/fastdds/domain/DomainParticipantStatisticsListener.cpp ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/monitorservice_typesPubSubTypes.cxx @@ -104,7 +104,12 @@ if (FASTDDS_STATISTICS) ${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() @@ -115,27 +120,6 @@ if (SQLITE3_SUPPORT AND FASTDDS_STATISTICS AND NOT QNX) 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/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 @@ -184,10 +168,6 @@ if (SQLITE3_SUPPORT AND FASTDDS_STATISTICS AND NOT QNX) ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/topic/TypeSupport.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/topic/TopicDataType.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/utils/QosConverters.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/fastdds/xtypes/type_representation/TypeObjectRegistry.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/xtypes/type_representation/TypeObjectUtils.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/builtin/BuiltinProtocols.cpp @@ -313,18 +293,6 @@ 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/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/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 @@ -343,11 +311,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 @@ -372,10 +335,6 @@ if (SQLITE3_SUPPORT AND FASTDDS_STATISTICS AND NOT QNX) ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/topic/TopicDataType.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/topic/qos/TopicQos.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/utils/QosConverters.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/fastdds/xtypes/type_representation/TypeObjectRegistry.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/xtypes/type_representation/TypeObjectUtils.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/DataSharing/DataSharingListener.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/DataSharing/DataSharingNotification.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/DataSharing/DataSharingPayloadPool.cpp @@ -580,6 +539,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} @@ -626,7 +588,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/StatisticsDomainParticipantMockTests.cpp b/test/unittest/statistics/dds/StatisticsDomainParticipantMockTests.cpp index db2a0fe0aa1..b276d4611d1 100644 --- a/test/unittest/statistics/dds/StatisticsDomainParticipantMockTests.cpp +++ b/test/unittest/statistics/dds/StatisticsDomainParticipantMockTests.cpp @@ -115,7 +115,7 @@ TEST_F(StatisticsDomainParticipantMockTests, EnableStatisticsDataWriterFailureCr EXPECT_CALL(*builtin_pub_impl, create_datawriter_mock()).WillOnce(testing::Return(true)); // 3. enable_statistics_datawriter - EXPECT_EQ(eprosima::fastdds::dds::RETCODE_ERROR, + 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)); @@ -127,7 +127,7 @@ TEST_F(StatisticsDomainParticipantMockTests, EnableStatisticsDataWriterFailureCr EXPECT_EQ(consumed_entries.size(), 1u); EXPECT_EQ(eprosima::fastdds::dds::DomainParticipantFactory::get_instance()-> - delete_participant(participant), eprosima::fastdds::dds::RETCODE_OK); + delete_participant(participant), fastdds::dds::RETCODE_OK); #endif // FASTDDS_STATISTICS } @@ -168,25 +168,25 @@ TEST_F(StatisticsDomainParticipantMockTests, DisableStatisticsDataWriterFailureD // 3. enable_statistics_datawriter EXPECT_CALL(*builtin_pub_impl, create_datawriter_mock()).WillOnce(testing::Return(false)); - EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->enable_statistics_datawriter(HEARTBEAT_COUNT_TOPIC, STATISTICS_DATAWRITER_QOS)); // 4. disable_statistics_datawriter - EXPECT_EQ(eprosima::fastdds::dds::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(eprosima::fastdds::dds::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), eprosima::fastdds::dds::RETCODE_OK); + delete_participant(statistics_participant), fastdds::dds::RETCODE_OK); #endif // FASTDDS_STATISTICS } @@ -224,25 +224,25 @@ TEST_F(StatisticsDomainParticipantMockTests, DisableStatisticsDataWriterFailureD // 3. enable_statistics_datawriter EXPECT_CALL(*builtin_pub_impl, create_datawriter_mock()).WillOnce(testing::Return(false)); - EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, + 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(eprosima::fastdds::dds::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(eprosima::fastdds::dds::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), eprosima::fastdds::dds::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 72eb46a693d..674e30451d9 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/StatisticsDomainParticipantTests.cpp b/test/unittest/statistics/dds/StatisticsDomainParticipantTests.cpp index ea323385edc..108778b6e39 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" diff --git a/test/unittest/statistics/dds/StatisticsQosTests.cpp b/test/unittest/statistics/dds/StatisticsQosTests.cpp index 12cc420197a..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::fastdds::dds::ReturnCode_t; - class StatisticsFromXMLProfileTests : public ::testing::Test { public: @@ -316,7 +315,7 @@ 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(fastdds::dds::RETCODE_OK, ret); @@ -412,7 +411,7 @@ 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(fastdds::dds::RETCODE_UNSUPPORTED, ret); diff --git a/test/unittest/statistics/rtps/CMakeLists.txt b/test/unittest/statistics/rtps/CMakeLists.txt index dc1122635b5..59b641b8b13 100644 --- a/test/unittest/statistics/rtps/CMakeLists.txt +++ b/test/unittest/statistics/rtps/CMakeLists.txt @@ -62,46 +62,22 @@ endif() set(STATISTICS_RTPS_MONITORSERVICETESTS_SOURCE MonitorServiceTests.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/core/policy/ParameterList.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/core/policy/ParameterList.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/attributes/PropertyPolicy.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/network/NetworkFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPFinder.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/string_convert.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/attributes/ThreadSettings.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/builtin/data/WriterProxyData.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/flowcontrol/ThroughputControllerDescriptor.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/flowcontrol/FlowControllerConsts.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.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/xtypes/type_representation/dds_xtypes_typeobjectPubSubTypes.cxx - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/AnnotationDescriptor.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/DynamicType.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicPubSubType.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypePtr.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicDataPtr.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilder.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilderPtr.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilderFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeMember.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/MemberDescriptor.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/network/NetworkFactory.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPFinder.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPLocator.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/md5.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/utils/string_convert.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/SystemInfo.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.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/xtypes/type_representation/dds_xtypes_typeobjectPubSubTypes.cxx ${PROJECT_SOURCE_DIR}/src/cpp/rtps/history/TopicPayloadPool.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/history/TopicPayloadPoolRegistry.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/resources/ResourceEvent.cpp @@ -114,10 +90,6 @@ set(STATISTICS_RTPS_MONITORSERVICETESTS_SOURCE ${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/fastdds/xtypes/exception/Exception.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/xtypes/type_representation/dds_xtypes_typeobjectPubSubTypes.cxx - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/xtypes/type_representation/TypeObjectRegistry.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/xtypes/type_representation/TypeObjectUtils.cpp ${TCPTransportInterface_SOURCE} ) @@ -159,9 +131,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/transport/CMakeLists.txt b/test/unittest/transport/CMakeLists.txt index 9ae6a4f9776..e642401207d 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/Time_t.cpp @@ -91,10 +87,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/Time_t.cpp @@ -118,10 +110,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/Time_t.cpp @@ -161,10 +149,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/Time_t.cpp @@ -203,10 +187,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/Time_t.cpp @@ -266,6 +246,7 @@ target_include_directories(UDPv4Tests PRIVATE ) target_link_libraries(UDPv4Tests fastcdr + fastdds::log GTest::gtest ${MOCKS} $<$:OpenSSL::SSL$OpenSSL::Crypto>) @@ -302,6 +283,7 @@ if(NOT DISABLE_UDPV6_TESTS) ) target_link_libraries(UDPv6Tests fastcdr + fastdds::log GTest::gtest ${MOCKS} $<$:OpenSSL::SSL$OpenSSL::Crypto>) @@ -335,6 +317,7 @@ if(NOT DISABLE_UDPV6_TESTS) ) target_link_libraries(TCPv6Tests fastcdr + fastdds::log GTest::gtest ${MOCKS} $<$:OpenSSL::SSL$OpenSSL::Crypto>) @@ -371,6 +354,7 @@ target_include_directories(TCPv4Tests PRIVATE ) target_link_libraries(TCPv4Tests fastcdr + fastdds::log GTest::gtest ${MOCKS} $<$:OpenSSL::SSL$OpenSSL::Crypto>) @@ -410,6 +394,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/utils/CMakeLists.txt b/test/unittest/utils/CMakeLists.txt index 9ace045dbe4..b98d17aadd9 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/utils/StringMatching.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/SystemInfo.cpp) @@ -33,10 +29,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/utils/IPLocator.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/SystemInfo.cpp) @@ -45,10 +37,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/utils/SystemInfo.cpp) include_directories(mock/) @@ -61,7 +49,11 @@ target_compile_definitions(StringMatchingTests PRIVATE target_include_directories(StringMatchingTests PRIVATE ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include ${PROJECT_SOURCE_DIR}/src/cpp) -target_link_libraries(StringMatchingTests GTest::gtest ${MOCKS}) +target_link_libraries(StringMatchingTests + fastdds::log + GTest::gtest + ${MOCKS} + ) if(MSVC OR MSVC_IDE) target_link_libraries(StringMatchingTests ${PRIVACY} iphlpapi Shlwapi ) @@ -100,7 +92,11 @@ 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 GTest::gtest ${MOCKS}) +target_link_libraries(LocatorTests + fastdds::log + GTest::gtest + ${MOCKS} + ) if(QNX) target_link_libraries(LocatorTests socket) endif() @@ -127,7 +123,10 @@ gtest_discover_tests(FixedSizeQueueTests) add_executable(SystemInfoTests ${SYSTEMINFOTESTS_SOURCE}) target_include_directories(SystemInfoTests PRIVATE ${PROJECT_SOURCE_DIR}/include ${PROJECT_SOURCE_DIR}/src/cpp ${PROJECT_BINARY_DIR}/include) -target_link_libraries(SystemInfoTests GTest::gtest) +target_link_libraries(SystemInfoTests + 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 61e2bb96723..50da9759535 100644 --- a/test/unittest/utils/SystemInfoTests.cpp +++ b/test/unittest/utils/SystemInfoTests.cpp @@ -30,9 +30,9 @@ #endif // _WIN32 #include -#include -#include #include + +#include #include #define SIZE 512 diff --git a/test/unittest/xmlparser/CMakeLists.txt b/test/unittest/xmlparser/CMakeLists.txt index ee24ede43be..231d60857cc 100644 --- a/test/unittest/xmlparser/CMakeLists.txt +++ b/test/unittest/xmlparser/CMakeLists.txt @@ -78,19 +78,6 @@ 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/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/fastdds/publisher/qos/WriterQos.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/subscriber/qos/ReaderQos.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/topic/TopicDataType.cpp @@ -149,7 +136,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}> @@ -160,6 +148,7 @@ target_link_libraries(XMLProfileParserTests GTest::gmock $<$:ws2_32> ${TINYXML2_LIBRARY} fastcdr + fastdds::xtypes::dynamic-types::impl ) if(QNX) target_link_libraries(XMLProfileParserTests socket) @@ -173,24 +162,6 @@ 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/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/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 @@ -255,6 +226,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) @@ -299,24 +272,6 @@ 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/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/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 @@ -380,6 +335,7 @@ target_link_libraries(XMLEndpointParserTests GTest::gtest $<$:ws2_32> ${TINYXML2_LIBRARY} fastcdr + fastdds::log ) if(QNX) target_link_libraries(XMLEndpointParserTests socket) diff --git a/test/unittest/xmlparser/XMLProfileParserTests.cpp b/test/unittest/xmlparser/XMLProfileParserTests.cpp index d8d1d296969..8fba5f0318d 100644 --- a/test/unittest/xmlparser/XMLProfileParserTests.cpp +++ b/test/unittest/xmlparser/XMLProfileParserTests.cpp @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -1772,7 +1773,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/xtypes/CMakeLists.txt b/test/unittest/xtypes/CMakeLists.txt deleted file mode 100644 index 15e39875d52..00000000000 --- a/test/unittest/xtypes/CMakeLists.txt +++ /dev/null @@ -1,64 +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() - -file(GLOB XTYPES_SOURCE - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/*.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/*.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/topic/TopicDataType.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/*.cpp - ) - -set(XTYPES_TEST_SOURCE - XTypesTests.cpp - ${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} - ${THIRDPARTY_BOOST_INCLUDE_DIR} - ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include - ${PROJECT_SOURCE_DIR}/src/cpp - ) -target_link_libraries(XTypesTests GTest::gtest ${MOCKS} ${THIRDPARTY_BOOST_LINK_LIBS}) -if(MSVC OR MSVC_IDE) - target_link_libraries(XTypesTests ${PRIVACY} fastcdr foonathan_memory iphlpapi Shlwapi ws2_32) -else() - target_link_libraries(XTypesTests ${PRIVACY} fastcdr foonathan_memory) -endif() -gtest_discover_tests(XTypesTests) diff --git a/test/unittest/xtypes/XTypesTests.cpp b/test/unittest/xtypes/XTypesTests.cpp deleted file mode 100644 index deaa292c696..00000000000 --- a/test/unittest/xtypes/XTypesTests.cpp +++ /dev/null @@ -1,165 +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 - -using namespace eprosima::fastrtps::types; - -class XTypesTests : public ::testing::Test -{ -public: - - XTypesTests() - { - } - - ~XTypesTests() - { - eprosima::fastdds::dds::Log::KillThread(); - } - - virtual void TearDown() - { - } - -}; - -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(eprosima::fastdds::dds::RETCODE_OK, my_builder->add_member(member_id++, "t1", my_builder->build())); - my_builder->set_name("Position_"); - EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, my_builder->add_member(member_id++, "t2", my_builder->build())); - my_builder->set_name("Position123"); - EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, my_builder->add_member(member_id++, "t3", my_builder->build())); - my_builder->set_name("position_123"); - EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, my_builder->add_member(member_id++, "t4", my_builder->build())); - my_builder->set_name("_Position"); - EXPECT_EQ(eprosima::fastdds::dds::RETCODE_BAD_PARAMETER, - my_builder->add_member(member_id++, "t5", my_builder->build())); - my_builder->set_name("123Position"); - EXPECT_EQ(eprosima::fastdds::dds::RETCODE_BAD_PARAMETER, - my_builder->add_member(member_id++, "t6", my_builder->build())); - my_builder->set_name("Position&"); - EXPECT_EQ(eprosima::fastdds::dds::RETCODE_BAD_PARAMETER, - my_builder->add_member(member_id++, "t7", my_builder->build())); - - my_builder->set_name("my_interface::action::dds_::Position"); - EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, my_builder->add_member(member_id++, "t8", my_builder->build())); - my_builder->set_name("my_interface:action::dds_::Position"); - EXPECT_EQ(eprosima::fastdds::dds::RETCODE_BAD_PARAMETER, - my_builder->add_member(member_id++, "t9", my_builder->build())); - my_builder->set_name("my_interface:::action::dds_::Position"); - EXPECT_EQ(eprosima::fastdds::dds::RETCODE_BAD_PARAMETER, - my_builder->add_member(member_id++, "tA", my_builder->build())); - my_builder->set_name("_my_interface::action::dds_::Position"); - EXPECT_EQ(eprosima::fastdds::dds::RETCODE_BAD_PARAMETER, - my_builder->add_member(member_id++, "tB", my_builder->build())); - my_builder->set_name("1my_interface::action::dds_::Position"); - EXPECT_EQ(eprosima::fastdds::dds::RETCODE_BAD_PARAMETER, - my_builder->add_member(member_id++, "tC", my_builder->build())); - my_builder->set_name(":my_interface::action::dds_::Position"); - EXPECT_EQ(eprosima::fastdds::dds::RETCODE_BAD_PARAMETER, - my_builder->add_member(member_id++, "tD", my_builder->build())); - my_builder->set_name("::my_interface::action::dds_::Position"); - EXPECT_EQ(eprosima::fastdds::dds::RETCODE_BAD_PARAMETER, - my_builder->add_member(member_id++, "tE", my_builder->build())); - my_builder->set_name("$my_interface::action::dds_::Position"); - EXPECT_EQ(eprosima::fastdds::dds::RETCODE_BAD_PARAMETER, - my_builder->add_member(member_id++, "tF", my_builder->build())); - my_builder->set_name("my_interface::2action::dds_::Position"); - EXPECT_EQ(eprosima::fastdds::dds::RETCODE_BAD_PARAMETER, - my_builder->add_member(member_id++, "tG", my_builder->build())); - my_builder->set_name("my_interface::_action::dds_::Position"); - EXPECT_EQ(eprosima::fastdds::dds::RETCODE_BAD_PARAMETER, - my_builder->add_member(member_id++, "tH", my_builder->build())); - my_builder->set_name("my_interface::*action::dds_::Position"); - EXPECT_EQ(eprosima::fastdds::dds::RETCODE_BAD_PARAMETER, - my_builder->add_member(member_id++, "tI", my_builder->build())); - my_builder->set_name("my_interface::action*::dds_::Position"); - EXPECT_EQ(eprosima::fastdds::dds::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.hpp b/test/unittest/xtypes/idl/Types.hpp deleted file mode 100644 index 81b2d61e567..00000000000 --- a/test/unittest/xtypes/idl/Types.hpp +++ /dev/null @@ -1,7226 +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.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_TYPES_HPP_ -#define _FAST_DDS_GENERATED_TYPES_HPP_ - -#include -#include -#include -#include -#include -#include - -#include -#include - - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(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 - -/*! - * @brief This class represents the enumeration MyEnum defined by the user in the IDL file. - * @ingroup Types - */ -enum class MyEnum : uint32_t -{ - A, - B, - C -}; -/*! - * @brief This class represents the enumeration MyBadEnum defined by the user in the IDL file. - * @ingroup Types - */ -enum class 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) - { - m_my_enum = x.m_my_enum; - - } - - /*! - * @brief Move constructor. - * @param x Reference to the object MyEnumStruct that will be copied. - */ - eProsima_user_DllExport MyEnumStruct( - MyEnumStruct&& x) noexcept - { - m_my_enum = x.m_my_enum; - } - - /*! - * @brief Copy assignment. - * @param x Reference to the object MyEnumStruct that will be copied. - */ - eProsima_user_DllExport MyEnumStruct& operator =( - const MyEnumStruct& x) - { - - m_my_enum = x.m_my_enum; - - return *this; - } - - /*! - * @brief Move assignment. - * @param x Reference to the object MyEnumStruct that will be copied. - */ - eProsima_user_DllExport MyEnumStruct& operator =( - MyEnumStruct&& x) noexcept - { - - m_my_enum = x.m_my_enum; - return *this; - } - - /*! - * @brief Comparison operator. - * @param x MyEnumStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MyEnumStruct& x) const - { - return (m_my_enum == x.m_my_enum); - } - - /*! - * @brief Comparison operator. - * @param x MyEnumStruct object to compare. - */ - eProsima_user_DllExport bool 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport MyEnum my_enum() const - { - return m_my_enum; - } - - /*! - * @brief This function returns a reference to member my_enum - * @return Reference to member my_enum - */ - eProsima_user_DllExport MyEnum& my_enum() - { - return m_my_enum; - } - - - -private: - - MyEnum m_my_enum{MyEnum::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) - { - m_my_enum = x.m_my_enum; - - } - - /*! - * @brief Move constructor. - * @param x Reference to the object MyBadEnumStruct that will be copied. - */ - eProsima_user_DllExport MyBadEnumStruct( - MyBadEnumStruct&& x) noexcept - { - m_my_enum = x.m_my_enum; - } - - /*! - * @brief Copy assignment. - * @param x Reference to the object MyBadEnumStruct that will be copied. - */ - eProsima_user_DllExport MyBadEnumStruct& operator =( - const MyBadEnumStruct& x) - { - - m_my_enum = x.m_my_enum; - - return *this; - } - - /*! - * @brief Move assignment. - * @param x Reference to the object MyBadEnumStruct that will be copied. - */ - eProsima_user_DllExport MyBadEnumStruct& operator =( - MyBadEnumStruct&& x) noexcept - { - - m_my_enum = x.m_my_enum; - return *this; - } - - /*! - * @brief Comparison operator. - * @param x MyBadEnumStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MyBadEnumStruct& x) const - { - return (m_my_enum == x.m_my_enum); - } - - /*! - * @brief Comparison operator. - * @param x MyBadEnumStruct object to compare. - */ - eProsima_user_DllExport bool 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport MyBadEnum my_enum() const - { - return m_my_enum; - } - - /*! - * @brief This function returns a reference to member my_enum - * @return Reference to member my_enum - */ - eProsima_user_DllExport MyBadEnum& my_enum() - { - return m_my_enum; - } - - - -private: - - MyBadEnum m_my_enum{MyBadEnum::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) - { - m_my_enum = x.m_my_enum; - - } - - /*! - * @brief Move constructor. - * @param x Reference to the object MyAliasEnumStruct that will be copied. - */ - eProsima_user_DllExport MyAliasEnumStruct( - MyAliasEnumStruct&& x) noexcept - { - m_my_enum = x.m_my_enum; - } - - /*! - * @brief Copy assignment. - * @param x Reference to the object MyAliasEnumStruct that will be copied. - */ - eProsima_user_DllExport MyAliasEnumStruct& operator =( - const MyAliasEnumStruct& x) - { - - m_my_enum = x.m_my_enum; - - return *this; - } - - /*! - * @brief Move assignment. - * @param x Reference to the object MyAliasEnumStruct that will be copied. - */ - eProsima_user_DllExport MyAliasEnumStruct& operator =( - MyAliasEnumStruct&& x) noexcept - { - - m_my_enum = x.m_my_enum; - return *this; - } - - /*! - * @brief Comparison operator. - * @param x MyAliasEnumStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MyAliasEnumStruct& x) const - { - return (m_my_enum == x.m_my_enum); - } - - /*! - * @brief Comparison operator. - * @param x MyAliasEnumStruct object to compare. - */ - eProsima_user_DllExport bool 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport MyAliasEnum my_enum() const - { - return m_my_enum; - } - - /*! - * @brief This function returns a reference to member my_enum - * @return Reference to member my_enum - */ - eProsima_user_DllExport MyAliasEnum& my_enum() - { - return m_my_enum; - } - - - -private: - - MyAliasEnum m_my_enum{MyEnum::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) - { - m_my_bool = x.m_my_bool; - - m_my_int32 = x.m_my_int32; - - m_my_string = x.m_my_string; - - } - - /*! - * @brief Move constructor. - * @param x Reference to the object BasicStruct that will be copied. - */ - eProsima_user_DllExport 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); - } - - /*! - * @brief Copy assignment. - * @param x Reference to the object BasicStruct that will be copied. - */ - eProsima_user_DllExport 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; - } - - /*! - * @brief Move assignment. - * @param x Reference to the object BasicStruct that will be copied. - */ - eProsima_user_DllExport 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; - } - - /*! - * @brief Comparison operator. - * @param x BasicStruct object to compare. - */ - eProsima_user_DllExport bool 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); - } - - /*! - * @brief Comparison operator. - * @param x BasicStruct object to compare. - */ - eProsima_user_DllExport bool 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport bool my_bool() const - { - return m_my_bool; - } - - /*! - * @brief This function returns a reference to member my_bool - * @return Reference to member my_bool - */ - eProsima_user_DllExport bool& 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport int32_t my_int32() const - { - return m_my_int32; - } - - /*! - * @brief This function returns a reference to member my_int32 - * @return Reference to member my_int32 - */ - eProsima_user_DllExport int32_t& 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport const std::string& my_string() const - { - return m_my_string; - } - - /*! - * @brief This function returns a reference to member my_string - * @return Reference to member my_string - */ - eProsima_user_DllExport std::string& my_string() - { - return m_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) - { - 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; - - } - - /*! - * @brief Move constructor. - * @param x Reference to the object BasicNamesStruct that will be copied. - */ - eProsima_user_DllExport 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); - } - - /*! - * @brief Copy assignment. - * @param x Reference to the object BasicNamesStruct that will be copied. - */ - eProsima_user_DllExport 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; - } - - /*! - * @brief Move assignment. - * @param x Reference to the object BasicNamesStruct that will be copied. - */ - eProsima_user_DllExport 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; - } - - /*! - * @brief Comparison operator. - * @param x BasicNamesStruct object to compare. - */ - eProsima_user_DllExport bool 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); - } - - /*! - * @brief Comparison operator. - * @param x BasicNamesStruct object to compare. - */ - eProsima_user_DllExport bool 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport bool 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 - */ - eProsima_user_DllExport bool& 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport int32_t 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 - */ - eProsima_user_DllExport int32_t& 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport const std::string& 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 - */ - eProsima_user_DllExport std::string& my_string_name() - { - return m_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) - { - m_my_bool = x.m_my_bool; - - m_my_int32 = x.m_my_int32; - - m_my_string = x.m_my_string; - - } - - /*! - * @brief Move constructor. - * @param x Reference to the object BasicBadStruct that will be copied. - */ - eProsima_user_DllExport 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); - } - - /*! - * @brief Copy assignment. - * @param x Reference to the object BasicBadStruct that will be copied. - */ - eProsima_user_DllExport 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; - } - - /*! - * @brief Move assignment. - * @param x Reference to the object BasicBadStruct that will be copied. - */ - eProsima_user_DllExport 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; - } - - /*! - * @brief Comparison operator. - * @param x BasicBadStruct object to compare. - */ - eProsima_user_DllExport bool 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); - } - - /*! - * @brief Comparison operator. - * @param x BasicBadStruct object to compare. - */ - eProsima_user_DllExport bool 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport uint8_t my_bool() const - { - return m_my_bool; - } - - /*! - * @brief This function returns a reference to member my_bool - * @return Reference to member my_bool - */ - eProsima_user_DllExport uint8_t& 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport int32_t my_int32() const - { - return m_my_int32; - } - - /*! - * @brief This function returns a reference to member my_int32 - * @return Reference to member my_int32 - */ - eProsima_user_DllExport int32_t& 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport const std::string& my_string() const - { - return m_my_string; - } - - /*! - * @brief This function returns a reference to member my_string - * @return Reference to member my_string - */ - eProsima_user_DllExport std::string& my_string() - { - return m_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) - { - 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; - - } - - /*! - * @brief Move constructor. - * @param x Reference to the object BasicWideStruct that will be copied. - */ - eProsima_user_DllExport 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); - } - - /*! - * @brief Copy assignment. - * @param x Reference to the object BasicWideStruct that will be copied. - */ - eProsima_user_DllExport 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; - } - - /*! - * @brief Move assignment. - * @param x Reference to the object BasicWideStruct that will be copied. - */ - eProsima_user_DllExport 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; - } - - /*! - * @brief Comparison operator. - * @param x BasicWideStruct object to compare. - */ - eProsima_user_DllExport bool 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); - } - - /*! - * @brief Comparison operator. - * @param x BasicWideStruct object to compare. - */ - eProsima_user_DllExport bool 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport bool my_bool() const - { - return m_my_bool; - } - - /*! - * @brief This function returns a reference to member my_bool - * @return Reference to member my_bool - */ - eProsima_user_DllExport bool& 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport int32_t my_int32() const - { - return m_my_int32; - } - - /*! - * @brief This function returns a reference to member my_int32 - * @return Reference to member my_int32 - */ - eProsima_user_DllExport int32_t& 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport const std::string& my_string() const - { - return m_my_string; - } - - /*! - * @brief This function returns a reference to member my_string - * @return Reference to member my_string - */ - eProsima_user_DllExport std::string& 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport int32_t new_int32() const - { - return m_new_int32; - } - - /*! - * @brief This function returns a reference to member new_int32 - * @return Reference to member new_int32 - */ - eProsima_user_DllExport int32_t& 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport const std::string& new_string() const - { - return m_new_string; - } - - /*! - * @brief This function returns a reference to member new_string - * @return Reference to member new_string - */ - eProsima_user_DllExport std::string& new_string() - { - return m_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) - { - 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; - - } - - /*! - * @brief Move constructor. - * @param x Reference to the object BadBasicWideStruct that will be copied. - */ - eProsima_user_DllExport 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); - } - - /*! - * @brief Copy assignment. - * @param x Reference to the object BadBasicWideStruct that will be copied. - */ - eProsima_user_DllExport 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; - } - - /*! - * @brief Move assignment. - * @param x Reference to the object BadBasicWideStruct that will be copied. - */ - eProsima_user_DllExport 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; - } - - /*! - * @brief Comparison operator. - * @param x BadBasicWideStruct object to compare. - */ - eProsima_user_DllExport bool 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); - } - - /*! - * @brief Comparison operator. - * @param x BadBasicWideStruct object to compare. - */ - eProsima_user_DllExport bool 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport int32_t new_int32() const - { - return m_new_int32; - } - - /*! - * @brief This function returns a reference to member new_int32 - * @return Reference to member new_int32 - */ - eProsima_user_DllExport int32_t& 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport const std::string& new_string() const - { - return m_new_string; - } - - /*! - * @brief This function returns a reference to member new_string - * @return Reference to member new_string - */ - eProsima_user_DllExport std::string& 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport bool my_bool() const - { - return m_my_bool; - } - - /*! - * @brief This function returns a reference to member my_bool - * @return Reference to member my_bool - */ - eProsima_user_DllExport bool& 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport int32_t my_int32() const - { - return m_my_int32; - } - - /*! - * @brief This function returns a reference to member my_int32 - * @return Reference to member my_int32 - */ - eProsima_user_DllExport int32_t& 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport const std::string& my_string() const - { - return m_my_string; - } - - /*! - * @brief This function returns a reference to member my_string - * @return Reference to member my_string - */ - eProsima_user_DllExport std::string& my_string() - { - return m_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) - { - m_my_string = x.m_my_string; - - } - - /*! - * @brief Move constructor. - * @param x Reference to the object StringStruct that will be copied. - */ - eProsima_user_DllExport StringStruct( - StringStruct&& x) noexcept - { - m_my_string = std::move(x.m_my_string); - } - - /*! - * @brief Copy assignment. - * @param x Reference to the object StringStruct that will be copied. - */ - eProsima_user_DllExport StringStruct& operator =( - const StringStruct& x) - { - - m_my_string = x.m_my_string; - - return *this; - } - - /*! - * @brief Move assignment. - * @param x Reference to the object StringStruct that will be copied. - */ - eProsima_user_DllExport StringStruct& operator =( - StringStruct&& x) noexcept - { - - m_my_string = std::move(x.m_my_string); - return *this; - } - - /*! - * @brief Comparison operator. - * @param x StringStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const StringStruct& x) const - { - return (m_my_string == x.m_my_string); - } - - /*! - * @brief Comparison operator. - * @param x StringStruct object to compare. - */ - eProsima_user_DllExport bool 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport const std::string& my_string() const - { - return m_my_string; - } - - /*! - * @brief This function returns a reference to member my_string - * @return Reference to member my_string - */ - eProsima_user_DllExport std::string& my_string() - { - return m_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) - { - m_my_large_string = x.m_my_large_string; - - } - - /*! - * @brief Move constructor. - * @param x Reference to the object LargeStringStruct that will be copied. - */ - eProsima_user_DllExport LargeStringStruct( - LargeStringStruct&& x) noexcept - { - m_my_large_string = std::move(x.m_my_large_string); - } - - /*! - * @brief Copy assignment. - * @param x Reference to the object LargeStringStruct that will be copied. - */ - eProsima_user_DllExport LargeStringStruct& operator =( - const LargeStringStruct& x) - { - - m_my_large_string = x.m_my_large_string; - - return *this; - } - - /*! - * @brief Move assignment. - * @param x Reference to the object LargeStringStruct that will be copied. - */ - eProsima_user_DllExport LargeStringStruct& operator =( - LargeStringStruct&& x) noexcept - { - - m_my_large_string = std::move(x.m_my_large_string); - return *this; - } - - /*! - * @brief Comparison operator. - * @param x LargeStringStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const LargeStringStruct& x) const - { - return (m_my_large_string == x.m_my_large_string); - } - - /*! - * @brief Comparison operator. - * @param x LargeStringStruct object to compare. - */ - eProsima_user_DllExport bool 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport const eprosima::fastcdr::fixed_string<41925>& 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_user_DllExport eprosima::fastcdr::fixed_string<41925>& my_large_string() - { - return m_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) - { - m_my_wstring = x.m_my_wstring; - - } - - /*! - * @brief Move constructor. - * @param x Reference to the object WStringStruct that will be copied. - */ - eProsima_user_DllExport WStringStruct( - WStringStruct&& x) noexcept - { - m_my_wstring = std::move(x.m_my_wstring); - } - - /*! - * @brief Copy assignment. - * @param x Reference to the object WStringStruct that will be copied. - */ - eProsima_user_DllExport WStringStruct& operator =( - const WStringStruct& x) - { - - m_my_wstring = x.m_my_wstring; - - return *this; - } - - /*! - * @brief Move assignment. - * @param x Reference to the object WStringStruct that will be copied. - */ - eProsima_user_DllExport WStringStruct& operator =( - WStringStruct&& x) noexcept - { - - m_my_wstring = std::move(x.m_my_wstring); - return *this; - } - - /*! - * @brief Comparison operator. - * @param x WStringStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const WStringStruct& x) const - { - return (m_my_wstring == x.m_my_wstring); - } - - /*! - * @brief Comparison operator. - * @param x WStringStruct object to compare. - */ - eProsima_user_DllExport bool 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport const std::wstring& my_wstring() const - { - return m_my_wstring; - } - - /*! - * @brief This function returns a reference to member my_wstring - * @return Reference to member my_wstring - */ - eProsima_user_DllExport std::wstring& my_wstring() - { - return m_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) - { - m_my_large_wstring = x.m_my_large_wstring; - - } - - /*! - * @brief Move constructor. - * @param x Reference to the object LargeWStringStruct that will be copied. - */ - eProsima_user_DllExport LargeWStringStruct( - LargeWStringStruct&& x) noexcept - { - m_my_large_wstring = std::move(x.m_my_large_wstring); - } - - /*! - * @brief Copy assignment. - * @param x Reference to the object LargeWStringStruct that will be copied. - */ - eProsima_user_DllExport LargeWStringStruct& operator =( - const LargeWStringStruct& x) - { - - m_my_large_wstring = x.m_my_large_wstring; - - return *this; - } - - /*! - * @brief Move assignment. - * @param x Reference to the object LargeWStringStruct that will be copied. - */ - eProsima_user_DllExport LargeWStringStruct& operator =( - LargeWStringStruct&& x) noexcept - { - - m_my_large_wstring = std::move(x.m_my_large_wstring); - return *this; - } - - /*! - * @brief Comparison operator. - * @param x LargeWStringStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const LargeWStringStruct& x) const - { - return (m_my_large_wstring == x.m_my_large_wstring); - } - - /*! - * @brief Comparison operator. - * @param x LargeWStringStruct object to compare. - */ - eProsima_user_DllExport bool 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport const std::wstring& 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 - */ - eProsima_user_DllExport std::wstring& my_large_wstring() - { - return m_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) - { - m_my_array = x.m_my_array; - - } - - /*! - * @brief Move constructor. - * @param x Reference to the object ArrayStruct that will be copied. - */ - eProsima_user_DllExport ArrayStruct( - ArrayStruct&& x) noexcept - { - m_my_array = std::move(x.m_my_array); - } - - /*! - * @brief Copy assignment. - * @param x Reference to the object ArrayStruct that will be copied. - */ - eProsima_user_DllExport ArrayStruct& operator =( - const ArrayStruct& x) - { - - m_my_array = x.m_my_array; - - return *this; - } - - /*! - * @brief Move assignment. - * @param x Reference to the object ArrayStruct that will be copied. - */ - eProsima_user_DllExport ArrayStruct& operator =( - ArrayStruct&& x) noexcept - { - - m_my_array = std::move(x.m_my_array); - return *this; - } - - /*! - * @brief Comparison operator. - * @param x ArrayStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const ArrayStruct& x) const - { - return (m_my_array == x.m_my_array); - } - - /*! - * @brief Comparison operator. - * @param x ArrayStruct object to compare. - */ - eProsima_user_DllExport bool 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport const std::array& my_array() const - { - return m_my_array; - } - - /*! - * @brief This function returns a reference to member my_array - * @return Reference to member my_array - */ - eProsima_user_DllExport std::array& my_array() - { - return m_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) - { - m_my_array_equal = x.m_my_array_equal; - - } - - /*! - * @brief Move constructor. - * @param x Reference to the object ArrayStructEqual that will be copied. - */ - eProsima_user_DllExport ArrayStructEqual( - ArrayStructEqual&& x) noexcept - { - m_my_array_equal = std::move(x.m_my_array_equal); - } - - /*! - * @brief Copy assignment. - * @param x Reference to the object ArrayStructEqual that will be copied. - */ - eProsima_user_DllExport ArrayStructEqual& operator =( - const ArrayStructEqual& x) - { - - m_my_array_equal = x.m_my_array_equal; - - return *this; - } - - /*! - * @brief Move assignment. - * @param x Reference to the object ArrayStructEqual that will be copied. - */ - eProsima_user_DllExport ArrayStructEqual& operator =( - ArrayStructEqual&& x) noexcept - { - - m_my_array_equal = std::move(x.m_my_array_equal); - return *this; - } - - /*! - * @brief Comparison operator. - * @param x ArrayStructEqual object to compare. - */ - eProsima_user_DllExport bool operator ==( - const ArrayStructEqual& x) const - { - return (m_my_array_equal == x.m_my_array_equal); - } - - /*! - * @brief Comparison operator. - * @param x ArrayStructEqual object to compare. - */ - eProsima_user_DllExport bool 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport const std::array& 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 - */ - eProsima_user_DllExport std::array& my_array_equal() - { - return m_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) - { - m_my_array = x.m_my_array; - - } - - /*! - * @brief Move constructor. - * @param x Reference to the object ArrayBadStruct that will be copied. - */ - eProsima_user_DllExport ArrayBadStruct( - ArrayBadStruct&& x) noexcept - { - m_my_array = std::move(x.m_my_array); - } - - /*! - * @brief Copy assignment. - * @param x Reference to the object ArrayBadStruct that will be copied. - */ - eProsima_user_DllExport ArrayBadStruct& operator =( - const ArrayBadStruct& x) - { - - m_my_array = x.m_my_array; - - return *this; - } - - /*! - * @brief Move assignment. - * @param x Reference to the object ArrayBadStruct that will be copied. - */ - eProsima_user_DllExport ArrayBadStruct& operator =( - ArrayBadStruct&& x) noexcept - { - - m_my_array = std::move(x.m_my_array); - return *this; - } - - /*! - * @brief Comparison operator. - * @param x ArrayBadStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const ArrayBadStruct& x) const - { - return (m_my_array == x.m_my_array); - } - - /*! - * @brief Comparison operator. - * @param x ArrayBadStruct object to compare. - */ - eProsima_user_DllExport bool 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport const std::array& my_array() const - { - return m_my_array; - } - - /*! - * @brief This function returns a reference to member my_array - * @return Reference to member my_array - */ - eProsima_user_DllExport std::array& my_array() - { - return m_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) - { - m_my_array = x.m_my_array; - - } - - /*! - * @brief Move constructor. - * @param x Reference to the object ArrayDimensionsStruct that will be copied. - */ - eProsima_user_DllExport ArrayDimensionsStruct( - ArrayDimensionsStruct&& x) noexcept - { - m_my_array = std::move(x.m_my_array); - } - - /*! - * @brief Copy assignment. - * @param x Reference to the object ArrayDimensionsStruct that will be copied. - */ - eProsima_user_DllExport ArrayDimensionsStruct& operator =( - const ArrayDimensionsStruct& x) - { - - m_my_array = x.m_my_array; - - return *this; - } - - /*! - * @brief Move assignment. - * @param x Reference to the object ArrayDimensionsStruct that will be copied. - */ - eProsima_user_DllExport ArrayDimensionsStruct& operator =( - ArrayDimensionsStruct&& x) noexcept - { - - m_my_array = std::move(x.m_my_array); - return *this; - } - - /*! - * @brief Comparison operator. - * @param x ArrayDimensionsStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const ArrayDimensionsStruct& x) const - { - return (m_my_array == x.m_my_array); - } - - /*! - * @brief Comparison operator. - * @param x ArrayDimensionsStruct object to compare. - */ - eProsima_user_DllExport bool 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport const std::array, 2>& my_array() const - { - return m_my_array; - } - - /*! - * @brief This function returns a reference to member my_array - * @return Reference to member my_array - */ - eProsima_user_DllExport std::array, 2>& my_array() - { - return m_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) - { - m_my_array = x.m_my_array; - - } - - /*! - * @brief Move constructor. - * @param x Reference to the object ArraySizeStruct that will be copied. - */ - eProsima_user_DllExport ArraySizeStruct( - ArraySizeStruct&& x) noexcept - { - m_my_array = std::move(x.m_my_array); - } - - /*! - * @brief Copy assignment. - * @param x Reference to the object ArraySizeStruct that will be copied. - */ - eProsima_user_DllExport ArraySizeStruct& operator =( - const ArraySizeStruct& x) - { - - m_my_array = x.m_my_array; - - return *this; - } - - /*! - * @brief Move assignment. - * @param x Reference to the object ArraySizeStruct that will be copied. - */ - eProsima_user_DllExport ArraySizeStruct& operator =( - ArraySizeStruct&& x) noexcept - { - - m_my_array = std::move(x.m_my_array); - return *this; - } - - /*! - * @brief Comparison operator. - * @param x ArraySizeStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const ArraySizeStruct& x) const - { - return (m_my_array == x.m_my_array); - } - - /*! - * @brief Comparison operator. - * @param x ArraySizeStruct object to compare. - */ - eProsima_user_DllExport bool 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport const std::array& my_array() const - { - return m_my_array; - } - - /*! - * @brief This function returns a reference to member my_array - * @return Reference to member my_array - */ - eProsima_user_DllExport std::array& my_array() - { - return m_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) - { - m_my_sequence = x.m_my_sequence; - - } - - /*! - * @brief Move constructor. - * @param x Reference to the object SequenceStruct that will be copied. - */ - eProsima_user_DllExport SequenceStruct( - SequenceStruct&& x) noexcept - { - m_my_sequence = std::move(x.m_my_sequence); - } - - /*! - * @brief Copy assignment. - * @param x Reference to the object SequenceStruct that will be copied. - */ - eProsima_user_DllExport SequenceStruct& operator =( - const SequenceStruct& x) - { - - m_my_sequence = x.m_my_sequence; - - return *this; - } - - /*! - * @brief Move assignment. - * @param x Reference to the object SequenceStruct that will be copied. - */ - eProsima_user_DllExport SequenceStruct& operator =( - SequenceStruct&& x) noexcept - { - - m_my_sequence = std::move(x.m_my_sequence); - return *this; - } - - /*! - * @brief Comparison operator. - * @param x SequenceStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SequenceStruct& x) const - { - return (m_my_sequence == x.m_my_sequence); - } - - /*! - * @brief Comparison operator. - * @param x SequenceStruct object to compare. - */ - eProsima_user_DllExport bool 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport const std::vector& my_sequence() const - { - return m_my_sequence; - } - - /*! - * @brief This function returns a reference to member my_sequence - * @return Reference to member my_sequence - */ - eProsima_user_DllExport std::vector& my_sequence() - { - return m_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) - { - m_my_sequence_equal = x.m_my_sequence_equal; - - } - - /*! - * @brief Move constructor. - * @param x Reference to the object SequenceStructEqual that will be copied. - */ - eProsima_user_DllExport SequenceStructEqual( - SequenceStructEqual&& x) noexcept - { - m_my_sequence_equal = std::move(x.m_my_sequence_equal); - } - - /*! - * @brief Copy assignment. - * @param x Reference to the object SequenceStructEqual that will be copied. - */ - eProsima_user_DllExport SequenceStructEqual& operator =( - const SequenceStructEqual& x) - { - - m_my_sequence_equal = x.m_my_sequence_equal; - - return *this; - } - - /*! - * @brief Move assignment. - * @param x Reference to the object SequenceStructEqual that will be copied. - */ - eProsima_user_DllExport SequenceStructEqual& operator =( - SequenceStructEqual&& x) noexcept - { - - m_my_sequence_equal = std::move(x.m_my_sequence_equal); - return *this; - } - - /*! - * @brief Comparison operator. - * @param x SequenceStructEqual object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SequenceStructEqual& x) const - { - return (m_my_sequence_equal == x.m_my_sequence_equal); - } - - /*! - * @brief Comparison operator. - * @param x SequenceStructEqual object to compare. - */ - eProsima_user_DllExport bool 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport const std::vector& 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 - */ - eProsima_user_DllExport std::vector& my_sequence_equal() - { - return m_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) - { - m_my_sequence = x.m_my_sequence; - - } - - /*! - * @brief Move constructor. - * @param x Reference to the object SequenceBadStruct that will be copied. - */ - eProsima_user_DllExport SequenceBadStruct( - SequenceBadStruct&& x) noexcept - { - m_my_sequence = std::move(x.m_my_sequence); - } - - /*! - * @brief Copy assignment. - * @param x Reference to the object SequenceBadStruct that will be copied. - */ - eProsima_user_DllExport SequenceBadStruct& operator =( - const SequenceBadStruct& x) - { - - m_my_sequence = x.m_my_sequence; - - return *this; - } - - /*! - * @brief Move assignment. - * @param x Reference to the object SequenceBadStruct that will be copied. - */ - eProsima_user_DllExport SequenceBadStruct& operator =( - SequenceBadStruct&& x) noexcept - { - - m_my_sequence = std::move(x.m_my_sequence); - return *this; - } - - /*! - * @brief Comparison operator. - * @param x SequenceBadStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SequenceBadStruct& x) const - { - return (m_my_sequence == x.m_my_sequence); - } - - /*! - * @brief Comparison operator. - * @param x SequenceBadStruct object to compare. - */ - eProsima_user_DllExport bool 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport const std::vector& my_sequence() const - { - return m_my_sequence; - } - - /*! - * @brief This function returns a reference to member my_sequence - * @return Reference to member my_sequence - */ - eProsima_user_DllExport std::vector& my_sequence() - { - return m_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) - { - m_my_sequence = x.m_my_sequence; - - } - - /*! - * @brief Move constructor. - * @param x Reference to the object SequenceBoundsStruct that will be copied. - */ - eProsima_user_DllExport SequenceBoundsStruct( - SequenceBoundsStruct&& x) noexcept - { - m_my_sequence = std::move(x.m_my_sequence); - } - - /*! - * @brief Copy assignment. - * @param x Reference to the object SequenceBoundsStruct that will be copied. - */ - eProsima_user_DllExport SequenceBoundsStruct& operator =( - const SequenceBoundsStruct& x) - { - - m_my_sequence = x.m_my_sequence; - - return *this; - } - - /*! - * @brief Move assignment. - * @param x Reference to the object SequenceBoundsStruct that will be copied. - */ - eProsima_user_DllExport SequenceBoundsStruct& operator =( - SequenceBoundsStruct&& x) noexcept - { - - m_my_sequence = std::move(x.m_my_sequence); - return *this; - } - - /*! - * @brief Comparison operator. - * @param x SequenceBoundsStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SequenceBoundsStruct& x) const - { - return (m_my_sequence == x.m_my_sequence); - } - - /*! - * @brief Comparison operator. - * @param x SequenceBoundsStruct object to compare. - */ - eProsima_user_DllExport bool 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport const std::vector& my_sequence() const - { - return m_my_sequence; - } - - /*! - * @brief This function returns a reference to member my_sequence - * @return Reference to member my_sequence - */ - eProsima_user_DllExport std::vector& my_sequence() - { - return m_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) - { - m_my_sequence_sequence = x.m_my_sequence_sequence; - - } - - /*! - * @brief Move constructor. - * @param x Reference to the object SequenceSequenceStruct that will be copied. - */ - eProsima_user_DllExport SequenceSequenceStruct( - SequenceSequenceStruct&& x) noexcept - { - m_my_sequence_sequence = std::move(x.m_my_sequence_sequence); - } - - /*! - * @brief Copy assignment. - * @param x Reference to the object SequenceSequenceStruct that will be copied. - */ - eProsima_user_DllExport SequenceSequenceStruct& operator =( - const SequenceSequenceStruct& x) - { - - m_my_sequence_sequence = x.m_my_sequence_sequence; - - return *this; - } - - /*! - * @brief Move assignment. - * @param x Reference to the object SequenceSequenceStruct that will be copied. - */ - eProsima_user_DllExport SequenceSequenceStruct& operator =( - SequenceSequenceStruct&& x) noexcept - { - - m_my_sequence_sequence = std::move(x.m_my_sequence_sequence); - return *this; - } - - /*! - * @brief Comparison operator. - * @param x SequenceSequenceStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SequenceSequenceStruct& x) const - { - return (m_my_sequence_sequence == x.m_my_sequence_sequence); - } - - /*! - * @brief Comparison operator. - * @param x SequenceSequenceStruct object to compare. - */ - eProsima_user_DllExport bool 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport const std::vector>& 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 - */ - eProsima_user_DllExport std::vector>& my_sequence_sequence() - { - return m_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) - { - m_my_sequence_sequence = x.m_my_sequence_sequence; - - } - - /*! - * @brief Move constructor. - * @param x Reference to the object SequenceSequenceBoundsStruct that will be copied. - */ - eProsima_user_DllExport SequenceSequenceBoundsStruct( - SequenceSequenceBoundsStruct&& x) noexcept - { - m_my_sequence_sequence = std::move(x.m_my_sequence_sequence); - } - - /*! - * @brief Copy assignment. - * @param x Reference to the object SequenceSequenceBoundsStruct that will be copied. - */ - eProsima_user_DllExport SequenceSequenceBoundsStruct& operator =( - const SequenceSequenceBoundsStruct& x) - { - - m_my_sequence_sequence = x.m_my_sequence_sequence; - - return *this; - } - - /*! - * @brief Move assignment. - * @param x Reference to the object SequenceSequenceBoundsStruct that will be copied. - */ - eProsima_user_DllExport SequenceSequenceBoundsStruct& operator =( - SequenceSequenceBoundsStruct&& x) noexcept - { - - m_my_sequence_sequence = std::move(x.m_my_sequence_sequence); - return *this; - } - - /*! - * @brief Comparison operator. - * @param x SequenceSequenceBoundsStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SequenceSequenceBoundsStruct& x) const - { - return (m_my_sequence_sequence == x.m_my_sequence_sequence); - } - - /*! - * @brief Comparison operator. - * @param x SequenceSequenceBoundsStruct object to compare. - */ - eProsima_user_DllExport bool 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport const std::vector>& 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 - */ - eProsima_user_DllExport std::vector>& my_sequence_sequence() - { - return m_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) - { - m_my_map = x.m_my_map; - - } - - /*! - * @brief Move constructor. - * @param x Reference to the object MapStruct that will be copied. - */ - eProsima_user_DllExport MapStruct( - MapStruct&& x) noexcept - { - m_my_map = std::move(x.m_my_map); - } - - /*! - * @brief Copy assignment. - * @param x Reference to the object MapStruct that will be copied. - */ - eProsima_user_DllExport MapStruct& operator =( - const MapStruct& x) - { - - m_my_map = x.m_my_map; - - return *this; - } - - /*! - * @brief Move assignment. - * @param x Reference to the object MapStruct that will be copied. - */ - eProsima_user_DllExport MapStruct& operator =( - MapStruct&& x) noexcept - { - - m_my_map = std::move(x.m_my_map); - return *this; - } - - /*! - * @brief Comparison operator. - * @param x MapStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MapStruct& x) const - { - return (m_my_map == x.m_my_map); - } - - /*! - * @brief Comparison operator. - * @param x MapStruct object to compare. - */ - eProsima_user_DllExport bool 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport const std::map& my_map() const - { - return m_my_map; - } - - /*! - * @brief This function returns a reference to member my_map - * @return Reference to member my_map - */ - eProsima_user_DllExport std::map& my_map() - { - return m_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) - { - m_my_map_equal = x.m_my_map_equal; - - } - - /*! - * @brief Move constructor. - * @param x Reference to the object MapStructEqual that will be copied. - */ - eProsima_user_DllExport MapStructEqual( - MapStructEqual&& x) noexcept - { - m_my_map_equal = std::move(x.m_my_map_equal); - } - - /*! - * @brief Copy assignment. - * @param x Reference to the object MapStructEqual that will be copied. - */ - eProsima_user_DllExport MapStructEqual& operator =( - const MapStructEqual& x) - { - - m_my_map_equal = x.m_my_map_equal; - - return *this; - } - - /*! - * @brief Move assignment. - * @param x Reference to the object MapStructEqual that will be copied. - */ - eProsima_user_DllExport MapStructEqual& operator =( - MapStructEqual&& x) noexcept - { - - m_my_map_equal = std::move(x.m_my_map_equal); - return *this; - } - - /*! - * @brief Comparison operator. - * @param x MapStructEqual object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MapStructEqual& x) const - { - return (m_my_map_equal == x.m_my_map_equal); - } - - /*! - * @brief Comparison operator. - * @param x MapStructEqual object to compare. - */ - eProsima_user_DllExport bool 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport const std::map& 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 - */ - eProsima_user_DllExport std::map& my_map_equal() - { - return m_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) - { - m_my_map = x.m_my_map; - - } - - /*! - * @brief Move constructor. - * @param x Reference to the object MapBadKeyStruct that will be copied. - */ - eProsima_user_DllExport MapBadKeyStruct( - MapBadKeyStruct&& x) noexcept - { - m_my_map = std::move(x.m_my_map); - } - - /*! - * @brief Copy assignment. - * @param x Reference to the object MapBadKeyStruct that will be copied. - */ - eProsima_user_DllExport MapBadKeyStruct& operator =( - const MapBadKeyStruct& x) - { - - m_my_map = x.m_my_map; - - return *this; - } - - /*! - * @brief Move assignment. - * @param x Reference to the object MapBadKeyStruct that will be copied. - */ - eProsima_user_DllExport MapBadKeyStruct& operator =( - MapBadKeyStruct&& x) noexcept - { - - m_my_map = std::move(x.m_my_map); - return *this; - } - - /*! - * @brief Comparison operator. - * @param x MapBadKeyStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MapBadKeyStruct& x) const - { - return (m_my_map == x.m_my_map); - } - - /*! - * @brief Comparison operator. - * @param x MapBadKeyStruct object to compare. - */ - eProsima_user_DllExport bool 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport const std::map& my_map() const - { - return m_my_map; - } - - /*! - * @brief This function returns a reference to member my_map - * @return Reference to member my_map - */ - eProsima_user_DllExport std::map& my_map() - { - return m_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) - { - m_my_map = x.m_my_map; - - } - - /*! - * @brief Move constructor. - * @param x Reference to the object MapBadElemStruct that will be copied. - */ - eProsima_user_DllExport MapBadElemStruct( - MapBadElemStruct&& x) noexcept - { - m_my_map = std::move(x.m_my_map); - } - - /*! - * @brief Copy assignment. - * @param x Reference to the object MapBadElemStruct that will be copied. - */ - eProsima_user_DllExport MapBadElemStruct& operator =( - const MapBadElemStruct& x) - { - - m_my_map = x.m_my_map; - - return *this; - } - - /*! - * @brief Move assignment. - * @param x Reference to the object MapBadElemStruct that will be copied. - */ - eProsima_user_DllExport MapBadElemStruct& operator =( - MapBadElemStruct&& x) noexcept - { - - m_my_map = std::move(x.m_my_map); - return *this; - } - - /*! - * @brief Comparison operator. - * @param x MapBadElemStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MapBadElemStruct& x) const - { - return (m_my_map == x.m_my_map); - } - - /*! - * @brief Comparison operator. - * @param x MapBadElemStruct object to compare. - */ - eProsima_user_DllExport bool 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport const std::map& my_map() const - { - return m_my_map; - } - - /*! - * @brief This function returns a reference to member my_map - * @return Reference to member my_map - */ - eProsima_user_DllExport std::map& my_map() - { - return m_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) - { - m_my_map = x.m_my_map; - - } - - /*! - * @brief Move constructor. - * @param x Reference to the object MapBoundsStruct that will be copied. - */ - eProsima_user_DllExport MapBoundsStruct( - MapBoundsStruct&& x) noexcept - { - m_my_map = std::move(x.m_my_map); - } - - /*! - * @brief Copy assignment. - * @param x Reference to the object MapBoundsStruct that will be copied. - */ - eProsima_user_DllExport MapBoundsStruct& operator =( - const MapBoundsStruct& x) - { - - m_my_map = x.m_my_map; - - return *this; - } - - /*! - * @brief Move assignment. - * @param x Reference to the object MapBoundsStruct that will be copied. - */ - eProsima_user_DllExport MapBoundsStruct& operator =( - MapBoundsStruct&& x) noexcept - { - - m_my_map = std::move(x.m_my_map); - return *this; - } - - /*! - * @brief Comparison operator. - * @param x MapBoundsStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MapBoundsStruct& x) const - { - return (m_my_map == x.m_my_map); - } - - /*! - * @brief Comparison operator. - * @param x MapBoundsStruct object to compare. - */ - eProsima_user_DllExport bool 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport const std::map& my_map() const - { - return m_my_map; - } - - /*! - * @brief This function returns a reference to member my_map - * @return Reference to member my_map - */ - eProsima_user_DllExport std::map& my_map() - { - return m_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) - { - m_my_map_map = x.m_my_map_map; - - } - - /*! - * @brief Move constructor. - * @param x Reference to the object MapMapStruct that will be copied. - */ - eProsima_user_DllExport MapMapStruct( - MapMapStruct&& x) noexcept - { - m_my_map_map = std::move(x.m_my_map_map); - } - - /*! - * @brief Copy assignment. - * @param x Reference to the object MapMapStruct that will be copied. - */ - eProsima_user_DllExport MapMapStruct& operator =( - const MapMapStruct& x) - { - - m_my_map_map = x.m_my_map_map; - - return *this; - } - - /*! - * @brief Move assignment. - * @param x Reference to the object MapMapStruct that will be copied. - */ - eProsima_user_DllExport MapMapStruct& operator =( - MapMapStruct&& x) noexcept - { - - m_my_map_map = std::move(x.m_my_map_map); - return *this; - } - - /*! - * @brief Comparison operator. - * @param x MapMapStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MapMapStruct& x) const - { - return (m_my_map_map == x.m_my_map_map); - } - - /*! - * @brief Comparison operator. - * @param x MapMapStruct object to compare. - */ - eProsima_user_DllExport bool 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport const std::map>& 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 - */ - eProsima_user_DllExport std::map>& my_map_map() - { - return m_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) - { - m_my_map_map = x.m_my_map_map; - - } - - /*! - * @brief Move constructor. - * @param x Reference to the object MapMapBoundsStruct that will be copied. - */ - eProsima_user_DllExport MapMapBoundsStruct( - MapMapBoundsStruct&& x) noexcept - { - m_my_map_map = std::move(x.m_my_map_map); - } - - /*! - * @brief Copy assignment. - * @param x Reference to the object MapMapBoundsStruct that will be copied. - */ - eProsima_user_DllExport MapMapBoundsStruct& operator =( - const MapMapBoundsStruct& x) - { - - m_my_map_map = x.m_my_map_map; - - return *this; - } - - /*! - * @brief Move assignment. - * @param x Reference to the object MapMapBoundsStruct that will be copied. - */ - eProsima_user_DllExport MapMapBoundsStruct& operator =( - MapMapBoundsStruct&& x) noexcept - { - - m_my_map_map = std::move(x.m_my_map_map); - return *this; - } - - /*! - * @brief Comparison operator. - * @param x MapMapBoundsStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MapMapBoundsStruct& x) const - { - return (m_my_map_map == x.m_my_map_map); - } - - /*! - * @brief Comparison operator. - * @param x MapMapBoundsStruct object to compare. - */ - eProsima_user_DllExport bool 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport const std::map>& 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 - */ - eProsima_user_DllExport std::map>& my_map_map() - { - return m_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() - { - m__d = 0; - } - - /*! - * @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) - { - 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; - } - } - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleUnion that will be copied. - */ - eProsima_user_DllExport SimpleUnion( - SimpleUnion&& 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; - } - } - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleUnion that will be copied. - */ - eProsima_user_DllExport SimpleUnion& operator =( - const SimpleUnion& 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; - } - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleUnion that will be copied. - */ - eProsima_user_DllExport SimpleUnion& operator =( - SimpleUnion&& 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; - } - - /*! - * @brief Comparison operator. - * @param x SimpleUnion object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleUnion& 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; - } - - /*! - * @brief Comparison operator. - * @param x SimpleUnion object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimpleUnion& 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( - int32_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 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 int32_t _d() const - { - return m__d; - } - - /*! - * @brief This function returns a reference to the discriminator. - * @return Reference to the discriminator. - */ - eProsima_user_DllExport int32_t& _d() - { - return m__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) - { - m_first = _first; - m__d = 0; - - } - - /*! - * @brief This function returns the value of member first - * @return Value of member first - * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t first() const - { - bool b = false; - - switch (m__d) - { - case 0: - b = true; - break; - default: - break; - } - - if (!b) - { - throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); - } - - return m_first; - } - - /*! - * @brief This function returns a reference to member first - * @return Reference to member first - * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t& first() - { - bool b = false; - - switch (m__d) - { - case 0: - b = true; - break; - default: - break; - } - - if (!b) - { - throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); - } - - return m_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) - { - m_second = _second; - m__d = 1; - - } - - /*! - * @brief This function returns the value of member second - * @return Value of member second - * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t second() const - { - bool b = false; - - switch (m__d) - { - case 1: - b = true; - break; - default: - break; - } - - if (!b) - { - throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); - } - - return m_second; - } - - /*! - * @brief This function returns a reference to member second - * @return Reference to member second - * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t& second() - { - bool b = false; - - switch (m__d) - { - case 1: - b = true; - break; - default: - break; - } - - if (!b) - { - throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); - } - - return m_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() - { - m__d = 0; - } - - /*! - * @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) - { - m__d = x.m__d; - - switch (m__d) - { - case 0: - m_first_case = x.m_first_case; - break; - - - case 1: - m_second_case = x.m_second_case; - break; - - default: - break; - } - } - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleUnionNames that will be copied. - */ - eProsima_user_DllExport SimpleUnionNames( - SimpleUnionNames&& x) noexcept - { - m__d = x.m__d; - - switch (m__d) - { - case 0: - m_first_case = x.m_first_case; - break; - - - case 1: - m_second_case = x.m_second_case; - break; - - default: - break; - } - } - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleUnionNames that will be copied. - */ - eProsima_user_DllExport SimpleUnionNames& operator =( - const SimpleUnionNames& x) - { - m__d = x.m__d; - - switch (m__d) - { - case 0: - m_first_case = x.m_first_case; - break; - - - case 1: - m_second_case = x.m_second_case; - break; - - default: - break; - } - - return *this; - } - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleUnionNames that will be copied. - */ - eProsima_user_DllExport SimpleUnionNames& operator =( - SimpleUnionNames&& x) noexcept - { - m__d = x.m__d; - - switch (m__d) - { - case 0: - m_first_case = x.m_first_case; - break; - - - case 1: - m_second_case = x.m_second_case; - break; - - default: - break; - } - - return *this; - } - - /*! - * @brief Comparison operator. - * @param x SimpleUnionNames object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleUnionNames& x) const - { - if (m__d != x.m__d) - { - return false; - } - - switch (m__d) - { - case 0: - return (m_first_case == x.m_first_case); - break; - - - case 1: - return (m_second_case == x.m_second_case); - break; - - default: - break; - } - return false; - } - - /*! - * @brief Comparison operator. - * @param x SimpleUnionNames object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimpleUnionNames& 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( - int32_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 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 int32_t _d() const - { - return m__d; - } - - /*! - * @brief This function returns a reference to the discriminator. - * @return Reference to the discriminator. - */ - eProsima_user_DllExport int32_t& _d() - { - return m__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) - { - m_first_case = _first_case; - m__d = 0; - - } - - /*! - * @brief This function returns the value of member first_case - * @return Value of member first_case - * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t first_case() const - { - bool b = false; - - switch (m__d) - { - case 0: - b = true; - break; - default: - break; - } - - if (!b) - { - throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); - } - - return m_first_case; - } - - /*! - * @brief This function returns a reference to member first_case - * @return Reference to member first_case - * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t& first_case() - { - bool b = false; - - switch (m__d) - { - case 0: - b = true; - break; - default: - break; - } - - if (!b) - { - throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); - } - - return m_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) - { - m_second_case = _second_case; - m__d = 1; - - } - - /*! - * @brief This function returns the value of member second_case - * @return Value of member second_case - * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t second_case() const - { - bool b = false; - - switch (m__d) - { - case 1: - b = true; - break; - default: - break; - } - - if (!b) - { - throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); - } - - return m_second_case; - } - - /*! - * @brief This function returns a reference to member second_case - * @return Reference to member second_case - * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t& second_case() - { - bool b = false; - - switch (m__d) - { - case 1: - b = true; - break; - default: - break; - } - - if (!b) - { - throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); - } - - return m_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() - { - m__d = 0; - } - - /*! - * @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) - { - 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; - } - } - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleTypeUnion that will be copied. - */ - eProsima_user_DllExport SimpleTypeUnion( - SimpleTypeUnion&& 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; - } - } - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleTypeUnion that will be copied. - */ - eProsima_user_DllExport SimpleTypeUnion& operator =( - const SimpleTypeUnion& 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; - } - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleTypeUnion that will be copied. - */ - eProsima_user_DllExport SimpleTypeUnion& operator =( - SimpleTypeUnion&& 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; - } - - /*! - * @brief Comparison operator. - * @param x SimpleTypeUnion object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleTypeUnion& 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; - } - - /*! - * @brief Comparison operator. - * @param x SimpleTypeUnion object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimpleTypeUnion& 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( - int32_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 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 int32_t _d() const - { - return m__d; - } - - /*! - * @brief This function returns a reference to the discriminator. - * @return Reference to the discriminator. - */ - eProsima_user_DllExport int32_t& _d() - { - return m__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) - { - m_first = _first; - m__d = 0; - - } - - /*! - * @brief This function returns the value of member first - * @return Value of member first - * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport uint8_t first() const - { - bool b = false; - - switch (m__d) - { - case 0: - b = true; - break; - default: - break; - } - - if (!b) - { - throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); - } - - return m_first; - } - - /*! - * @brief This function returns a reference to member first - * @return Reference to member first - * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport uint8_t& first() - { - bool b = false; - - switch (m__d) - { - case 0: - b = true; - break; - default: - break; - } - - if (!b) - { - throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); - } - - return m_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) - { - m_second = _second; - m__d = 1; - - } - - /*! - * @brief This function returns the value of member second - * @return Value of member second - * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t second() const - { - bool b = false; - - switch (m__d) - { - case 1: - b = true; - break; - default: - break; - } - - if (!b) - { - throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); - } - - return m_second; - } - - /*! - * @brief This function returns a reference to member second - * @return Reference to member second - * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t& second() - { - bool b = false; - - switch (m__d) - { - case 1: - b = true; - break; - default: - break; - } - - if (!b) - { - throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); - } - - return m_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() - { - m__d = 0; - } - - /*! - * @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) - { - m__d = x.m__d; - - switch (m__d) - { - case 0: - m_first = x.m_first; - break; - - - case 2: - m_second = x.m_second; - break; - - default: - break; - } - } - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleBadUnion that will be copied. - */ - eProsima_user_DllExport SimpleBadUnion( - SimpleBadUnion&& x) noexcept - { - m__d = x.m__d; - - switch (m__d) - { - case 0: - m_first = x.m_first; - break; - - - case 2: - m_second = x.m_second; - break; - - default: - break; - } - } - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleBadUnion that will be copied. - */ - eProsima_user_DllExport SimpleBadUnion& operator =( - const SimpleBadUnion& x) - { - m__d = x.m__d; - - switch (m__d) - { - case 0: - m_first = x.m_first; - break; - - - case 2: - m_second = x.m_second; - break; - - default: - break; - } - - return *this; - } - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleBadUnion that will be copied. - */ - eProsima_user_DllExport SimpleBadUnion& operator =( - SimpleBadUnion&& x) noexcept - { - m__d = x.m__d; - - switch (m__d) - { - case 0: - m_first = x.m_first; - break; - - - case 2: - m_second = x.m_second; - break; - - default: - break; - } - - return *this; - } - - /*! - * @brief Comparison operator. - * @param x SimpleBadUnion object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleBadUnion& x) const - { - if (m__d != x.m__d) - { - return false; - } - - switch (m__d) - { - case 0: - return (m_first == x.m_first); - break; - - - case 2: - return (m_second == x.m_second); - break; - - default: - break; - } - return false; - } - - /*! - * @brief Comparison operator. - * @param x SimpleBadUnion object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimpleBadUnion& 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( - int32_t __d) - { - bool b = false; - - switch (m__d) - { - case 0: - switch (__d) - { - case 0: - b = true; - break; - default: - break; - } - break; - - - case 2: - switch (__d) - { - case 2: - b = true; - break; - default: - break; - } - break; - - default: - break; - } - - if (!b) - { - 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 int32_t _d() const - { - return m__d; - } - - /*! - * @brief This function returns a reference to the discriminator. - * @return Reference to the discriminator. - */ - eProsima_user_DllExport int32_t& _d() - { - return m__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) - { - m_first = _first; - m__d = 0; - - } - - /*! - * @brief This function returns the value of member first - * @return Value of member first - * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t first() const - { - bool b = false; - - switch (m__d) - { - case 0: - b = true; - break; - default: - break; - } - - if (!b) - { - throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); - } - - return m_first; - } - - /*! - * @brief This function returns a reference to member first - * @return Reference to member first - * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t& first() - { - bool b = false; - - switch (m__d) - { - case 0: - b = true; - break; - default: - break; - } - - if (!b) - { - throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); - } - - return m_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) - { - m_second = _second; - m__d = 2; - - } - - /*! - * @brief This function returns the value of member second - * @return Value of member second - * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t second() const - { - bool b = false; - - switch (m__d) - { - case 2: - b = true; - break; - default: - break; - } - - if (!b) - { - throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); - } - - return m_second; - } - - /*! - * @brief This function returns a reference to member second - * @return Reference to member second - * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t& second() - { - bool b = false; - - switch (m__d) - { - case 2: - b = true; - break; - default: - break; - } - - if (!b) - { - throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); - } - - return m_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() - { - m__d = 0; - } - - /*! - * @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) - { - 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; - } - } - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleBadDiscUnion that will be copied. - */ - eProsima_user_DllExport 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; - } - } - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleBadDiscUnion that will be copied. - */ - eProsima_user_DllExport 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; - } - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleBadDiscUnion that will be copied. - */ - eProsima_user_DllExport 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; - } - - /*! - * @brief Comparison operator. - * @param x SimpleBadDiscUnion object to compare. - */ - eProsima_user_DllExport bool 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; - } - - /*! - * @brief Comparison operator. - * @param x SimpleBadDiscUnion object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimpleBadDiscUnion& 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 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 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 returns a reference to the discriminator. - * @return Reference to the discriminator. - */ - eProsima_user_DllExport uint8_t& _d() - { - return m__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) - { - m_first = _first; - m__d = 0; - - } - - /*! - * @brief This function returns the value of member first - * @return Value of member first - * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t first() const - { - bool b = false; - - switch (m__d) - { - case 0: - b = true; - break; - default: - break; - } - - if (!b) - { - throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); - } - - return m_first; - } - - /*! - * @brief This function returns a reference to member first - * @return Reference to member first - * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t& first() - { - bool b = false; - - switch (m__d) - { - case 0: - b = true; - break; - default: - break; - } - - if (!b) - { - throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); - } - - return m_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) - { - m_second = _second; - m__d = 1; - - } - - /*! - * @brief This function returns the value of member second - * @return Value of member second - * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t second() const - { - bool b = false; - - switch (m__d) - { - case 1: - b = true; - break; - default: - break; - } - - if (!b) - { - throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); - } - - return m_second; - } - - /*! - * @brief This function returns a reference to member second - * @return Reference to member second - * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t& second() - { - bool b = false; - - switch (m__d) - { - case 1: - b = true; - break; - default: - break; - } - - if (!b) - { - throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); - } - - return m_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) - { - m_my_union = x.m_my_union; - - } - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleUnionStruct( - SimpleUnionStruct&& x) noexcept - { - m_my_union = std::move(x.m_my_union); - } - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleUnionStruct& operator =( - const SimpleUnionStruct& x) - { - - m_my_union = x.m_my_union; - - return *this; - } - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleUnionStruct& operator =( - SimpleUnionStruct&& x) noexcept - { - - m_my_union = std::move(x.m_my_union); - return *this; - } - - /*! - * @brief Comparison operator. - * @param x SimpleUnionStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleUnionStruct& x) const - { - return (m_my_union == x.m_my_union); - } - - /*! - * @brief Comparison operator. - * @param x SimpleUnionStruct object to compare. - */ - eProsima_user_DllExport bool 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport const SimpleUnion& my_union() const - { - return m_my_union; - } - - /*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ - eProsima_user_DllExport SimpleUnion& my_union() - { - return m_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) - { - m_my_union_equal = x.m_my_union_equal; - - } - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleUnionStructEqual that will be copied. - */ - eProsima_user_DllExport SimpleUnionStructEqual( - SimpleUnionStructEqual&& x) noexcept - { - m_my_union_equal = std::move(x.m_my_union_equal); - } - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleUnionStructEqual that will be copied. - */ - eProsima_user_DllExport SimpleUnionStructEqual& operator =( - const SimpleUnionStructEqual& x) - { - - m_my_union_equal = x.m_my_union_equal; - - return *this; - } - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleUnionStructEqual that will be copied. - */ - eProsima_user_DllExport SimpleUnionStructEqual& operator =( - SimpleUnionStructEqual&& x) noexcept - { - - m_my_union_equal = std::move(x.m_my_union_equal); - return *this; - } - - /*! - * @brief Comparison operator. - * @param x SimpleUnionStructEqual object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleUnionStructEqual& x) const - { - return (m_my_union_equal == x.m_my_union_equal); - } - - /*! - * @brief Comparison operator. - * @param x SimpleUnionStructEqual object to compare. - */ - eProsima_user_DllExport bool 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport const SimpleUnion& 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 - */ - eProsima_user_DllExport SimpleUnion& my_union_equal() - { - return m_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) - { - m_my_union = x.m_my_union; - - } - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleUnionNamesStruct that will be copied. - */ - eProsima_user_DllExport SimpleUnionNamesStruct( - SimpleUnionNamesStruct&& x) noexcept - { - m_my_union = std::move(x.m_my_union); - } - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleUnionNamesStruct that will be copied. - */ - eProsima_user_DllExport SimpleUnionNamesStruct& operator =( - const SimpleUnionNamesStruct& x) - { - - m_my_union = x.m_my_union; - - return *this; - } - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleUnionNamesStruct that will be copied. - */ - eProsima_user_DllExport SimpleUnionNamesStruct& operator =( - SimpleUnionNamesStruct&& x) noexcept - { - - m_my_union = std::move(x.m_my_union); - return *this; - } - - /*! - * @brief Comparison operator. - * @param x SimpleUnionNamesStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleUnionNamesStruct& x) const - { - return (m_my_union == x.m_my_union); - } - - /*! - * @brief Comparison operator. - * @param x SimpleUnionNamesStruct object to compare. - */ - eProsima_user_DllExport bool 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport const SimpleUnionNames& my_union() const - { - return m_my_union; - } - - /*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ - eProsima_user_DllExport SimpleUnionNames& my_union() - { - return m_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) - { - m_my_union = x.m_my_union; - - } - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleTypeUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleTypeUnionStruct( - SimpleTypeUnionStruct&& x) noexcept - { - m_my_union = std::move(x.m_my_union); - } - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleTypeUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleTypeUnionStruct& operator =( - const SimpleTypeUnionStruct& x) - { - - m_my_union = x.m_my_union; - - return *this; - } - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleTypeUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleTypeUnionStruct& operator =( - SimpleTypeUnionStruct&& x) noexcept - { - - m_my_union = std::move(x.m_my_union); - return *this; - } - - /*! - * @brief Comparison operator. - * @param x SimpleTypeUnionStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleTypeUnionStruct& x) const - { - return (m_my_union == x.m_my_union); - } - - /*! - * @brief Comparison operator. - * @param x SimpleTypeUnionStruct object to compare. - */ - eProsima_user_DllExport bool 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport const SimpleTypeUnion& my_union() const - { - return m_my_union; - } - - /*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ - eProsima_user_DllExport SimpleTypeUnion& my_union() - { - return m_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) - { - m_my_union = x.m_my_union; - - } - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleBadUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleBadUnionStruct( - SimpleBadUnionStruct&& x) noexcept - { - m_my_union = std::move(x.m_my_union); - } - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleBadUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleBadUnionStruct& operator =( - const SimpleBadUnionStruct& x) - { - - m_my_union = x.m_my_union; - - return *this; - } - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleBadUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleBadUnionStruct& operator =( - SimpleBadUnionStruct&& x) noexcept - { - - m_my_union = std::move(x.m_my_union); - return *this; - } - - /*! - * @brief Comparison operator. - * @param x SimpleBadUnionStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleBadUnionStruct& x) const - { - return (m_my_union == x.m_my_union); - } - - /*! - * @brief Comparison operator. - * @param x SimpleBadUnionStruct object to compare. - */ - eProsima_user_DllExport bool 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport const SimpleBadUnion& my_union() const - { - return m_my_union; - } - - /*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ - eProsima_user_DllExport SimpleBadUnion& my_union() - { - return m_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) - { - m_my_union = x.m_my_union; - - } - - /*! - * @brief Move constructor. - * @param x Reference to the object SimplBadDiscUnionStruct that will be copied. - */ - eProsima_user_DllExport SimplBadDiscUnionStruct( - SimplBadDiscUnionStruct&& x) noexcept - { - m_my_union = std::move(x.m_my_union); - } - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimplBadDiscUnionStruct that will be copied. - */ - eProsima_user_DllExport SimplBadDiscUnionStruct& operator =( - const SimplBadDiscUnionStruct& x) - { - - m_my_union = x.m_my_union; - - return *this; - } - - /*! - * @brief Move assignment. - * @param x Reference to the object SimplBadDiscUnionStruct that will be copied. - */ - eProsima_user_DllExport SimplBadDiscUnionStruct& operator =( - SimplBadDiscUnionStruct&& x) noexcept - { - - m_my_union = std::move(x.m_my_union); - return *this; - } - - /*! - * @brief Comparison operator. - * @param x SimplBadDiscUnionStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimplBadDiscUnionStruct& x) const - { - return (m_my_union == x.m_my_union); - } - - /*! - * @brief Comparison operator. - * @param x SimplBadDiscUnionStruct object to compare. - */ - eProsima_user_DllExport bool 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport const SimpleBadDiscUnion& my_union() const - { - return m_my_union; - } - - /*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ - eProsima_user_DllExport SimpleBadDiscUnion& my_union() - { - return m_my_union; - } - - - -private: - - SimpleBadDiscUnion m_my_union; - -}; - -#endif // _FAST_DDS_GENERATED_TYPES_HPP_ - - diff --git a/test/unittest/xtypes/idl/Types.idl b/test/unittest/xtypes/idl/Types.idl deleted file mode 100644 index 2c8c143215b..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 0: - long first; - case 1: - long long second; -}; - -union SimpleUnionNames switch (long) -{ - case 0: - long first_case; - case 1: - long long second_case; -}; - -union SimpleTypeUnion switch (long) -{ - case 0: - octet first; - case 1: - long long second; -}; - -union SimpleBadUnion switch (long) -{ - case 0: - long first; - case 2: - 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; -}; diff --git a/test/unittest/xtypes/idl/TypesCdrAux.hpp b/test/unittest/xtypes/idl/TypesCdrAux.hpp deleted file mode 100644 index a4547c67e30..00000000000 --- a/test/unittest/xtypes/idl/TypesCdrAux.hpp +++ /dev/null @@ -1,305 +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.hpp" - -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 035dbf9a6e3..00000000000 --- a/test/unittest/xtypes/idl/TypesCdrAux.ipp +++ /dev/null @@ -1,3426 +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 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 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 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, - 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 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 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 0: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.first_case(), current_alignment); - break; - - case 1: - 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 0: - scdr << eprosima::fastcdr::MemberId(1) << data.first_case(); - break; - - case 1: - 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 0: - dcdr >> data.first_case(); - break; - - case 1: - 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 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 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 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, - 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 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 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 0: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.first(), current_alignment); - break; - - case 2: - 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 0: - scdr << eprosima::fastcdr::MemberId(1) << data.first(); - break; - - case 2: - 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 0: - dcdr >> data.first(); - break; - - case 2: - 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 58d4eebd201..00000000000 --- a/test/unittest/xtypes/idl/TypesPubSubTypes.cxx +++ /dev/null @@ -1,6990 +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 "TypesPubSubTypes.h" - -#include -#include - -#include "TypesCdrAux.hpp" -#include "TypesTypeObjectSupport.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; -} - -void MyEnumStructPubSubType::register_type_object_representation() const -{ - register_Types_type_objects(); -} - -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; -} - -void MyBadEnumStructPubSubType::register_type_object_representation() const -{ - register_Types_type_objects(); -} - - -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; -} - -void MyAliasEnumStructPubSubType::register_type_object_representation() const -{ - register_Types_type_objects(); -} - -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; -} - -void BasicStructPubSubType::register_type_object_representation() const -{ - register_Types_type_objects(); -} - -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; -} - -void BasicNamesStructPubSubType::register_type_object_representation() const -{ - register_Types_type_objects(); -} - -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; -} - -void BasicBadStructPubSubType::register_type_object_representation() const -{ - register_Types_type_objects(); -} - -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; -} - -void BasicWideStructPubSubType::register_type_object_representation() const -{ - register_Types_type_objects(); -} - -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; -} - -void BadBasicWideStructPubSubType::register_type_object_representation() const -{ - register_Types_type_objects(); -} - -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; -} - -void StringStructPubSubType::register_type_object_representation() const -{ - register_Types_type_objects(); -} - -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; -} - -void LargeStringStructPubSubType::register_type_object_representation() const -{ - register_Types_type_objects(); -} - -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; -} - -void WStringStructPubSubType::register_type_object_representation() const -{ - register_Types_type_objects(); -} - -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; -} - -void LargeWStringStructPubSubType::register_type_object_representation() const -{ - register_Types_type_objects(); -} - -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; -} - -void ArrayStructPubSubType::register_type_object_representation() const -{ - register_Types_type_objects(); -} - -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; -} - -void ArrayStructEqualPubSubType::register_type_object_representation() const -{ - register_Types_type_objects(); -} - -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; -} - -void ArrayBadStructPubSubType::register_type_object_representation() const -{ - register_Types_type_objects(); -} - -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; -} - -void ArrayDimensionsStructPubSubType::register_type_object_representation() const -{ - register_Types_type_objects(); -} - -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; -} - -void ArraySizeStructPubSubType::register_type_object_representation() const -{ - register_Types_type_objects(); -} - -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; -} - -void SequenceStructPubSubType::register_type_object_representation() const -{ - register_Types_type_objects(); -} - -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; -} - -void SequenceStructEqualPubSubType::register_type_object_representation() const -{ - register_Types_type_objects(); -} - -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; -} - -void SequenceBadStructPubSubType::register_type_object_representation() const -{ - register_Types_type_objects(); -} - -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; -} - -void SequenceBoundsStructPubSubType::register_type_object_representation() const -{ - register_Types_type_objects(); -} - -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; -} - -void SequenceSequenceStructPubSubType::register_type_object_representation() const -{ - register_Types_type_objects(); -} - -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; -} - -void SequenceSequenceBoundsStructPubSubType::register_type_object_representation() const -{ - register_Types_type_objects(); -} - -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; -} - -void MapStructPubSubType::register_type_object_representation() const -{ - register_Types_type_objects(); -} - -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; -} - -void MapStructEqualPubSubType::register_type_object_representation() const -{ - register_Types_type_objects(); -} - -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; -} - -void MapBadKeyStructPubSubType::register_type_object_representation() const -{ - register_Types_type_objects(); -} - -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; -} - -void MapBadElemStructPubSubType::register_type_object_representation() const -{ - register_Types_type_objects(); -} - -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; -} - -void MapBoundsStructPubSubType::register_type_object_representation() const -{ - register_Types_type_objects(); -} - -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; -} - -void MapMapStructPubSubType::register_type_object_representation() const -{ - register_Types_type_objects(); -} - -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; -} - -void MapMapBoundsStructPubSubType::register_type_object_representation() const -{ - register_Types_type_objects(); -} - - - - - - -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; -} - -void SimpleUnionStructPubSubType::register_type_object_representation() const -{ - register_Types_type_objects(); -} - -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; -} - -void SimpleUnionStructEqualPubSubType::register_type_object_representation() const -{ - register_Types_type_objects(); -} - -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; -} - -void SimpleUnionNamesStructPubSubType::register_type_object_representation() const -{ - register_Types_type_objects(); -} - -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; -} - -void SimpleTypeUnionStructPubSubType::register_type_object_representation() const -{ - register_Types_type_objects(); -} - -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; -} - -void SimpleBadUnionStructPubSubType::register_type_object_representation() const -{ - register_Types_type_objects(); -} - -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; -} - -void SimplBadDiscUnionStructPubSubType::register_type_object_representation() const -{ - register_Types_type_objects(); -} - - -// Include auxiliary functions like for serializing/deserializing. -#include "TypesCdrAux.ipp" diff --git a/test/unittest/xtypes/idl/TypesPubSubTypes.h b/test/unittest/xtypes/idl/TypesPubSubTypes.h deleted file mode 100644 index 4eb1ff9be95..00000000000 --- a/test/unittest/xtypes/idl/TypesPubSubTypes.h +++ /dev/null @@ -1,3324 +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.hpp" - - -#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; - - //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 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; - - //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 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; - - //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 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; - - //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 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; - - //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 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; - - //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 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; - - //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 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; - - //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 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; - - //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 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; - - //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 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; - - //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 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; - - //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 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; - - //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 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; - - //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 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; - - //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 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; - - //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 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; - - //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 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; - - //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 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; - - //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 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; - - //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 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; - - //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 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; - - //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 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; - - //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 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; - - //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 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; - - //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 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; - - //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 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; - - //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 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; - - //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 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; - - //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 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; - - //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 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; - - //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 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; - - //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 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; - - //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 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; - - //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 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; - - //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 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; - - //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; - -}; - -#endif // _FAST_DDS_GENERATED_TYPES_PUBSUBTYPES_H_ - diff --git a/test/unittest/xtypes/idl/TypesTypeObjectSupport.cxx b/test/unittest/xtypes/idl/TypesTypeObjectSupport.cxx deleted file mode 100644 index fdd430a2e71..00000000000 --- a/test/unittest/xtypes/idl/TypesTypeObjectSupport.cxx +++ /dev/null @@ -1,9862 +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 TypesTypeObjectSupport.cxx - * Source file containing the implementation to register the TypeObject representation of the described types in the IDL file - * - * This file was generated by the tool fastddsgen. - */ - -#include "TypesTypeObjectSupport.hpp" - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "Types.hpp" - - -using namespace eprosima::fastdds::dds::xtypes; - -void register_Types_type_objects() -{ - static std::once_flag once_flag; - std::call_once(once_flag, []() - { - register_MyEnumStruct_type_identifier(); - - register_MyBadEnumStruct_type_identifier(); - - register_MyAliasEnumStruct_type_identifier(); - - register_BasicStruct_type_identifier(); - - register_BasicNamesStruct_type_identifier(); - - register_BasicBadStruct_type_identifier(); - - register_BasicWideStruct_type_identifier(); - - register_BadBasicWideStruct_type_identifier(); - - register_StringStruct_type_identifier(); - - register_LargeStringStruct_type_identifier(); - - register_WStringStruct_type_identifier(); - - register_LargeWStringStruct_type_identifier(); - - register_ArrayStruct_type_identifier(); - - register_ArrayStructEqual_type_identifier(); - - register_ArrayBadStruct_type_identifier(); - - register_ArrayDimensionsStruct_type_identifier(); - - register_ArraySizeStruct_type_identifier(); - - register_SequenceStruct_type_identifier(); - - register_SequenceStructEqual_type_identifier(); - - register_SequenceBadStruct_type_identifier(); - - register_SequenceBoundsStruct_type_identifier(); - - register_SequenceSequenceStruct_type_identifier(); - - register_SequenceSequenceBoundsStruct_type_identifier(); - - register_MapStruct_type_identifier(); - - register_MapStructEqual_type_identifier(); - - register_MapBadKeyStruct_type_identifier(); - - register_MapBadElemStruct_type_identifier(); - - register_MapBoundsStruct_type_identifier(); - - register_MapMapStruct_type_identifier(); - - register_MapMapBoundsStruct_type_identifier(); - - register_SimpleUnion_type_identifier(); - - register_SimpleUnionNames_type_identifier(); - - register_SimpleTypeUnion_type_identifier(); - - register_SimpleBadUnion_type_identifier(); - - register_SimpleBadDiscUnion_type_identifier(); - - register_SimpleUnionStruct_type_identifier(); - - register_SimpleUnionStructEqual_type_identifier(); - - register_SimpleUnionNamesStruct_type_identifier(); - - register_SimpleTypeUnionStruct_type_identifier(); - - register_SimpleBadUnionStruct_type_identifier(); - - register_SimplBadDiscUnionStruct_type_identifier(); - - }); -} - -void register_MyEnumStruct_type_identifier() -{ - { - StructTypeFlag struct_flags_MyEnumStruct = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_MyEnumStruct; - TypeIdentifierPair type_ids_MyEnumStruct; - QualifiedTypeName type_name_MyEnumStruct = "MyEnumStruct"; - eprosima::fastcdr::optional type_ann_builtin_MyEnumStruct; - eprosima::fastcdr::optional ann_custom_MyEnumStruct; - CompleteTypeDetail detail_MyEnumStruct = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_MyEnumStruct, ann_custom_MyEnumStruct, type_name_MyEnumStruct.to_string()); - CompleteStructHeader header_MyEnumStruct; - header_MyEnumStruct = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_MyEnumStruct); - CompleteStructMemberSeq member_seq_MyEnumStruct; - { - return_code_MyEnumStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyEnum", type_ids_MyEnumStruct); - - if (return_code_MyEnumStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EnumTypeFlag enum_flags_MyEnum = 0; - BitBound bit_bound_MyEnum = 32; - CommonEnumeratedHeader common_MyEnum = TypeObjectUtils::build_common_enumerated_header(bit_bound_MyEnum); - QualifiedTypeName type_name_MyEnum = "MyEnum"; - eprosima::fastcdr::optional type_ann_builtin_MyEnum; - eprosima::fastcdr::optional ann_custom_MyEnum; - CompleteTypeDetail detail_MyEnum = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_MyEnum, ann_custom_MyEnum, type_name_MyEnum.to_string()); - CompleteEnumeratedHeader header_MyEnum = TypeObjectUtils::build_complete_enumerated_header(common_MyEnum, detail_MyEnum); - CompleteEnumeratedLiteralSeq literal_seq_MyEnum; - { - EnumeratedLiteralFlag flags_A = TypeObjectUtils::build_enumerated_literal_flag(false); - CommonEnumeratedLiteral common_A = TypeObjectUtils::build_common_enumerated_literal(0, flags_A); - eprosima::fastcdr::optional member_ann_builtin_A; - ann_custom_MyEnum.reset(); - MemberName name_A = "A"; - CompleteMemberDetail detail_A = TypeObjectUtils::build_complete_member_detail(name_A, member_ann_builtin_A, ann_custom_MyEnum); - CompleteEnumeratedLiteral literal_A = TypeObjectUtils::build_complete_enumerated_literal(common_A, detail_A); - TypeObjectUtils::add_complete_enumerated_literal(literal_seq_MyEnum, literal_A); - } - { - EnumeratedLiteralFlag flags_B = TypeObjectUtils::build_enumerated_literal_flag(false); - CommonEnumeratedLiteral common_B = TypeObjectUtils::build_common_enumerated_literal(1, flags_B); - eprosima::fastcdr::optional member_ann_builtin_B; - ann_custom_MyEnum.reset(); - MemberName name_B = "B"; - CompleteMemberDetail detail_B = TypeObjectUtils::build_complete_member_detail(name_B, member_ann_builtin_B, ann_custom_MyEnum); - CompleteEnumeratedLiteral literal_B = TypeObjectUtils::build_complete_enumerated_literal(common_B, detail_B); - TypeObjectUtils::add_complete_enumerated_literal(literal_seq_MyEnum, literal_B); - } - { - EnumeratedLiteralFlag flags_C = TypeObjectUtils::build_enumerated_literal_flag(false); - CommonEnumeratedLiteral common_C = TypeObjectUtils::build_common_enumerated_literal(2, flags_C); - eprosima::fastcdr::optional member_ann_builtin_C; - ann_custom_MyEnum.reset(); - MemberName name_C = "C"; - CompleteMemberDetail detail_C = TypeObjectUtils::build_complete_member_detail(name_C, member_ann_builtin_C, ann_custom_MyEnum); - CompleteEnumeratedLiteral literal_C = TypeObjectUtils::build_complete_enumerated_literal(common_C, detail_C); - TypeObjectUtils::add_complete_enumerated_literal(literal_seq_MyEnum, literal_C); - } - CompleteEnumeratedType enumerated_type_MyEnum = TypeObjectUtils::build_complete_enumerated_type(enum_flags_MyEnum, header_MyEnum, - literal_seq_MyEnum); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_enumerated_type_object(enumerated_type_MyEnum, type_name_MyEnum.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyEnum already registered in TypeObjectRegistry for a different type."); - } - return_code_MyEnumStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyEnum", type_ids_MyEnumStruct); - if (return_code_MyEnumStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyEnum: Given Enum TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_enum = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_enum; - MemberId member_id_my_enum = 0x00000000; - if (EK_COMPLETE == type_ids_MyEnumStruct.type_identifier1()._d() || TK_NONE == type_ids_MyEnumStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_MyEnumStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MyEnumStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_MyEnumStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MyEnumStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_MyEnumStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MyEnumStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_MyEnumStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MyEnumStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_MyEnumStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_MyEnumStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MyEnumStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_MyEnumStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_MyEnumStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MyEnumStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_enum = TypeObjectUtils::build_common_struct_member(member_id_my_enum, member_flags_my_enum, type_ids_MyEnumStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_MyEnumStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_MyEnumStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MyEnumStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_MyEnumStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MyEnumStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_MyEnumStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MyEnumStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_MyEnumStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MyEnumStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_MyEnumStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_MyEnumStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MyEnumStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_MyEnumStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_MyEnumStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MyEnumStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_enum = TypeObjectUtils::build_common_struct_member(member_id_my_enum, member_flags_my_enum, type_ids_MyEnumStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_enum member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_enum = "my_enum"; - eprosima::fastcdr::optional member_ann_builtin_my_enum; - ann_custom_MyEnumStruct.reset(); - CompleteMemberDetail detail_my_enum = TypeObjectUtils::build_complete_member_detail(name_my_enum, member_ann_builtin_my_enum, ann_custom_MyEnumStruct); - CompleteStructMember member_my_enum = TypeObjectUtils::build_complete_struct_member(common_my_enum, detail_my_enum); - TypeObjectUtils::add_complete_struct_member(member_seq_MyEnumStruct, member_my_enum); - } - CompleteStructType struct_type_MyEnumStruct = TypeObjectUtils::build_complete_struct_type(struct_flags_MyEnumStruct, header_MyEnumStruct, member_seq_MyEnumStruct); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_MyEnumStruct, type_name_MyEnumStruct.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyEnumStruct already registered in TypeObjectRegistry for a different type."); - } - return_code_MyEnumStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyEnumStruct", type_ids_MyEnumStruct); - if (return_code_MyEnumStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyEnumStruct: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } -} -void register_MyBadEnumStruct_type_identifier() -{ - { - StructTypeFlag struct_flags_MyBadEnumStruct = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_MyBadEnumStruct; - TypeIdentifierPair type_ids_MyBadEnumStruct; - QualifiedTypeName type_name_MyBadEnumStruct = "MyBadEnumStruct"; - eprosima::fastcdr::optional type_ann_builtin_MyBadEnumStruct; - eprosima::fastcdr::optional ann_custom_MyBadEnumStruct; - CompleteTypeDetail detail_MyBadEnumStruct = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_MyBadEnumStruct, ann_custom_MyBadEnumStruct, type_name_MyBadEnumStruct.to_string()); - CompleteStructHeader header_MyBadEnumStruct; - header_MyBadEnumStruct = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_MyBadEnumStruct); - CompleteStructMemberSeq member_seq_MyBadEnumStruct; - { - return_code_MyBadEnumStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyBadEnum", type_ids_MyBadEnumStruct); - - if (return_code_MyBadEnumStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EnumTypeFlag enum_flags_MyBadEnum = 0; - BitBound bit_bound_MyBadEnum = 32; - CommonEnumeratedHeader common_MyBadEnum = TypeObjectUtils::build_common_enumerated_header(bit_bound_MyBadEnum); - QualifiedTypeName type_name_MyBadEnum = "MyBadEnum"; - eprosima::fastcdr::optional type_ann_builtin_MyBadEnum; - eprosima::fastcdr::optional ann_custom_MyBadEnum; - CompleteTypeDetail detail_MyBadEnum = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_MyBadEnum, ann_custom_MyBadEnum, type_name_MyBadEnum.to_string()); - CompleteEnumeratedHeader header_MyBadEnum = TypeObjectUtils::build_complete_enumerated_header(common_MyBadEnum, detail_MyBadEnum); - CompleteEnumeratedLiteralSeq literal_seq_MyBadEnum; - { - EnumeratedLiteralFlag flags_A1 = TypeObjectUtils::build_enumerated_literal_flag(false); - CommonEnumeratedLiteral common_A1 = TypeObjectUtils::build_common_enumerated_literal(0, flags_A1); - eprosima::fastcdr::optional member_ann_builtin_A1; - ann_custom_MyBadEnum.reset(); - MemberName name_A1 = "A1"; - CompleteMemberDetail detail_A1 = TypeObjectUtils::build_complete_member_detail(name_A1, member_ann_builtin_A1, ann_custom_MyBadEnum); - CompleteEnumeratedLiteral literal_A1 = TypeObjectUtils::build_complete_enumerated_literal(common_A1, detail_A1); - TypeObjectUtils::add_complete_enumerated_literal(literal_seq_MyBadEnum, literal_A1); - } - { - EnumeratedLiteralFlag flags_B1 = TypeObjectUtils::build_enumerated_literal_flag(false); - CommonEnumeratedLiteral common_B1 = TypeObjectUtils::build_common_enumerated_literal(1, flags_B1); - eprosima::fastcdr::optional member_ann_builtin_B1; - ann_custom_MyBadEnum.reset(); - MemberName name_B1 = "B1"; - CompleteMemberDetail detail_B1 = TypeObjectUtils::build_complete_member_detail(name_B1, member_ann_builtin_B1, ann_custom_MyBadEnum); - CompleteEnumeratedLiteral literal_B1 = TypeObjectUtils::build_complete_enumerated_literal(common_B1, detail_B1); - TypeObjectUtils::add_complete_enumerated_literal(literal_seq_MyBadEnum, literal_B1); - } - { - EnumeratedLiteralFlag flags_C1 = TypeObjectUtils::build_enumerated_literal_flag(false); - CommonEnumeratedLiteral common_C1 = TypeObjectUtils::build_common_enumerated_literal(2, flags_C1); - eprosima::fastcdr::optional member_ann_builtin_C1; - ann_custom_MyBadEnum.reset(); - MemberName name_C1 = "C1"; - CompleteMemberDetail detail_C1 = TypeObjectUtils::build_complete_member_detail(name_C1, member_ann_builtin_C1, ann_custom_MyBadEnum); - CompleteEnumeratedLiteral literal_C1 = TypeObjectUtils::build_complete_enumerated_literal(common_C1, detail_C1); - TypeObjectUtils::add_complete_enumerated_literal(literal_seq_MyBadEnum, literal_C1); - } - CompleteEnumeratedType enumerated_type_MyBadEnum = TypeObjectUtils::build_complete_enumerated_type(enum_flags_MyBadEnum, header_MyBadEnum, - literal_seq_MyBadEnum); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_enumerated_type_object(enumerated_type_MyBadEnum, type_name_MyBadEnum.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyBadEnum already registered in TypeObjectRegistry for a different type."); - } - return_code_MyBadEnumStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyBadEnum", type_ids_MyBadEnumStruct); - if (return_code_MyBadEnumStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyBadEnum: Given Enum TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_enum = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_enum; - MemberId member_id_my_enum = 0x00000000; - if (EK_COMPLETE == type_ids_MyBadEnumStruct.type_identifier1()._d() || TK_NONE == type_ids_MyBadEnumStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_MyBadEnumStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MyBadEnumStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_MyBadEnumStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MyBadEnumStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_MyBadEnumStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MyBadEnumStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_MyBadEnumStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MyBadEnumStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_MyBadEnumStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_MyBadEnumStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MyBadEnumStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_MyBadEnumStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_MyBadEnumStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MyBadEnumStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_enum = TypeObjectUtils::build_common_struct_member(member_id_my_enum, member_flags_my_enum, type_ids_MyBadEnumStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_MyBadEnumStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_MyBadEnumStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MyBadEnumStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_MyBadEnumStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MyBadEnumStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_MyBadEnumStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MyBadEnumStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_MyBadEnumStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MyBadEnumStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_MyBadEnumStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_MyBadEnumStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MyBadEnumStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_MyBadEnumStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_MyBadEnumStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MyBadEnumStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_enum = TypeObjectUtils::build_common_struct_member(member_id_my_enum, member_flags_my_enum, type_ids_MyBadEnumStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_enum member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_enum = "my_enum"; - eprosima::fastcdr::optional member_ann_builtin_my_enum; - ann_custom_MyBadEnumStruct.reset(); - CompleteMemberDetail detail_my_enum = TypeObjectUtils::build_complete_member_detail(name_my_enum, member_ann_builtin_my_enum, ann_custom_MyBadEnumStruct); - CompleteStructMember member_my_enum = TypeObjectUtils::build_complete_struct_member(common_my_enum, detail_my_enum); - TypeObjectUtils::add_complete_struct_member(member_seq_MyBadEnumStruct, member_my_enum); - } - CompleteStructType struct_type_MyBadEnumStruct = TypeObjectUtils::build_complete_struct_type(struct_flags_MyBadEnumStruct, header_MyBadEnumStruct, member_seq_MyBadEnumStruct); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_MyBadEnumStruct, type_name_MyBadEnumStruct.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyBadEnumStruct already registered in TypeObjectRegistry for a different type."); - } - return_code_MyBadEnumStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyBadEnumStruct", type_ids_MyBadEnumStruct); - if (return_code_MyBadEnumStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyBadEnumStruct: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } -} -void register_MyAliasEnumStruct_type_identifier() -{ - { - StructTypeFlag struct_flags_MyAliasEnumStruct = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_MyAliasEnumStruct; - TypeIdentifierPair type_ids_MyAliasEnumStruct; - QualifiedTypeName type_name_MyAliasEnumStruct = "MyAliasEnumStruct"; - eprosima::fastcdr::optional type_ann_builtin_MyAliasEnumStruct; - eprosima::fastcdr::optional ann_custom_MyAliasEnumStruct; - CompleteTypeDetail detail_MyAliasEnumStruct = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_MyAliasEnumStruct, ann_custom_MyAliasEnumStruct, type_name_MyAliasEnumStruct.to_string()); - CompleteStructHeader header_MyAliasEnumStruct; - header_MyAliasEnumStruct = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_MyAliasEnumStruct); - CompleteStructMemberSeq member_seq_MyAliasEnumStruct; - { - return_code_MyAliasEnumStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyAliasEnum", type_ids_MyAliasEnumStruct); - - if (return_code_MyAliasEnumStruct != eprosima::fastdds::dds::RETCODE_OK) - { - AliasTypeFlag alias_flags_MyAliasEnum = 0; - QualifiedTypeName type_name_MyAliasEnum = "MyAliasEnum"; - eprosima::fastcdr::optional type_ann_builtin_MyAliasEnum; - eprosima::fastcdr::optional ann_custom_MyAliasEnum; - CompleteTypeDetail detail_MyAliasEnum = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_MyAliasEnum, ann_custom_MyAliasEnum, type_name_MyAliasEnum.to_string()); - CompleteAliasHeader header_MyAliasEnum = TypeObjectUtils::build_complete_alias_header(detail_MyAliasEnum); - AliasMemberFlag related_flags_MyAliasEnum = 0; - return_code_MyAliasEnumStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyEnum", type_ids_MyAliasEnumStruct); - - if (return_code_MyAliasEnumStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EnumTypeFlag enum_flags_MyEnum = 0; - BitBound bit_bound_MyEnum = 32; - CommonEnumeratedHeader common_MyEnum = TypeObjectUtils::build_common_enumerated_header(bit_bound_MyEnum); - QualifiedTypeName type_name_MyEnum = "MyEnum"; - eprosima::fastcdr::optional type_ann_builtin_MyEnum; - eprosima::fastcdr::optional ann_custom_MyEnum; - CompleteTypeDetail detail_MyEnum = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_MyEnum, ann_custom_MyEnum, type_name_MyEnum.to_string()); - CompleteEnumeratedHeader header_MyEnum = TypeObjectUtils::build_complete_enumerated_header(common_MyEnum, detail_MyEnum); - CompleteEnumeratedLiteralSeq literal_seq_MyEnum; - { - EnumeratedLiteralFlag flags_A = TypeObjectUtils::build_enumerated_literal_flag(false); - CommonEnumeratedLiteral common_A = TypeObjectUtils::build_common_enumerated_literal(0, flags_A); - eprosima::fastcdr::optional member_ann_builtin_A; - ann_custom_MyEnum.reset(); - MemberName name_A = "A"; - CompleteMemberDetail detail_A = TypeObjectUtils::build_complete_member_detail(name_A, member_ann_builtin_A, ann_custom_MyEnum); - CompleteEnumeratedLiteral literal_A = TypeObjectUtils::build_complete_enumerated_literal(common_A, detail_A); - TypeObjectUtils::add_complete_enumerated_literal(literal_seq_MyEnum, literal_A); - } - { - EnumeratedLiteralFlag flags_B = TypeObjectUtils::build_enumerated_literal_flag(false); - CommonEnumeratedLiteral common_B = TypeObjectUtils::build_common_enumerated_literal(1, flags_B); - eprosima::fastcdr::optional member_ann_builtin_B; - ann_custom_MyEnum.reset(); - MemberName name_B = "B"; - CompleteMemberDetail detail_B = TypeObjectUtils::build_complete_member_detail(name_B, member_ann_builtin_B, ann_custom_MyEnum); - CompleteEnumeratedLiteral literal_B = TypeObjectUtils::build_complete_enumerated_literal(common_B, detail_B); - TypeObjectUtils::add_complete_enumerated_literal(literal_seq_MyEnum, literal_B); - } - { - EnumeratedLiteralFlag flags_C = TypeObjectUtils::build_enumerated_literal_flag(false); - CommonEnumeratedLiteral common_C = TypeObjectUtils::build_common_enumerated_literal(2, flags_C); - eprosima::fastcdr::optional member_ann_builtin_C; - ann_custom_MyEnum.reset(); - MemberName name_C = "C"; - CompleteMemberDetail detail_C = TypeObjectUtils::build_complete_member_detail(name_C, member_ann_builtin_C, ann_custom_MyEnum); - CompleteEnumeratedLiteral literal_C = TypeObjectUtils::build_complete_enumerated_literal(common_C, detail_C); - TypeObjectUtils::add_complete_enumerated_literal(literal_seq_MyEnum, literal_C); - } - CompleteEnumeratedType enumerated_type_MyEnum = TypeObjectUtils::build_complete_enumerated_type(enum_flags_MyEnum, header_MyEnum, - literal_seq_MyEnum); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_enumerated_type_object(enumerated_type_MyEnum, type_name_MyEnum.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyEnum already registered in TypeObjectRegistry for a different type."); - } - return_code_MyAliasEnumStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyEnum", type_ids_MyAliasEnumStruct); - if (return_code_MyAliasEnumStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyEnum: Given Enum TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - CommonAliasBody common_MyAliasEnum; - if (EK_COMPLETE == type_ids_MyAliasEnumStruct.type_identifier1()._d() || TK_NONE == type_ids_MyAliasEnumStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_MyAliasEnumStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MyAliasEnumStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_MyAliasEnumStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MyAliasEnumStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_MyAliasEnumStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MyAliasEnumStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_MyAliasEnumStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MyAliasEnumStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_MyAliasEnumStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_MyAliasEnumStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MyAliasEnumStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_MyAliasEnumStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_MyAliasEnumStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MyAliasEnumStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_MyAliasEnum = TypeObjectUtils::build_common_alias_body(related_flags_MyAliasEnum, type_ids_MyAliasEnumStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_MyAliasEnumStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_MyAliasEnumStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MyAliasEnumStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_MyAliasEnumStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MyAliasEnumStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_MyAliasEnumStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MyAliasEnumStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_MyAliasEnumStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MyAliasEnumStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_MyAliasEnumStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_MyAliasEnumStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MyAliasEnumStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_MyAliasEnumStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_MyAliasEnumStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MyAliasEnumStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_MyAliasEnum = TypeObjectUtils::build_common_alias_body(related_flags_MyAliasEnum, type_ids_MyAliasEnumStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyAliasEnum related TypeIdentifier inconsistent."); - return; - } - eprosima::fastcdr::optional member_ann_builtin_MyAliasEnum; - ann_custom_MyAliasEnum.reset(); - CompleteAliasBody body_MyAliasEnum = TypeObjectUtils::build_complete_alias_body(common_MyAliasEnum, member_ann_builtin_MyAliasEnum, ann_custom_MyAliasEnum); - CompleteAliasType alias_type_MyAliasEnum = TypeObjectUtils::build_complete_alias_type(alias_flags_MyAliasEnum, header_MyAliasEnum, body_MyAliasEnum); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_alias_type_object(alias_type_MyAliasEnum, type_name_MyAliasEnum.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyAliasEnum already registered in TypeObjectRegistry for a different type."); - } - return_code_MyAliasEnumStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyAliasEnum", type_ids_MyAliasEnumStruct); - if (return_code_MyAliasEnumStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyAliasEnum: Given Alias TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_enum = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_enum; - MemberId member_id_my_enum = 0x00000000; - if (EK_COMPLETE == type_ids_MyAliasEnumStruct.type_identifier1()._d() || TK_NONE == type_ids_MyAliasEnumStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_MyAliasEnumStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MyAliasEnumStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_MyAliasEnumStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MyAliasEnumStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_MyAliasEnumStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MyAliasEnumStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_MyAliasEnumStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MyAliasEnumStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_MyAliasEnumStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_MyAliasEnumStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MyAliasEnumStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_MyAliasEnumStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_MyAliasEnumStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MyAliasEnumStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_enum = TypeObjectUtils::build_common_struct_member(member_id_my_enum, member_flags_my_enum, type_ids_MyAliasEnumStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_MyAliasEnumStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_MyAliasEnumStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MyAliasEnumStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_MyAliasEnumStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MyAliasEnumStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_MyAliasEnumStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MyAliasEnumStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_MyAliasEnumStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MyAliasEnumStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_MyAliasEnumStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_MyAliasEnumStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MyAliasEnumStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_MyAliasEnumStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_MyAliasEnumStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MyAliasEnumStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_enum = TypeObjectUtils::build_common_struct_member(member_id_my_enum, member_flags_my_enum, type_ids_MyAliasEnumStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_enum member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_enum = "my_enum"; - eprosima::fastcdr::optional member_ann_builtin_my_enum; - ann_custom_MyAliasEnumStruct.reset(); - CompleteMemberDetail detail_my_enum = TypeObjectUtils::build_complete_member_detail(name_my_enum, member_ann_builtin_my_enum, ann_custom_MyAliasEnumStruct); - CompleteStructMember member_my_enum = TypeObjectUtils::build_complete_struct_member(common_my_enum, detail_my_enum); - TypeObjectUtils::add_complete_struct_member(member_seq_MyAliasEnumStruct, member_my_enum); - } - CompleteStructType struct_type_MyAliasEnumStruct = TypeObjectUtils::build_complete_struct_type(struct_flags_MyAliasEnumStruct, header_MyAliasEnumStruct, member_seq_MyAliasEnumStruct); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_MyAliasEnumStruct, type_name_MyAliasEnumStruct.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyAliasEnumStruct already registered in TypeObjectRegistry for a different type."); - } - return_code_MyAliasEnumStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyAliasEnumStruct", type_ids_MyAliasEnumStruct); - if (return_code_MyAliasEnumStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyAliasEnumStruct: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } -} -void register_BasicStruct_type_identifier() -{ - { - StructTypeFlag struct_flags_BasicStruct = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_BasicStruct; - TypeIdentifierPair type_ids_BasicStruct; - QualifiedTypeName type_name_BasicStruct = "BasicStruct"; - eprosima::fastcdr::optional type_ann_builtin_BasicStruct; - eprosima::fastcdr::optional ann_custom_BasicStruct; - CompleteTypeDetail detail_BasicStruct = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_BasicStruct, ann_custom_BasicStruct, type_name_BasicStruct.to_string()); - CompleteStructHeader header_BasicStruct; - header_BasicStruct = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_BasicStruct); - CompleteStructMemberSeq member_seq_BasicStruct; - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_bool", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_bool Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_bool = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_bool; - MemberId member_id_my_bool = 0x00000000; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_bool = TypeObjectUtils::build_common_struct_member(member_id_my_bool, member_flags_my_bool, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_bool = TypeObjectUtils::build_common_struct_member(member_id_my_bool, member_flags_my_bool, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_bool member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_bool = "my_bool"; - eprosima::fastcdr::optional member_ann_builtin_my_bool; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_bool = TypeObjectUtils::build_complete_member_detail(name_my_bool, member_ann_builtin_my_bool, ann_custom_BasicStruct); - CompleteStructMember member_my_bool = TypeObjectUtils::build_complete_struct_member(common_my_bool, detail_my_bool); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_bool); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_BasicStruct); - - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_int32 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_int32 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_int32; - MemberId member_id_my_int32 = 0x00000001; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_int32 = TypeObjectUtils::build_common_struct_member(member_id_my_int32, member_flags_my_int32, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_int32 = TypeObjectUtils::build_common_struct_member(member_id_my_int32, member_flags_my_int32, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_int32 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_int32 = "my_int32"; - eprosima::fastcdr::optional member_ann_builtin_my_int32; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_int32 = TypeObjectUtils::build_complete_member_detail(name_my_int32, member_ann_builtin_my_int32, ann_custom_BasicStruct); - CompleteStructMember member_my_int32 = TypeObjectUtils::build_complete_struct_member(common_my_int32, detail_my_int32); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_int32); - } - { - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_string_unbounded", type_ids_BasicStruct); - - if (return_code_BasicStruct != 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_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_string_unbounded", type_ids_BasicStruct); - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_string_unbounded: Given String TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_string = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_string; - MemberId member_id_my_string = 0x00000002; - if (EK_COMPLETE == type_ids_BasicStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_string = TypeObjectUtils::build_common_struct_member(member_id_my_string, member_flags_my_string, type_ids_BasicStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_string = TypeObjectUtils::build_common_struct_member(member_id_my_string, member_flags_my_string, type_ids_BasicStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_string member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_string = "my_string"; - eprosima::fastcdr::optional member_ann_builtin_my_string; - ann_custom_BasicStruct.reset(); - CompleteMemberDetail detail_my_string = TypeObjectUtils::build_complete_member_detail(name_my_string, member_ann_builtin_my_string, ann_custom_BasicStruct); - CompleteStructMember member_my_string = TypeObjectUtils::build_complete_struct_member(common_my_string, detail_my_string); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicStruct, member_my_string); - } - CompleteStructType struct_type_BasicStruct = TypeObjectUtils::build_complete_struct_type(struct_flags_BasicStruct, header_BasicStruct, member_seq_BasicStruct); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_BasicStruct, type_name_BasicStruct.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "BasicStruct already registered in TypeObjectRegistry for a different type."); - } - return_code_BasicStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "BasicStruct", type_ids_BasicStruct); - if (return_code_BasicStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "BasicStruct: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } -} -void register_BasicNamesStruct_type_identifier() -{ - { - StructTypeFlag struct_flags_BasicNamesStruct = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_BasicNamesStruct; - TypeIdentifierPair type_ids_BasicNamesStruct; - QualifiedTypeName type_name_BasicNamesStruct = "BasicNamesStruct"; - eprosima::fastcdr::optional type_ann_builtin_BasicNamesStruct; - eprosima::fastcdr::optional ann_custom_BasicNamesStruct; - CompleteTypeDetail detail_BasicNamesStruct = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_BasicNamesStruct, ann_custom_BasicNamesStruct, type_name_BasicNamesStruct.to_string()); - CompleteStructHeader header_BasicNamesStruct; - header_BasicNamesStruct = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_BasicNamesStruct); - CompleteStructMemberSeq member_seq_BasicNamesStruct; - { - return_code_BasicNamesStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_bool", type_ids_BasicNamesStruct); - - if (return_code_BasicNamesStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_bool_name Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_bool_name = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_bool_name; - MemberId member_id_my_bool_name = 0x00000000; - if (EK_COMPLETE == type_ids_BasicNamesStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicNamesStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicNamesStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicNamesStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicNamesStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicNamesStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicNamesStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicNamesStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicNamesStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicNamesStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicNamesStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicNamesStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicNamesStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicNamesStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicNamesStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicNamesStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_bool_name = TypeObjectUtils::build_common_struct_member(member_id_my_bool_name, member_flags_my_bool_name, type_ids_BasicNamesStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicNamesStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicNamesStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicNamesStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicNamesStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicNamesStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicNamesStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicNamesStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicNamesStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicNamesStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicNamesStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicNamesStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicNamesStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicNamesStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicNamesStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicNamesStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_bool_name = TypeObjectUtils::build_common_struct_member(member_id_my_bool_name, member_flags_my_bool_name, type_ids_BasicNamesStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_bool_name member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_bool_name = "my_bool_name"; - eprosima::fastcdr::optional member_ann_builtin_my_bool_name; - ann_custom_BasicNamesStruct.reset(); - CompleteMemberDetail detail_my_bool_name = TypeObjectUtils::build_complete_member_detail(name_my_bool_name, member_ann_builtin_my_bool_name, ann_custom_BasicNamesStruct); - CompleteStructMember member_my_bool_name = TypeObjectUtils::build_complete_struct_member(common_my_bool_name, detail_my_bool_name); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicNamesStruct, member_my_bool_name); - } - { - return_code_BasicNamesStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_BasicNamesStruct); - - if (return_code_BasicNamesStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_int32_name Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_int32_name = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_int32_name; - MemberId member_id_my_int32_name = 0x00000001; - if (EK_COMPLETE == type_ids_BasicNamesStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicNamesStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicNamesStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicNamesStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicNamesStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicNamesStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicNamesStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicNamesStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicNamesStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicNamesStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicNamesStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicNamesStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicNamesStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicNamesStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicNamesStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicNamesStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_int32_name = TypeObjectUtils::build_common_struct_member(member_id_my_int32_name, member_flags_my_int32_name, type_ids_BasicNamesStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicNamesStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicNamesStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicNamesStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicNamesStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicNamesStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicNamesStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicNamesStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicNamesStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicNamesStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicNamesStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicNamesStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicNamesStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicNamesStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicNamesStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicNamesStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_int32_name = TypeObjectUtils::build_common_struct_member(member_id_my_int32_name, member_flags_my_int32_name, type_ids_BasicNamesStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_int32_name member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_int32_name = "my_int32_name"; - eprosima::fastcdr::optional member_ann_builtin_my_int32_name; - ann_custom_BasicNamesStruct.reset(); - CompleteMemberDetail detail_my_int32_name = TypeObjectUtils::build_complete_member_detail(name_my_int32_name, member_ann_builtin_my_int32_name, ann_custom_BasicNamesStruct); - CompleteStructMember member_my_int32_name = TypeObjectUtils::build_complete_struct_member(common_my_int32_name, detail_my_int32_name); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicNamesStruct, member_my_int32_name); - } - { - return_code_BasicNamesStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_string_unbounded", type_ids_BasicNamesStruct); - - if (return_code_BasicNamesStruct != 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_BasicNamesStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_string_unbounded", type_ids_BasicNamesStruct); - if (return_code_BasicNamesStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_string_unbounded: Given String TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_string_name = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_string_name; - MemberId member_id_my_string_name = 0x00000002; - if (EK_COMPLETE == type_ids_BasicNamesStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicNamesStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicNamesStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicNamesStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicNamesStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicNamesStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicNamesStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicNamesStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicNamesStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicNamesStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicNamesStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicNamesStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicNamesStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicNamesStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicNamesStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicNamesStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_string_name = TypeObjectUtils::build_common_struct_member(member_id_my_string_name, member_flags_my_string_name, type_ids_BasicNamesStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicNamesStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicNamesStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicNamesStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicNamesStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicNamesStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicNamesStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicNamesStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicNamesStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicNamesStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicNamesStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicNamesStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicNamesStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicNamesStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicNamesStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicNamesStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_string_name = TypeObjectUtils::build_common_struct_member(member_id_my_string_name, member_flags_my_string_name, type_ids_BasicNamesStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_string_name member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_string_name = "my_string_name"; - eprosima::fastcdr::optional member_ann_builtin_my_string_name; - ann_custom_BasicNamesStruct.reset(); - CompleteMemberDetail detail_my_string_name = TypeObjectUtils::build_complete_member_detail(name_my_string_name, member_ann_builtin_my_string_name, ann_custom_BasicNamesStruct); - CompleteStructMember member_my_string_name = TypeObjectUtils::build_complete_struct_member(common_my_string_name, detail_my_string_name); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicNamesStruct, member_my_string_name); - } - CompleteStructType struct_type_BasicNamesStruct = TypeObjectUtils::build_complete_struct_type(struct_flags_BasicNamesStruct, header_BasicNamesStruct, member_seq_BasicNamesStruct); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_BasicNamesStruct, type_name_BasicNamesStruct.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "BasicNamesStruct already registered in TypeObjectRegistry for a different type."); - } - return_code_BasicNamesStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "BasicNamesStruct", type_ids_BasicNamesStruct); - if (return_code_BasicNamesStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "BasicNamesStruct: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } -} -void register_BasicBadStruct_type_identifier() -{ - { - StructTypeFlag struct_flags_BasicBadStruct = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_BasicBadStruct; - TypeIdentifierPair type_ids_BasicBadStruct; - QualifiedTypeName type_name_BasicBadStruct = "BasicBadStruct"; - eprosima::fastcdr::optional type_ann_builtin_BasicBadStruct; - eprosima::fastcdr::optional ann_custom_BasicBadStruct; - CompleteTypeDetail detail_BasicBadStruct = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_BasicBadStruct, ann_custom_BasicBadStruct, type_name_BasicBadStruct.to_string()); - CompleteStructHeader header_BasicBadStruct; - header_BasicBadStruct = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_BasicBadStruct); - CompleteStructMemberSeq member_seq_BasicBadStruct; - { - return_code_BasicBadStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_byte", type_ids_BasicBadStruct); - - if (return_code_BasicBadStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_bool Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_bool = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_bool; - MemberId member_id_my_bool = 0x00000000; - if (EK_COMPLETE == type_ids_BasicBadStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicBadStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicBadStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicBadStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicBadStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicBadStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicBadStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicBadStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicBadStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicBadStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicBadStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicBadStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicBadStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicBadStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicBadStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicBadStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_bool = TypeObjectUtils::build_common_struct_member(member_id_my_bool, member_flags_my_bool, type_ids_BasicBadStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicBadStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicBadStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicBadStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicBadStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicBadStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicBadStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicBadStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicBadStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicBadStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicBadStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicBadStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicBadStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicBadStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicBadStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicBadStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_bool = TypeObjectUtils::build_common_struct_member(member_id_my_bool, member_flags_my_bool, type_ids_BasicBadStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_bool member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_bool = "my_bool"; - eprosima::fastcdr::optional member_ann_builtin_my_bool; - ann_custom_BasicBadStruct.reset(); - CompleteMemberDetail detail_my_bool = TypeObjectUtils::build_complete_member_detail(name_my_bool, member_ann_builtin_my_bool, ann_custom_BasicBadStruct); - CompleteStructMember member_my_bool = TypeObjectUtils::build_complete_struct_member(common_my_bool, detail_my_bool); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicBadStruct, member_my_bool); - } - { - return_code_BasicBadStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_BasicBadStruct); - - if (return_code_BasicBadStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_int32 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_int32 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_int32; - MemberId member_id_my_int32 = 0x00000001; - if (EK_COMPLETE == type_ids_BasicBadStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicBadStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicBadStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicBadStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicBadStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicBadStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicBadStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicBadStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicBadStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicBadStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicBadStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicBadStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicBadStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicBadStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicBadStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicBadStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_int32 = TypeObjectUtils::build_common_struct_member(member_id_my_int32, member_flags_my_int32, type_ids_BasicBadStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicBadStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicBadStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicBadStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicBadStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicBadStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicBadStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicBadStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicBadStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicBadStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicBadStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicBadStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicBadStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicBadStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicBadStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicBadStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_int32 = TypeObjectUtils::build_common_struct_member(member_id_my_int32, member_flags_my_int32, type_ids_BasicBadStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_int32 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_int32 = "my_int32"; - eprosima::fastcdr::optional member_ann_builtin_my_int32; - ann_custom_BasicBadStruct.reset(); - CompleteMemberDetail detail_my_int32 = TypeObjectUtils::build_complete_member_detail(name_my_int32, member_ann_builtin_my_int32, ann_custom_BasicBadStruct); - CompleteStructMember member_my_int32 = TypeObjectUtils::build_complete_struct_member(common_my_int32, detail_my_int32); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicBadStruct, member_my_int32); - } - { - return_code_BasicBadStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_string_unbounded", type_ids_BasicBadStruct); - - if (return_code_BasicBadStruct != 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_BasicBadStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_string_unbounded", type_ids_BasicBadStruct); - if (return_code_BasicBadStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_string_unbounded: Given String TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_string = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_string; - MemberId member_id_my_string = 0x00000002; - if (EK_COMPLETE == type_ids_BasicBadStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicBadStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicBadStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicBadStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicBadStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicBadStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicBadStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicBadStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicBadStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicBadStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicBadStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicBadStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicBadStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicBadStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicBadStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicBadStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_string = TypeObjectUtils::build_common_struct_member(member_id_my_string, member_flags_my_string, type_ids_BasicBadStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicBadStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicBadStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicBadStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicBadStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicBadStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicBadStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicBadStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicBadStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicBadStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicBadStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicBadStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicBadStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicBadStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicBadStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicBadStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_string = TypeObjectUtils::build_common_struct_member(member_id_my_string, member_flags_my_string, type_ids_BasicBadStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_string member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_string = "my_string"; - eprosima::fastcdr::optional member_ann_builtin_my_string; - ann_custom_BasicBadStruct.reset(); - CompleteMemberDetail detail_my_string = TypeObjectUtils::build_complete_member_detail(name_my_string, member_ann_builtin_my_string, ann_custom_BasicBadStruct); - CompleteStructMember member_my_string = TypeObjectUtils::build_complete_struct_member(common_my_string, detail_my_string); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicBadStruct, member_my_string); - } - CompleteStructType struct_type_BasicBadStruct = TypeObjectUtils::build_complete_struct_type(struct_flags_BasicBadStruct, header_BasicBadStruct, member_seq_BasicBadStruct); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_BasicBadStruct, type_name_BasicBadStruct.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "BasicBadStruct already registered in TypeObjectRegistry for a different type."); - } - return_code_BasicBadStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "BasicBadStruct", type_ids_BasicBadStruct); - if (return_code_BasicBadStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "BasicBadStruct: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } -} -void register_BasicWideStruct_type_identifier() -{ - { - StructTypeFlag struct_flags_BasicWideStruct = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_BasicWideStruct; - TypeIdentifierPair type_ids_BasicWideStruct; - QualifiedTypeName type_name_BasicWideStruct = "BasicWideStruct"; - eprosima::fastcdr::optional type_ann_builtin_BasicWideStruct; - eprosima::fastcdr::optional ann_custom_BasicWideStruct; - CompleteTypeDetail detail_BasicWideStruct = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_BasicWideStruct, ann_custom_BasicWideStruct, type_name_BasicWideStruct.to_string()); - CompleteStructHeader header_BasicWideStruct; - header_BasicWideStruct = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_BasicWideStruct); - CompleteStructMemberSeq member_seq_BasicWideStruct; - { - return_code_BasicWideStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_bool", type_ids_BasicWideStruct); - - if (return_code_BasicWideStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_bool Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_bool = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_bool; - MemberId member_id_my_bool = 0x00000000; - if (EK_COMPLETE == type_ids_BasicWideStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicWideStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicWideStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicWideStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicWideStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicWideStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicWideStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicWideStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicWideStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicWideStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicWideStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicWideStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicWideStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicWideStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicWideStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicWideStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_bool = TypeObjectUtils::build_common_struct_member(member_id_my_bool, member_flags_my_bool, type_ids_BasicWideStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicWideStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicWideStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicWideStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicWideStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicWideStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicWideStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicWideStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicWideStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicWideStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicWideStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicWideStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicWideStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicWideStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicWideStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicWideStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_bool = TypeObjectUtils::build_common_struct_member(member_id_my_bool, member_flags_my_bool, type_ids_BasicWideStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_bool member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_bool = "my_bool"; - eprosima::fastcdr::optional member_ann_builtin_my_bool; - ann_custom_BasicWideStruct.reset(); - CompleteMemberDetail detail_my_bool = TypeObjectUtils::build_complete_member_detail(name_my_bool, member_ann_builtin_my_bool, ann_custom_BasicWideStruct); - CompleteStructMember member_my_bool = TypeObjectUtils::build_complete_struct_member(common_my_bool, detail_my_bool); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicWideStruct, member_my_bool); - } - { - return_code_BasicWideStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_BasicWideStruct); - - if (return_code_BasicWideStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_int32 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_int32 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_int32; - MemberId member_id_my_int32 = 0x00000001; - if (EK_COMPLETE == type_ids_BasicWideStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicWideStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicWideStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicWideStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicWideStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicWideStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicWideStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicWideStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicWideStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicWideStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicWideStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicWideStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicWideStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicWideStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicWideStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicWideStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_int32 = TypeObjectUtils::build_common_struct_member(member_id_my_int32, member_flags_my_int32, type_ids_BasicWideStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicWideStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicWideStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicWideStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicWideStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicWideStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicWideStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicWideStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicWideStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicWideStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicWideStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicWideStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicWideStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicWideStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicWideStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicWideStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_int32 = TypeObjectUtils::build_common_struct_member(member_id_my_int32, member_flags_my_int32, type_ids_BasicWideStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_int32 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_int32 = "my_int32"; - eprosima::fastcdr::optional member_ann_builtin_my_int32; - ann_custom_BasicWideStruct.reset(); - CompleteMemberDetail detail_my_int32 = TypeObjectUtils::build_complete_member_detail(name_my_int32, member_ann_builtin_my_int32, ann_custom_BasicWideStruct); - CompleteStructMember member_my_int32 = TypeObjectUtils::build_complete_struct_member(common_my_int32, detail_my_int32); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicWideStruct, member_my_int32); - } - { - return_code_BasicWideStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_string_unbounded", type_ids_BasicWideStruct); - - if (return_code_BasicWideStruct != 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_BasicWideStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_string_unbounded", type_ids_BasicWideStruct); - if (return_code_BasicWideStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_string_unbounded: Given String TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_string = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_string; - MemberId member_id_my_string = 0x00000002; - if (EK_COMPLETE == type_ids_BasicWideStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicWideStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicWideStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicWideStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicWideStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicWideStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicWideStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicWideStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicWideStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicWideStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicWideStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicWideStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicWideStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicWideStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicWideStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicWideStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_string = TypeObjectUtils::build_common_struct_member(member_id_my_string, member_flags_my_string, type_ids_BasicWideStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicWideStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicWideStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicWideStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicWideStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicWideStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicWideStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicWideStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicWideStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicWideStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicWideStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicWideStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicWideStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicWideStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicWideStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicWideStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_string = TypeObjectUtils::build_common_struct_member(member_id_my_string, member_flags_my_string, type_ids_BasicWideStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_string member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_string = "my_string"; - eprosima::fastcdr::optional member_ann_builtin_my_string; - ann_custom_BasicWideStruct.reset(); - CompleteMemberDetail detail_my_string = TypeObjectUtils::build_complete_member_detail(name_my_string, member_ann_builtin_my_string, ann_custom_BasicWideStruct); - CompleteStructMember member_my_string = TypeObjectUtils::build_complete_struct_member(common_my_string, detail_my_string); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicWideStruct, member_my_string); - } - { - return_code_BasicWideStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_BasicWideStruct); - - if (return_code_BasicWideStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "new_int32 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_new_int32 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_new_int32; - MemberId member_id_new_int32 = 0x00000003; - if (EK_COMPLETE == type_ids_BasicWideStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicWideStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicWideStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicWideStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicWideStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicWideStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicWideStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicWideStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicWideStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicWideStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicWideStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicWideStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicWideStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicWideStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicWideStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicWideStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_new_int32 = TypeObjectUtils::build_common_struct_member(member_id_new_int32, member_flags_new_int32, type_ids_BasicWideStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicWideStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicWideStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicWideStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicWideStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicWideStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicWideStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicWideStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicWideStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicWideStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicWideStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicWideStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicWideStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicWideStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicWideStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicWideStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_new_int32 = TypeObjectUtils::build_common_struct_member(member_id_new_int32, member_flags_new_int32, type_ids_BasicWideStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure new_int32 member TypeIdentifier inconsistent."); - return; - } - MemberName name_new_int32 = "new_int32"; - eprosima::fastcdr::optional member_ann_builtin_new_int32; - ann_custom_BasicWideStruct.reset(); - CompleteMemberDetail detail_new_int32 = TypeObjectUtils::build_complete_member_detail(name_new_int32, member_ann_builtin_new_int32, ann_custom_BasicWideStruct); - CompleteStructMember member_new_int32 = TypeObjectUtils::build_complete_struct_member(common_new_int32, detail_new_int32); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicWideStruct, member_new_int32); - } - { - return_code_BasicWideStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_string_unbounded", type_ids_BasicWideStruct); - - if (return_code_BasicWideStruct != 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_BasicWideStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_string_unbounded", type_ids_BasicWideStruct); - if (return_code_BasicWideStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_string_unbounded: Given String TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_new_string = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_new_string; - MemberId member_id_new_string = 0x00000004; - if (EK_COMPLETE == type_ids_BasicWideStruct.type_identifier1()._d() || TK_NONE == type_ids_BasicWideStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicWideStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicWideStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicWideStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicWideStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicWideStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicWideStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicWideStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BasicWideStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicWideStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicWideStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicWideStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicWideStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BasicWideStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicWideStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_new_string = TypeObjectUtils::build_common_struct_member(member_id_new_string, member_flags_new_string, type_ids_BasicWideStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BasicWideStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BasicWideStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicWideStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BasicWideStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicWideStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BasicWideStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicWideStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BasicWideStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BasicWideStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BasicWideStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicWideStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicWideStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BasicWideStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BasicWideStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BasicWideStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_new_string = TypeObjectUtils::build_common_struct_member(member_id_new_string, member_flags_new_string, type_ids_BasicWideStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure new_string member TypeIdentifier inconsistent."); - return; - } - MemberName name_new_string = "new_string"; - eprosima::fastcdr::optional member_ann_builtin_new_string; - ann_custom_BasicWideStruct.reset(); - CompleteMemberDetail detail_new_string = TypeObjectUtils::build_complete_member_detail(name_new_string, member_ann_builtin_new_string, ann_custom_BasicWideStruct); - CompleteStructMember member_new_string = TypeObjectUtils::build_complete_struct_member(common_new_string, detail_new_string); - TypeObjectUtils::add_complete_struct_member(member_seq_BasicWideStruct, member_new_string); - } - CompleteStructType struct_type_BasicWideStruct = TypeObjectUtils::build_complete_struct_type(struct_flags_BasicWideStruct, header_BasicWideStruct, member_seq_BasicWideStruct); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_BasicWideStruct, type_name_BasicWideStruct.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "BasicWideStruct already registered in TypeObjectRegistry for a different type."); - } - return_code_BasicWideStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "BasicWideStruct", type_ids_BasicWideStruct); - if (return_code_BasicWideStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "BasicWideStruct: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } -} -void register_BadBasicWideStruct_type_identifier() -{ - { - StructTypeFlag struct_flags_BadBasicWideStruct = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_BadBasicWideStruct; - TypeIdentifierPair type_ids_BadBasicWideStruct; - QualifiedTypeName type_name_BadBasicWideStruct = "BadBasicWideStruct"; - eprosima::fastcdr::optional type_ann_builtin_BadBasicWideStruct; - eprosima::fastcdr::optional ann_custom_BadBasicWideStruct; - CompleteTypeDetail detail_BadBasicWideStruct = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_BadBasicWideStruct, ann_custom_BadBasicWideStruct, type_name_BadBasicWideStruct.to_string()); - CompleteStructHeader header_BadBasicWideStruct; - header_BadBasicWideStruct = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_BadBasicWideStruct); - CompleteStructMemberSeq member_seq_BadBasicWideStruct; - { - return_code_BadBasicWideStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_BadBasicWideStruct); - - if (return_code_BadBasicWideStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "new_int32 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_new_int32 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_new_int32; - MemberId member_id_new_int32 = 0x00000000; - if (EK_COMPLETE == type_ids_BadBasicWideStruct.type_identifier1()._d() || TK_NONE == type_ids_BadBasicWideStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BadBasicWideStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BadBasicWideStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BadBasicWideStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BadBasicWideStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BadBasicWideStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BadBasicWideStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BadBasicWideStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BadBasicWideStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BadBasicWideStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BadBasicWideStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BadBasicWideStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BadBasicWideStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BadBasicWideStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BadBasicWideStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_new_int32 = TypeObjectUtils::build_common_struct_member(member_id_new_int32, member_flags_new_int32, type_ids_BadBasicWideStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BadBasicWideStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BadBasicWideStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BadBasicWideStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BadBasicWideStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BadBasicWideStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BadBasicWideStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BadBasicWideStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BadBasicWideStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BadBasicWideStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BadBasicWideStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BadBasicWideStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BadBasicWideStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BadBasicWideStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BadBasicWideStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BadBasicWideStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_new_int32 = TypeObjectUtils::build_common_struct_member(member_id_new_int32, member_flags_new_int32, type_ids_BadBasicWideStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure new_int32 member TypeIdentifier inconsistent."); - return; - } - MemberName name_new_int32 = "new_int32"; - eprosima::fastcdr::optional member_ann_builtin_new_int32; - ann_custom_BadBasicWideStruct.reset(); - CompleteMemberDetail detail_new_int32 = TypeObjectUtils::build_complete_member_detail(name_new_int32, member_ann_builtin_new_int32, ann_custom_BadBasicWideStruct); - CompleteStructMember member_new_int32 = TypeObjectUtils::build_complete_struct_member(common_new_int32, detail_new_int32); - TypeObjectUtils::add_complete_struct_member(member_seq_BadBasicWideStruct, member_new_int32); - } - { - return_code_BadBasicWideStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_string_unbounded", type_ids_BadBasicWideStruct); - - if (return_code_BadBasicWideStruct != 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_BadBasicWideStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_string_unbounded", type_ids_BadBasicWideStruct); - if (return_code_BadBasicWideStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_string_unbounded: Given String TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_new_string = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_new_string; - MemberId member_id_new_string = 0x00000001; - if (EK_COMPLETE == type_ids_BadBasicWideStruct.type_identifier1()._d() || TK_NONE == type_ids_BadBasicWideStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BadBasicWideStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BadBasicWideStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BadBasicWideStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BadBasicWideStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BadBasicWideStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BadBasicWideStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BadBasicWideStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BadBasicWideStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BadBasicWideStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BadBasicWideStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BadBasicWideStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BadBasicWideStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BadBasicWideStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BadBasicWideStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_new_string = TypeObjectUtils::build_common_struct_member(member_id_new_string, member_flags_new_string, type_ids_BadBasicWideStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BadBasicWideStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BadBasicWideStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BadBasicWideStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BadBasicWideStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BadBasicWideStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BadBasicWideStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BadBasicWideStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BadBasicWideStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BadBasicWideStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BadBasicWideStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BadBasicWideStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BadBasicWideStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BadBasicWideStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BadBasicWideStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BadBasicWideStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_new_string = TypeObjectUtils::build_common_struct_member(member_id_new_string, member_flags_new_string, type_ids_BadBasicWideStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure new_string member TypeIdentifier inconsistent."); - return; - } - MemberName name_new_string = "new_string"; - eprosima::fastcdr::optional member_ann_builtin_new_string; - ann_custom_BadBasicWideStruct.reset(); - CompleteMemberDetail detail_new_string = TypeObjectUtils::build_complete_member_detail(name_new_string, member_ann_builtin_new_string, ann_custom_BadBasicWideStruct); - CompleteStructMember member_new_string = TypeObjectUtils::build_complete_struct_member(common_new_string, detail_new_string); - TypeObjectUtils::add_complete_struct_member(member_seq_BadBasicWideStruct, member_new_string); - } - { - return_code_BadBasicWideStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_bool", type_ids_BadBasicWideStruct); - - if (return_code_BadBasicWideStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_bool Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_bool = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_bool; - MemberId member_id_my_bool = 0x00000002; - if (EK_COMPLETE == type_ids_BadBasicWideStruct.type_identifier1()._d() || TK_NONE == type_ids_BadBasicWideStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BadBasicWideStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BadBasicWideStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BadBasicWideStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BadBasicWideStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BadBasicWideStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BadBasicWideStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BadBasicWideStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BadBasicWideStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BadBasicWideStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BadBasicWideStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BadBasicWideStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BadBasicWideStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BadBasicWideStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BadBasicWideStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_bool = TypeObjectUtils::build_common_struct_member(member_id_my_bool, member_flags_my_bool, type_ids_BadBasicWideStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BadBasicWideStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BadBasicWideStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BadBasicWideStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BadBasicWideStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BadBasicWideStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BadBasicWideStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BadBasicWideStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BadBasicWideStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BadBasicWideStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BadBasicWideStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BadBasicWideStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BadBasicWideStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BadBasicWideStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BadBasicWideStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BadBasicWideStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_bool = TypeObjectUtils::build_common_struct_member(member_id_my_bool, member_flags_my_bool, type_ids_BadBasicWideStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_bool member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_bool = "my_bool"; - eprosima::fastcdr::optional member_ann_builtin_my_bool; - ann_custom_BadBasicWideStruct.reset(); - CompleteMemberDetail detail_my_bool = TypeObjectUtils::build_complete_member_detail(name_my_bool, member_ann_builtin_my_bool, ann_custom_BadBasicWideStruct); - CompleteStructMember member_my_bool = TypeObjectUtils::build_complete_struct_member(common_my_bool, detail_my_bool); - TypeObjectUtils::add_complete_struct_member(member_seq_BadBasicWideStruct, member_my_bool); - } - { - return_code_BadBasicWideStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_BadBasicWideStruct); - - if (return_code_BadBasicWideStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "my_int32 Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_my_int32 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_int32; - MemberId member_id_my_int32 = 0x00000003; - if (EK_COMPLETE == type_ids_BadBasicWideStruct.type_identifier1()._d() || TK_NONE == type_ids_BadBasicWideStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BadBasicWideStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BadBasicWideStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BadBasicWideStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BadBasicWideStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BadBasicWideStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BadBasicWideStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BadBasicWideStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BadBasicWideStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BadBasicWideStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BadBasicWideStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BadBasicWideStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BadBasicWideStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BadBasicWideStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BadBasicWideStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_int32 = TypeObjectUtils::build_common_struct_member(member_id_my_int32, member_flags_my_int32, type_ids_BadBasicWideStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BadBasicWideStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BadBasicWideStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BadBasicWideStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BadBasicWideStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BadBasicWideStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BadBasicWideStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BadBasicWideStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BadBasicWideStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BadBasicWideStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BadBasicWideStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BadBasicWideStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BadBasicWideStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BadBasicWideStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BadBasicWideStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BadBasicWideStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_int32 = TypeObjectUtils::build_common_struct_member(member_id_my_int32, member_flags_my_int32, type_ids_BadBasicWideStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_int32 member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_int32 = "my_int32"; - eprosima::fastcdr::optional member_ann_builtin_my_int32; - ann_custom_BadBasicWideStruct.reset(); - CompleteMemberDetail detail_my_int32 = TypeObjectUtils::build_complete_member_detail(name_my_int32, member_ann_builtin_my_int32, ann_custom_BadBasicWideStruct); - CompleteStructMember member_my_int32 = TypeObjectUtils::build_complete_struct_member(common_my_int32, detail_my_int32); - TypeObjectUtils::add_complete_struct_member(member_seq_BadBasicWideStruct, member_my_int32); - } - { - return_code_BadBasicWideStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_string_unbounded", type_ids_BadBasicWideStruct); - - if (return_code_BadBasicWideStruct != 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_BadBasicWideStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_string_unbounded", type_ids_BadBasicWideStruct); - if (return_code_BadBasicWideStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_string_unbounded: Given String TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_string = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_string; - MemberId member_id_my_string = 0x00000004; - if (EK_COMPLETE == type_ids_BadBasicWideStruct.type_identifier1()._d() || TK_NONE == type_ids_BadBasicWideStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BadBasicWideStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BadBasicWideStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BadBasicWideStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BadBasicWideStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BadBasicWideStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BadBasicWideStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BadBasicWideStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_BadBasicWideStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BadBasicWideStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BadBasicWideStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BadBasicWideStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BadBasicWideStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_BadBasicWideStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BadBasicWideStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_string = TypeObjectUtils::build_common_struct_member(member_id_my_string, member_flags_my_string, type_ids_BadBasicWideStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_BadBasicWideStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_BadBasicWideStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BadBasicWideStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_BadBasicWideStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BadBasicWideStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_BadBasicWideStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BadBasicWideStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_BadBasicWideStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_BadBasicWideStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_BadBasicWideStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BadBasicWideStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BadBasicWideStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_BadBasicWideStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_BadBasicWideStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_BadBasicWideStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_string = TypeObjectUtils::build_common_struct_member(member_id_my_string, member_flags_my_string, type_ids_BadBasicWideStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_string member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_string = "my_string"; - eprosima::fastcdr::optional member_ann_builtin_my_string; - ann_custom_BadBasicWideStruct.reset(); - CompleteMemberDetail detail_my_string = TypeObjectUtils::build_complete_member_detail(name_my_string, member_ann_builtin_my_string, ann_custom_BadBasicWideStruct); - CompleteStructMember member_my_string = TypeObjectUtils::build_complete_struct_member(common_my_string, detail_my_string); - TypeObjectUtils::add_complete_struct_member(member_seq_BadBasicWideStruct, member_my_string); - } - CompleteStructType struct_type_BadBasicWideStruct = TypeObjectUtils::build_complete_struct_type(struct_flags_BadBasicWideStruct, header_BadBasicWideStruct, member_seq_BadBasicWideStruct); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_BadBasicWideStruct, type_name_BadBasicWideStruct.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "BadBasicWideStruct already registered in TypeObjectRegistry for a different type."); - } - return_code_BadBasicWideStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "BadBasicWideStruct", type_ids_BadBasicWideStruct); - if (return_code_BadBasicWideStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "BadBasicWideStruct: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } -} -void register_StringStruct_type_identifier() -{ - { - StructTypeFlag struct_flags_StringStruct = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_StringStruct; - TypeIdentifierPair type_ids_StringStruct; - QualifiedTypeName type_name_StringStruct = "StringStruct"; - eprosima::fastcdr::optional type_ann_builtin_StringStruct; - eprosima::fastcdr::optional ann_custom_StringStruct; - CompleteTypeDetail detail_StringStruct = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_StringStruct, ann_custom_StringStruct, type_name_StringStruct.to_string()); - CompleteStructHeader header_StringStruct; - header_StringStruct = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_StringStruct); - CompleteStructMemberSeq member_seq_StringStruct; - { - return_code_StringStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_string_unbounded", type_ids_StringStruct); - - if (return_code_StringStruct != 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_StringStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_string_unbounded", type_ids_StringStruct); - if (return_code_StringStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_string_unbounded: Given String TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_string = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_string; - MemberId member_id_my_string = 0x00000000; - if (EK_COMPLETE == type_ids_StringStruct.type_identifier1()._d() || TK_NONE == type_ids_StringStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_StringStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_StringStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_StringStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_StringStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_StringStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_StringStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_StringStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_StringStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_StringStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_StringStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_StringStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_StringStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_StringStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_StringStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_string = TypeObjectUtils::build_common_struct_member(member_id_my_string, member_flags_my_string, type_ids_StringStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_StringStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_StringStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_StringStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_StringStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_StringStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_StringStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_StringStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_StringStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_StringStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_StringStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_StringStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_StringStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_StringStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_StringStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_StringStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_string = TypeObjectUtils::build_common_struct_member(member_id_my_string, member_flags_my_string, type_ids_StringStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_string member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_string = "my_string"; - eprosima::fastcdr::optional member_ann_builtin_my_string; - ann_custom_StringStruct.reset(); - CompleteMemberDetail detail_my_string = TypeObjectUtils::build_complete_member_detail(name_my_string, member_ann_builtin_my_string, ann_custom_StringStruct); - CompleteStructMember member_my_string = TypeObjectUtils::build_complete_struct_member(common_my_string, detail_my_string); - TypeObjectUtils::add_complete_struct_member(member_seq_StringStruct, member_my_string); - } - CompleteStructType struct_type_StringStruct = TypeObjectUtils::build_complete_struct_type(struct_flags_StringStruct, header_StringStruct, member_seq_StringStruct); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_StringStruct, type_name_StringStruct.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "StringStruct already registered in TypeObjectRegistry for a different type."); - } - return_code_StringStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "StringStruct", type_ids_StringStruct); - if (return_code_StringStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "StringStruct: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } -} -void register_LargeStringStruct_type_identifier() -{ - { - StructTypeFlag struct_flags_LargeStringStruct = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_LargeStringStruct; - TypeIdentifierPair type_ids_LargeStringStruct; - QualifiedTypeName type_name_LargeStringStruct = "LargeStringStruct"; - eprosima::fastcdr::optional type_ann_builtin_LargeStringStruct; - eprosima::fastcdr::optional ann_custom_LargeStringStruct; - CompleteTypeDetail detail_LargeStringStruct = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_LargeStringStruct, ann_custom_LargeStringStruct, type_name_LargeStringStruct.to_string()); - CompleteStructHeader header_LargeStringStruct; - header_LargeStringStruct = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_LargeStringStruct); - CompleteStructMemberSeq member_seq_LargeStringStruct; - { - return_code_LargeStringStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_string_41925", type_ids_LargeStringStruct); - - if (return_code_LargeStringStruct != eprosima::fastdds::dds::RETCODE_OK) - { - std::string type_id_kind_anonymous_string_41925("TI_STRING8_LARGE"); - if (type_id_kind_anonymous_string_41925 == "TI_STRING8_SMALL") - { - SBound bound = static_cast(41925); - 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_41925")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_string_41925 already registered in TypeObjectRegistry for a different type."); - } - } - else if (type_id_kind_anonymous_string_41925 == "TI_STRING8_LARGE") - { - LBound bound = 41925; - 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_41925")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_string_41925 already registered in TypeObjectRegistry for a different type."); - } - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_string_41925: Unknown String kind."); - return; - } - return_code_LargeStringStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_string_41925", type_ids_LargeStringStruct); - if (return_code_LargeStringStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_string_41925: Given String TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_large_string = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_large_string; - MemberId member_id_my_large_string = 0x00000000; - if (EK_COMPLETE == type_ids_LargeStringStruct.type_identifier1()._d() || TK_NONE == type_ids_LargeStringStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_LargeStringStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_LargeStringStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_LargeStringStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_LargeStringStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_LargeStringStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_LargeStringStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_LargeStringStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_LargeStringStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_LargeStringStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_LargeStringStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_LargeStringStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_LargeStringStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_LargeStringStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_LargeStringStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_large_string = TypeObjectUtils::build_common_struct_member(member_id_my_large_string, member_flags_my_large_string, type_ids_LargeStringStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_LargeStringStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_LargeStringStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_LargeStringStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_LargeStringStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_LargeStringStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_LargeStringStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_LargeStringStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_LargeStringStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_LargeStringStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_LargeStringStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_LargeStringStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_LargeStringStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_LargeStringStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_LargeStringStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_LargeStringStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_large_string = TypeObjectUtils::build_common_struct_member(member_id_my_large_string, member_flags_my_large_string, type_ids_LargeStringStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_large_string member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_large_string = "my_large_string"; - eprosima::fastcdr::optional member_ann_builtin_my_large_string; - ann_custom_LargeStringStruct.reset(); - CompleteMemberDetail detail_my_large_string = TypeObjectUtils::build_complete_member_detail(name_my_large_string, member_ann_builtin_my_large_string, ann_custom_LargeStringStruct); - CompleteStructMember member_my_large_string = TypeObjectUtils::build_complete_struct_member(common_my_large_string, detail_my_large_string); - TypeObjectUtils::add_complete_struct_member(member_seq_LargeStringStruct, member_my_large_string); - } - CompleteStructType struct_type_LargeStringStruct = TypeObjectUtils::build_complete_struct_type(struct_flags_LargeStringStruct, header_LargeStringStruct, member_seq_LargeStringStruct); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_LargeStringStruct, type_name_LargeStringStruct.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "LargeStringStruct already registered in TypeObjectRegistry for a different type."); - } - return_code_LargeStringStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "LargeStringStruct", type_ids_LargeStringStruct); - if (return_code_LargeStringStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "LargeStringStruct: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } -} -void register_WStringStruct_type_identifier() -{ - { - StructTypeFlag struct_flags_WStringStruct = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_WStringStruct; - TypeIdentifierPair type_ids_WStringStruct; - QualifiedTypeName type_name_WStringStruct = "WStringStruct"; - eprosima::fastcdr::optional type_ann_builtin_WStringStruct; - eprosima::fastcdr::optional ann_custom_WStringStruct; - CompleteTypeDetail detail_WStringStruct = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_WStringStruct, ann_custom_WStringStruct, type_name_WStringStruct.to_string()); - CompleteStructHeader header_WStringStruct; - header_WStringStruct = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_WStringStruct); - CompleteStructMemberSeq member_seq_WStringStruct; - { - return_code_WStringStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_wstring_unbounded", type_ids_WStringStruct); - - if (return_code_WStringStruct != eprosima::fastdds::dds::RETCODE_OK) - { - std::string type_id_kind_anonymous_wstring_unbounded("TI_STRING16_SMALL"); - if (type_id_kind_anonymous_wstring_unbounded == "TI_STRING16_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_wstring_unbounded", true)) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_wstring_unbounded already registered in TypeObjectRegistry for a different type."); - } - } - else if (type_id_kind_anonymous_wstring_unbounded == "TI_STRING16_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_wstring_unbounded", true)) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_wstring_unbounded already registered in TypeObjectRegistry for a different type."); - } - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_wstring_unbounded: Unknown WString kind."); - return; - } - return_code_WStringStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_wstring_unbounded", type_ids_WStringStruct); - if (return_code_WStringStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_wstring_unbounded: Given WString TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_wstring = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_wstring; - MemberId member_id_my_wstring = 0x00000000; - if (EK_COMPLETE == type_ids_WStringStruct.type_identifier1()._d() || TK_NONE == type_ids_WStringStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_WStringStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_WStringStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_WStringStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_WStringStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_WStringStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_WStringStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_WStringStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_WStringStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_WStringStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_WStringStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_WStringStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_WStringStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_WStringStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_WStringStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_wstring = TypeObjectUtils::build_common_struct_member(member_id_my_wstring, member_flags_my_wstring, type_ids_WStringStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_WStringStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_WStringStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_WStringStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_WStringStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_WStringStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_WStringStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_WStringStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_WStringStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_WStringStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_WStringStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_WStringStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_WStringStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_WStringStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_WStringStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_WStringStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_wstring = TypeObjectUtils::build_common_struct_member(member_id_my_wstring, member_flags_my_wstring, type_ids_WStringStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_wstring member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_wstring = "my_wstring"; - eprosima::fastcdr::optional member_ann_builtin_my_wstring; - ann_custom_WStringStruct.reset(); - CompleteMemberDetail detail_my_wstring = TypeObjectUtils::build_complete_member_detail(name_my_wstring, member_ann_builtin_my_wstring, ann_custom_WStringStruct); - CompleteStructMember member_my_wstring = TypeObjectUtils::build_complete_struct_member(common_my_wstring, detail_my_wstring); - TypeObjectUtils::add_complete_struct_member(member_seq_WStringStruct, member_my_wstring); - } - CompleteStructType struct_type_WStringStruct = TypeObjectUtils::build_complete_struct_type(struct_flags_WStringStruct, header_WStringStruct, member_seq_WStringStruct); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_WStringStruct, type_name_WStringStruct.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "WStringStruct already registered in TypeObjectRegistry for a different type."); - } - return_code_WStringStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "WStringStruct", type_ids_WStringStruct); - if (return_code_WStringStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "WStringStruct: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } -} -void register_LargeWStringStruct_type_identifier() -{ - { - StructTypeFlag struct_flags_LargeWStringStruct = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_LargeWStringStruct; - TypeIdentifierPair type_ids_LargeWStringStruct; - QualifiedTypeName type_name_LargeWStringStruct = "LargeWStringStruct"; - eprosima::fastcdr::optional type_ann_builtin_LargeWStringStruct; - eprosima::fastcdr::optional ann_custom_LargeWStringStruct; - CompleteTypeDetail detail_LargeWStringStruct = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_LargeWStringStruct, ann_custom_LargeWStringStruct, type_name_LargeWStringStruct.to_string()); - CompleteStructHeader header_LargeWStringStruct; - header_LargeWStringStruct = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_LargeWStringStruct); - CompleteStructMemberSeq member_seq_LargeWStringStruct; - { - return_code_LargeWStringStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_wstring_41925", type_ids_LargeWStringStruct); - - if (return_code_LargeWStringStruct != eprosima::fastdds::dds::RETCODE_OK) - { - std::string type_id_kind_anonymous_wstring_41925("TI_STRING16_LARGE"); - if (type_id_kind_anonymous_wstring_41925 == "TI_STRING16_SMALL") - { - SBound bound = static_cast(41925); - 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_wstring_41925", true)) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_wstring_41925 already registered in TypeObjectRegistry for a different type."); - } - } - else if (type_id_kind_anonymous_wstring_41925 == "TI_STRING16_LARGE") - { - LBound bound = 41925; - 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_wstring_41925", true)) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_wstring_41925 already registered in TypeObjectRegistry for a different type."); - } - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_wstring_41925: Unknown WString kind."); - return; - } - return_code_LargeWStringStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_wstring_41925", type_ids_LargeWStringStruct); - if (return_code_LargeWStringStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_wstring_41925: Given WString TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_large_wstring = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_large_wstring; - MemberId member_id_my_large_wstring = 0x00000000; - if (EK_COMPLETE == type_ids_LargeWStringStruct.type_identifier1()._d() || TK_NONE == type_ids_LargeWStringStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_LargeWStringStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_LargeWStringStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_LargeWStringStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_LargeWStringStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_LargeWStringStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_LargeWStringStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_LargeWStringStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_LargeWStringStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_LargeWStringStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_LargeWStringStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_LargeWStringStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_LargeWStringStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_LargeWStringStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_LargeWStringStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_large_wstring = TypeObjectUtils::build_common_struct_member(member_id_my_large_wstring, member_flags_my_large_wstring, type_ids_LargeWStringStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_LargeWStringStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_LargeWStringStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_LargeWStringStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_LargeWStringStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_LargeWStringStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_LargeWStringStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_LargeWStringStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_LargeWStringStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_LargeWStringStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_LargeWStringStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_LargeWStringStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_LargeWStringStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_LargeWStringStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_LargeWStringStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_LargeWStringStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_large_wstring = TypeObjectUtils::build_common_struct_member(member_id_my_large_wstring, member_flags_my_large_wstring, type_ids_LargeWStringStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_large_wstring member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_large_wstring = "my_large_wstring"; - eprosima::fastcdr::optional member_ann_builtin_my_large_wstring; - ann_custom_LargeWStringStruct.reset(); - CompleteMemberDetail detail_my_large_wstring = TypeObjectUtils::build_complete_member_detail(name_my_large_wstring, member_ann_builtin_my_large_wstring, ann_custom_LargeWStringStruct); - CompleteStructMember member_my_large_wstring = TypeObjectUtils::build_complete_struct_member(common_my_large_wstring, detail_my_large_wstring); - TypeObjectUtils::add_complete_struct_member(member_seq_LargeWStringStruct, member_my_large_wstring); - } - CompleteStructType struct_type_LargeWStringStruct = TypeObjectUtils::build_complete_struct_type(struct_flags_LargeWStringStruct, header_LargeWStringStruct, member_seq_LargeWStringStruct); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_LargeWStringStruct, type_name_LargeWStringStruct.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "LargeWStringStruct already registered in TypeObjectRegistry for a different type."); - } - return_code_LargeWStringStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "LargeWStringStruct", type_ids_LargeWStringStruct); - if (return_code_LargeWStringStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "LargeWStringStruct: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } -} -void register_ArrayStruct_type_identifier() -{ - { - StructTypeFlag struct_flags_ArrayStruct = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_ArrayStruct; - TypeIdentifierPair type_ids_ArrayStruct; - QualifiedTypeName type_name_ArrayStruct = "ArrayStruct"; - eprosima::fastcdr::optional type_ann_builtin_ArrayStruct; - eprosima::fastcdr::optional ann_custom_ArrayStruct; - CompleteTypeDetail detail_ArrayStruct = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_ArrayStruct, ann_custom_ArrayStruct, type_name_ArrayStruct.to_string()); - CompleteStructHeader header_ArrayStruct; - header_ArrayStruct = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_ArrayStruct); - CompleteStructMemberSeq member_seq_ArrayStruct; - { - return_code_ArrayStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_array_int32_t_2", type_ids_ArrayStruct); - - if (return_code_ArrayStruct != eprosima::fastdds::dds::RETCODE_OK) - { - return_code_ArrayStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_ArrayStruct); - - if (return_code_ArrayStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Array element TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - TypeIdentifier* element_identifier_anonymous_array_int32_t_2 {nullptr}; - if (EK_COMPLETE == type_ids_ArrayStruct.type_identifier1()._d() || TK_NONE == type_ids_ArrayStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ArrayStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ArrayStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ArrayStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ArrayStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ArrayStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ArrayStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ArrayStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ArrayStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ArrayStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ArrayStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ArrayStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ArrayStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ArrayStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ArrayStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_array_int32_t_2 = new TypeIdentifier(type_ids_ArrayStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ArrayStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ArrayStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ArrayStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ArrayStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ArrayStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ArrayStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ArrayStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ArrayStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ArrayStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ArrayStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ArrayStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ArrayStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ArrayStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ArrayStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ArrayStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_array_int32_t_2 = new TypeIdentifier(type_ids_ArrayStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Array element TypeIdentifier inconsistent."); - return; - } - EquivalenceKind equiv_kind_anonymous_array_int32_t_2 = EK_COMPLETE; - if (TK_NONE == type_ids_ArrayStruct.type_identifier2()._d()) - { - equiv_kind_anonymous_array_int32_t_2 = EK_BOTH; - } - CollectionElementFlag element_flags_anonymous_array_int32_t_2 = 0; - PlainCollectionHeader header_anonymous_array_int32_t_2 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_int32_t_2, element_flags_anonymous_array_int32_t_2); - std::string type_id_kind_anonymous_array_int32_t_2("TI_PLAIN_ARRAY_SMALL"); - if (type_id_kind_anonymous_array_int32_t_2 == "TI_PLAIN_ARRAY_SMALL") - { - SBoundSeq array_bound_seq; - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(2)); - - PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_int32_t_2, array_bound_seq, - eprosima::fastcdr::external(element_identifier_anonymous_array_int32_t_2)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_int32_t_2")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_int32_t_2 already registered in TypeObjectRegistry for a different type."); - } - } - else - { - LBoundSeq array_bound_seq; - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(2)); - - PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_int32_t_2, array_bound_seq, - eprosima::fastcdr::external(element_identifier_anonymous_array_int32_t_2)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_int32_t_2")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_int32_t_2 already registered in TypeObjectRegistry for a different type."); - } - } - return_code_ArrayStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_array_int32_t_2", type_ids_ArrayStruct); - if (return_code_ArrayStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_int32_t_2: Given Array TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_array = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_array; - MemberId member_id_my_array = 0x00000000; - if (EK_COMPLETE == type_ids_ArrayStruct.type_identifier1()._d() || TK_NONE == type_ids_ArrayStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ArrayStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ArrayStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ArrayStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ArrayStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ArrayStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ArrayStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ArrayStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ArrayStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ArrayStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ArrayStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ArrayStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ArrayStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ArrayStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ArrayStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_array = TypeObjectUtils::build_common_struct_member(member_id_my_array, member_flags_my_array, type_ids_ArrayStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ArrayStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ArrayStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ArrayStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ArrayStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ArrayStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ArrayStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ArrayStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ArrayStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ArrayStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ArrayStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ArrayStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ArrayStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ArrayStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ArrayStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ArrayStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_array = TypeObjectUtils::build_common_struct_member(member_id_my_array, member_flags_my_array, type_ids_ArrayStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_array member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_array = "my_array"; - eprosima::fastcdr::optional member_ann_builtin_my_array; - ann_custom_ArrayStruct.reset(); - CompleteMemberDetail detail_my_array = TypeObjectUtils::build_complete_member_detail(name_my_array, member_ann_builtin_my_array, ann_custom_ArrayStruct); - CompleteStructMember member_my_array = TypeObjectUtils::build_complete_struct_member(common_my_array, detail_my_array); - TypeObjectUtils::add_complete_struct_member(member_seq_ArrayStruct, member_my_array); - } - CompleteStructType struct_type_ArrayStruct = TypeObjectUtils::build_complete_struct_type(struct_flags_ArrayStruct, header_ArrayStruct, member_seq_ArrayStruct); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_ArrayStruct, type_name_ArrayStruct.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "ArrayStruct already registered in TypeObjectRegistry for a different type."); - } - return_code_ArrayStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "ArrayStruct", type_ids_ArrayStruct); - if (return_code_ArrayStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "ArrayStruct: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } -} -void register_ArrayStructEqual_type_identifier() -{ - { - StructTypeFlag struct_flags_ArrayStructEqual = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_ArrayStructEqual; - TypeIdentifierPair type_ids_ArrayStructEqual; - QualifiedTypeName type_name_ArrayStructEqual = "ArrayStructEqual"; - eprosima::fastcdr::optional type_ann_builtin_ArrayStructEqual; - eprosima::fastcdr::optional ann_custom_ArrayStructEqual; - CompleteTypeDetail detail_ArrayStructEqual = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_ArrayStructEqual, ann_custom_ArrayStructEqual, type_name_ArrayStructEqual.to_string()); - CompleteStructHeader header_ArrayStructEqual; - header_ArrayStructEqual = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_ArrayStructEqual); - CompleteStructMemberSeq member_seq_ArrayStructEqual; - { - return_code_ArrayStructEqual = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_array_int32_t_2", type_ids_ArrayStructEqual); - - if (return_code_ArrayStructEqual != eprosima::fastdds::dds::RETCODE_OK) - { - return_code_ArrayStructEqual = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_ArrayStructEqual); - - if (return_code_ArrayStructEqual != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Array element TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - TypeIdentifier* element_identifier_anonymous_array_int32_t_2 {nullptr}; - if (EK_COMPLETE == type_ids_ArrayStructEqual.type_identifier1()._d() || TK_NONE == type_ids_ArrayStructEqual.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ArrayStructEqual.type_identifier1()._d() && - EK_COMPLETE == type_ids_ArrayStructEqual.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ArrayStructEqual.type_identifier1()._d() && - EK_COMPLETE == type_ids_ArrayStructEqual.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ArrayStructEqual.type_identifier1()._d() && - EK_COMPLETE == type_ids_ArrayStructEqual.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ArrayStructEqual.type_identifier1()._d() && - EK_COMPLETE == type_ids_ArrayStructEqual.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ArrayStructEqual.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ArrayStructEqual.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ArrayStructEqual.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ArrayStructEqual.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ArrayStructEqual.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ArrayStructEqual.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_array_int32_t_2 = new TypeIdentifier(type_ids_ArrayStructEqual.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ArrayStructEqual.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ArrayStructEqual.type_identifier2()._d() && - EK_COMPLETE == type_ids_ArrayStructEqual.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ArrayStructEqual.type_identifier2()._d() && - EK_COMPLETE == type_ids_ArrayStructEqual.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ArrayStructEqual.type_identifier2()._d() && - EK_COMPLETE == type_ids_ArrayStructEqual.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ArrayStructEqual.type_identifier2()._d() && - EK_COMPLETE == type_ids_ArrayStructEqual.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ArrayStructEqual.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ArrayStructEqual.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ArrayStructEqual.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ArrayStructEqual.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ArrayStructEqual.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ArrayStructEqual.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_array_int32_t_2 = new TypeIdentifier(type_ids_ArrayStructEqual.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Array element TypeIdentifier inconsistent."); - return; - } - EquivalenceKind equiv_kind_anonymous_array_int32_t_2 = EK_COMPLETE; - if (TK_NONE == type_ids_ArrayStructEqual.type_identifier2()._d()) - { - equiv_kind_anonymous_array_int32_t_2 = EK_BOTH; - } - CollectionElementFlag element_flags_anonymous_array_int32_t_2 = 0; - PlainCollectionHeader header_anonymous_array_int32_t_2 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_int32_t_2, element_flags_anonymous_array_int32_t_2); - std::string type_id_kind_anonymous_array_int32_t_2("TI_PLAIN_ARRAY_SMALL"); - if (type_id_kind_anonymous_array_int32_t_2 == "TI_PLAIN_ARRAY_SMALL") - { - SBoundSeq array_bound_seq; - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(2)); - - PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_int32_t_2, array_bound_seq, - eprosima::fastcdr::external(element_identifier_anonymous_array_int32_t_2)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_int32_t_2")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_int32_t_2 already registered in TypeObjectRegistry for a different type."); - } - } - else - { - LBoundSeq array_bound_seq; - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(2)); - - PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_int32_t_2, array_bound_seq, - eprosima::fastcdr::external(element_identifier_anonymous_array_int32_t_2)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_int32_t_2")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_int32_t_2 already registered in TypeObjectRegistry for a different type."); - } - } - return_code_ArrayStructEqual = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_array_int32_t_2", type_ids_ArrayStructEqual); - if (return_code_ArrayStructEqual != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_int32_t_2: Given Array TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_array_equal = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_array_equal; - MemberId member_id_my_array_equal = 0x00000000; - if (EK_COMPLETE == type_ids_ArrayStructEqual.type_identifier1()._d() || TK_NONE == type_ids_ArrayStructEqual.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ArrayStructEqual.type_identifier1()._d() && - EK_COMPLETE == type_ids_ArrayStructEqual.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ArrayStructEqual.type_identifier1()._d() && - EK_COMPLETE == type_ids_ArrayStructEqual.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ArrayStructEqual.type_identifier1()._d() && - EK_COMPLETE == type_ids_ArrayStructEqual.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ArrayStructEqual.type_identifier1()._d() && - EK_COMPLETE == type_ids_ArrayStructEqual.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ArrayStructEqual.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ArrayStructEqual.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ArrayStructEqual.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ArrayStructEqual.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ArrayStructEqual.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ArrayStructEqual.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_array_equal = TypeObjectUtils::build_common_struct_member(member_id_my_array_equal, member_flags_my_array_equal, type_ids_ArrayStructEqual.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ArrayStructEqual.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ArrayStructEqual.type_identifier2()._d() && - EK_COMPLETE == type_ids_ArrayStructEqual.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ArrayStructEqual.type_identifier2()._d() && - EK_COMPLETE == type_ids_ArrayStructEqual.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ArrayStructEqual.type_identifier2()._d() && - EK_COMPLETE == type_ids_ArrayStructEqual.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ArrayStructEqual.type_identifier2()._d() && - EK_COMPLETE == type_ids_ArrayStructEqual.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ArrayStructEqual.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ArrayStructEqual.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ArrayStructEqual.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ArrayStructEqual.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ArrayStructEqual.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ArrayStructEqual.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_array_equal = TypeObjectUtils::build_common_struct_member(member_id_my_array_equal, member_flags_my_array_equal, type_ids_ArrayStructEqual.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_array_equal member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_array_equal = "my_array_equal"; - eprosima::fastcdr::optional member_ann_builtin_my_array_equal; - ann_custom_ArrayStructEqual.reset(); - CompleteMemberDetail detail_my_array_equal = TypeObjectUtils::build_complete_member_detail(name_my_array_equal, member_ann_builtin_my_array_equal, ann_custom_ArrayStructEqual); - CompleteStructMember member_my_array_equal = TypeObjectUtils::build_complete_struct_member(common_my_array_equal, detail_my_array_equal); - TypeObjectUtils::add_complete_struct_member(member_seq_ArrayStructEqual, member_my_array_equal); - } - CompleteStructType struct_type_ArrayStructEqual = TypeObjectUtils::build_complete_struct_type(struct_flags_ArrayStructEqual, header_ArrayStructEqual, member_seq_ArrayStructEqual); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_ArrayStructEqual, type_name_ArrayStructEqual.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "ArrayStructEqual already registered in TypeObjectRegistry for a different type."); - } - return_code_ArrayStructEqual = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "ArrayStructEqual", type_ids_ArrayStructEqual); - if (return_code_ArrayStructEqual != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "ArrayStructEqual: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } -} -void register_ArrayBadStruct_type_identifier() -{ - { - StructTypeFlag struct_flags_ArrayBadStruct = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_ArrayBadStruct; - TypeIdentifierPair type_ids_ArrayBadStruct; - QualifiedTypeName type_name_ArrayBadStruct = "ArrayBadStruct"; - eprosima::fastcdr::optional type_ann_builtin_ArrayBadStruct; - eprosima::fastcdr::optional ann_custom_ArrayBadStruct; - CompleteTypeDetail detail_ArrayBadStruct = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_ArrayBadStruct, ann_custom_ArrayBadStruct, type_name_ArrayBadStruct.to_string()); - CompleteStructHeader header_ArrayBadStruct; - header_ArrayBadStruct = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_ArrayBadStruct); - CompleteStructMemberSeq member_seq_ArrayBadStruct; - { - return_code_ArrayBadStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_array_uint8_t_2", type_ids_ArrayBadStruct); - - if (return_code_ArrayBadStruct != eprosima::fastdds::dds::RETCODE_OK) - { - return_code_ArrayBadStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_byte", type_ids_ArrayBadStruct); - - if (return_code_ArrayBadStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Array element TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - TypeIdentifier* element_identifier_anonymous_array_uint8_t_2 {nullptr}; - if (EK_COMPLETE == type_ids_ArrayBadStruct.type_identifier1()._d() || TK_NONE == type_ids_ArrayBadStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ArrayBadStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ArrayBadStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ArrayBadStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ArrayBadStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ArrayBadStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ArrayBadStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ArrayBadStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ArrayBadStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ArrayBadStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ArrayBadStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ArrayBadStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ArrayBadStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ArrayBadStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ArrayBadStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_array_uint8_t_2 = new TypeIdentifier(type_ids_ArrayBadStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ArrayBadStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ArrayBadStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ArrayBadStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ArrayBadStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ArrayBadStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ArrayBadStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ArrayBadStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ArrayBadStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ArrayBadStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ArrayBadStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ArrayBadStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ArrayBadStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ArrayBadStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ArrayBadStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ArrayBadStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_array_uint8_t_2 = new TypeIdentifier(type_ids_ArrayBadStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Array element TypeIdentifier inconsistent."); - return; - } - EquivalenceKind equiv_kind_anonymous_array_uint8_t_2 = EK_COMPLETE; - if (TK_NONE == type_ids_ArrayBadStruct.type_identifier2()._d()) - { - equiv_kind_anonymous_array_uint8_t_2 = EK_BOTH; - } - CollectionElementFlag element_flags_anonymous_array_uint8_t_2 = 0; - PlainCollectionHeader header_anonymous_array_uint8_t_2 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_2, element_flags_anonymous_array_uint8_t_2); - std::string type_id_kind_anonymous_array_uint8_t_2("TI_PLAIN_ARRAY_SMALL"); - if (type_id_kind_anonymous_array_uint8_t_2 == "TI_PLAIN_ARRAY_SMALL") - { - SBoundSeq array_bound_seq; - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(2)); - - PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_2, array_bound_seq, - eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_2)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_2")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_uint8_t_2 already registered in TypeObjectRegistry for a different type."); - } - } - else - { - LBoundSeq array_bound_seq; - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(2)); - - PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_2, array_bound_seq, - eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_2)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_2")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_uint8_t_2 already registered in TypeObjectRegistry for a different type."); - } - } - return_code_ArrayBadStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_array_uint8_t_2", type_ids_ArrayBadStruct); - if (return_code_ArrayBadStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_uint8_t_2: Given Array TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_array = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_array; - MemberId member_id_my_array = 0x00000000; - if (EK_COMPLETE == type_ids_ArrayBadStruct.type_identifier1()._d() || TK_NONE == type_ids_ArrayBadStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ArrayBadStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ArrayBadStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ArrayBadStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ArrayBadStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ArrayBadStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ArrayBadStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ArrayBadStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ArrayBadStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ArrayBadStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ArrayBadStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ArrayBadStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ArrayBadStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ArrayBadStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ArrayBadStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_array = TypeObjectUtils::build_common_struct_member(member_id_my_array, member_flags_my_array, type_ids_ArrayBadStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ArrayBadStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ArrayBadStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ArrayBadStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ArrayBadStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ArrayBadStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ArrayBadStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ArrayBadStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ArrayBadStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ArrayBadStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ArrayBadStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ArrayBadStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ArrayBadStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ArrayBadStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ArrayBadStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ArrayBadStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_array = TypeObjectUtils::build_common_struct_member(member_id_my_array, member_flags_my_array, type_ids_ArrayBadStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_array member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_array = "my_array"; - eprosima::fastcdr::optional member_ann_builtin_my_array; - ann_custom_ArrayBadStruct.reset(); - CompleteMemberDetail detail_my_array = TypeObjectUtils::build_complete_member_detail(name_my_array, member_ann_builtin_my_array, ann_custom_ArrayBadStruct); - CompleteStructMember member_my_array = TypeObjectUtils::build_complete_struct_member(common_my_array, detail_my_array); - TypeObjectUtils::add_complete_struct_member(member_seq_ArrayBadStruct, member_my_array); - } - CompleteStructType struct_type_ArrayBadStruct = TypeObjectUtils::build_complete_struct_type(struct_flags_ArrayBadStruct, header_ArrayBadStruct, member_seq_ArrayBadStruct); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_ArrayBadStruct, type_name_ArrayBadStruct.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "ArrayBadStruct already registered in TypeObjectRegistry for a different type."); - } - return_code_ArrayBadStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "ArrayBadStruct", type_ids_ArrayBadStruct); - if (return_code_ArrayBadStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "ArrayBadStruct: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } -} -void register_ArrayDimensionsStruct_type_identifier() -{ - { - StructTypeFlag struct_flags_ArrayDimensionsStruct = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_ArrayDimensionsStruct; - TypeIdentifierPair type_ids_ArrayDimensionsStruct; - QualifiedTypeName type_name_ArrayDimensionsStruct = "ArrayDimensionsStruct"; - eprosima::fastcdr::optional type_ann_builtin_ArrayDimensionsStruct; - eprosima::fastcdr::optional ann_custom_ArrayDimensionsStruct; - CompleteTypeDetail detail_ArrayDimensionsStruct = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_ArrayDimensionsStruct, ann_custom_ArrayDimensionsStruct, type_name_ArrayDimensionsStruct.to_string()); - CompleteStructHeader header_ArrayDimensionsStruct; - header_ArrayDimensionsStruct = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_ArrayDimensionsStruct); - CompleteStructMemberSeq member_seq_ArrayDimensionsStruct; - { - return_code_ArrayDimensionsStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_array_int32_t_2_2", type_ids_ArrayDimensionsStruct); - - if (return_code_ArrayDimensionsStruct != eprosima::fastdds::dds::RETCODE_OK) - { - return_code_ArrayDimensionsStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_ArrayDimensionsStruct); - - if (return_code_ArrayDimensionsStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Array element TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - TypeIdentifier* element_identifier_anonymous_array_int32_t_2_2 {nullptr}; - if (EK_COMPLETE == type_ids_ArrayDimensionsStruct.type_identifier1()._d() || TK_NONE == type_ids_ArrayDimensionsStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ArrayDimensionsStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ArrayDimensionsStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ArrayDimensionsStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ArrayDimensionsStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ArrayDimensionsStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ArrayDimensionsStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ArrayDimensionsStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ArrayDimensionsStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ArrayDimensionsStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ArrayDimensionsStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ArrayDimensionsStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ArrayDimensionsStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ArrayDimensionsStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ArrayDimensionsStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_array_int32_t_2_2 = new TypeIdentifier(type_ids_ArrayDimensionsStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ArrayDimensionsStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ArrayDimensionsStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ArrayDimensionsStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ArrayDimensionsStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ArrayDimensionsStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ArrayDimensionsStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ArrayDimensionsStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ArrayDimensionsStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ArrayDimensionsStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ArrayDimensionsStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ArrayDimensionsStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ArrayDimensionsStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ArrayDimensionsStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ArrayDimensionsStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ArrayDimensionsStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_array_int32_t_2_2 = new TypeIdentifier(type_ids_ArrayDimensionsStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Array element TypeIdentifier inconsistent."); - return; - } - EquivalenceKind equiv_kind_anonymous_array_int32_t_2_2 = EK_COMPLETE; - if (TK_NONE == type_ids_ArrayDimensionsStruct.type_identifier2()._d()) - { - equiv_kind_anonymous_array_int32_t_2_2 = EK_BOTH; - } - CollectionElementFlag element_flags_anonymous_array_int32_t_2_2 = 0; - PlainCollectionHeader header_anonymous_array_int32_t_2_2 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_int32_t_2_2, element_flags_anonymous_array_int32_t_2_2); - std::string type_id_kind_anonymous_array_int32_t_2_2("TI_PLAIN_ARRAY_SMALL"); - if (type_id_kind_anonymous_array_int32_t_2_2 == "TI_PLAIN_ARRAY_SMALL") - { - SBoundSeq array_bound_seq; - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(2)); - - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(2)); - - PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_int32_t_2_2, array_bound_seq, - eprosima::fastcdr::external(element_identifier_anonymous_array_int32_t_2_2)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_int32_t_2_2")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_int32_t_2_2 already registered in TypeObjectRegistry for a different type."); - } - } - else - { - LBoundSeq array_bound_seq; - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(2)); - - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(2)); - - PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_int32_t_2_2, array_bound_seq, - eprosima::fastcdr::external(element_identifier_anonymous_array_int32_t_2_2)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_int32_t_2_2")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_int32_t_2_2 already registered in TypeObjectRegistry for a different type."); - } - } - return_code_ArrayDimensionsStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_array_int32_t_2_2", type_ids_ArrayDimensionsStruct); - if (return_code_ArrayDimensionsStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_int32_t_2_2: Given Array TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_array = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_array; - MemberId member_id_my_array = 0x00000000; - if (EK_COMPLETE == type_ids_ArrayDimensionsStruct.type_identifier1()._d() || TK_NONE == type_ids_ArrayDimensionsStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ArrayDimensionsStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ArrayDimensionsStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ArrayDimensionsStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ArrayDimensionsStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ArrayDimensionsStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ArrayDimensionsStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ArrayDimensionsStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ArrayDimensionsStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ArrayDimensionsStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ArrayDimensionsStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ArrayDimensionsStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ArrayDimensionsStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ArrayDimensionsStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ArrayDimensionsStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_array = TypeObjectUtils::build_common_struct_member(member_id_my_array, member_flags_my_array, type_ids_ArrayDimensionsStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ArrayDimensionsStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ArrayDimensionsStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ArrayDimensionsStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ArrayDimensionsStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ArrayDimensionsStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ArrayDimensionsStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ArrayDimensionsStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ArrayDimensionsStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ArrayDimensionsStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ArrayDimensionsStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ArrayDimensionsStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ArrayDimensionsStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ArrayDimensionsStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ArrayDimensionsStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ArrayDimensionsStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_array = TypeObjectUtils::build_common_struct_member(member_id_my_array, member_flags_my_array, type_ids_ArrayDimensionsStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_array member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_array = "my_array"; - eprosima::fastcdr::optional member_ann_builtin_my_array; - ann_custom_ArrayDimensionsStruct.reset(); - CompleteMemberDetail detail_my_array = TypeObjectUtils::build_complete_member_detail(name_my_array, member_ann_builtin_my_array, ann_custom_ArrayDimensionsStruct); - CompleteStructMember member_my_array = TypeObjectUtils::build_complete_struct_member(common_my_array, detail_my_array); - TypeObjectUtils::add_complete_struct_member(member_seq_ArrayDimensionsStruct, member_my_array); - } - CompleteStructType struct_type_ArrayDimensionsStruct = TypeObjectUtils::build_complete_struct_type(struct_flags_ArrayDimensionsStruct, header_ArrayDimensionsStruct, member_seq_ArrayDimensionsStruct); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_ArrayDimensionsStruct, type_name_ArrayDimensionsStruct.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "ArrayDimensionsStruct already registered in TypeObjectRegistry for a different type."); - } - return_code_ArrayDimensionsStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "ArrayDimensionsStruct", type_ids_ArrayDimensionsStruct); - if (return_code_ArrayDimensionsStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "ArrayDimensionsStruct: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } -} -void register_ArraySizeStruct_type_identifier() -{ - { - StructTypeFlag struct_flags_ArraySizeStruct = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_ArraySizeStruct; - TypeIdentifierPair type_ids_ArraySizeStruct; - QualifiedTypeName type_name_ArraySizeStruct = "ArraySizeStruct"; - eprosima::fastcdr::optional type_ann_builtin_ArraySizeStruct; - eprosima::fastcdr::optional ann_custom_ArraySizeStruct; - CompleteTypeDetail detail_ArraySizeStruct = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_ArraySizeStruct, ann_custom_ArraySizeStruct, type_name_ArraySizeStruct.to_string()); - CompleteStructHeader header_ArraySizeStruct; - header_ArraySizeStruct = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_ArraySizeStruct); - CompleteStructMemberSeq member_seq_ArraySizeStruct; - { - return_code_ArraySizeStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_array_int32_t_5", type_ids_ArraySizeStruct); - - if (return_code_ArraySizeStruct != eprosima::fastdds::dds::RETCODE_OK) - { - return_code_ArraySizeStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_ArraySizeStruct); - - if (return_code_ArraySizeStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Array element TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - TypeIdentifier* element_identifier_anonymous_array_int32_t_5 {nullptr}; - if (EK_COMPLETE == type_ids_ArraySizeStruct.type_identifier1()._d() || TK_NONE == type_ids_ArraySizeStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ArraySizeStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ArraySizeStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ArraySizeStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ArraySizeStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ArraySizeStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ArraySizeStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ArraySizeStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ArraySizeStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ArraySizeStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ArraySizeStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ArraySizeStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ArraySizeStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ArraySizeStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ArraySizeStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_array_int32_t_5 = new TypeIdentifier(type_ids_ArraySizeStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ArraySizeStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ArraySizeStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ArraySizeStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ArraySizeStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ArraySizeStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ArraySizeStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ArraySizeStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ArraySizeStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ArraySizeStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ArraySizeStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ArraySizeStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ArraySizeStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ArraySizeStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ArraySizeStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ArraySizeStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_array_int32_t_5 = new TypeIdentifier(type_ids_ArraySizeStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Array element TypeIdentifier inconsistent."); - return; - } - EquivalenceKind equiv_kind_anonymous_array_int32_t_5 = EK_COMPLETE; - if (TK_NONE == type_ids_ArraySizeStruct.type_identifier2()._d()) - { - equiv_kind_anonymous_array_int32_t_5 = EK_BOTH; - } - CollectionElementFlag element_flags_anonymous_array_int32_t_5 = 0; - PlainCollectionHeader header_anonymous_array_int32_t_5 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_int32_t_5, element_flags_anonymous_array_int32_t_5); - std::string type_id_kind_anonymous_array_int32_t_5("TI_PLAIN_ARRAY_SMALL"); - if (type_id_kind_anonymous_array_int32_t_5 == "TI_PLAIN_ARRAY_SMALL") - { - SBoundSeq array_bound_seq; - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(5)); - - PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_int32_t_5, array_bound_seq, - eprosima::fastcdr::external(element_identifier_anonymous_array_int32_t_5)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_int32_t_5")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_int32_t_5 already registered in TypeObjectRegistry for a different type."); - } - } - else - { - LBoundSeq array_bound_seq; - TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(5)); - - PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_int32_t_5, array_bound_seq, - eprosima::fastcdr::external(element_identifier_anonymous_array_int32_t_5)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_int32_t_5")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_int32_t_5 already registered in TypeObjectRegistry for a different type."); - } - } - return_code_ArraySizeStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_array_int32_t_5", type_ids_ArraySizeStruct); - if (return_code_ArraySizeStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_array_int32_t_5: Given Array TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_array = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_array; - MemberId member_id_my_array = 0x00000000; - if (EK_COMPLETE == type_ids_ArraySizeStruct.type_identifier1()._d() || TK_NONE == type_ids_ArraySizeStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ArraySizeStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ArraySizeStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ArraySizeStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ArraySizeStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ArraySizeStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ArraySizeStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ArraySizeStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_ArraySizeStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ArraySizeStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ArraySizeStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ArraySizeStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ArraySizeStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_ArraySizeStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ArraySizeStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_array = TypeObjectUtils::build_common_struct_member(member_id_my_array, member_flags_my_array, type_ids_ArraySizeStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_ArraySizeStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_ArraySizeStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ArraySizeStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_ArraySizeStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ArraySizeStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_ArraySizeStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ArraySizeStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_ArraySizeStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_ArraySizeStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_ArraySizeStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ArraySizeStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ArraySizeStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_ArraySizeStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_ArraySizeStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_ArraySizeStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_array = TypeObjectUtils::build_common_struct_member(member_id_my_array, member_flags_my_array, type_ids_ArraySizeStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_array member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_array = "my_array"; - eprosima::fastcdr::optional member_ann_builtin_my_array; - ann_custom_ArraySizeStruct.reset(); - CompleteMemberDetail detail_my_array = TypeObjectUtils::build_complete_member_detail(name_my_array, member_ann_builtin_my_array, ann_custom_ArraySizeStruct); - CompleteStructMember member_my_array = TypeObjectUtils::build_complete_struct_member(common_my_array, detail_my_array); - TypeObjectUtils::add_complete_struct_member(member_seq_ArraySizeStruct, member_my_array); - } - CompleteStructType struct_type_ArraySizeStruct = TypeObjectUtils::build_complete_struct_type(struct_flags_ArraySizeStruct, header_ArraySizeStruct, member_seq_ArraySizeStruct); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_ArraySizeStruct, type_name_ArraySizeStruct.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "ArraySizeStruct already registered in TypeObjectRegistry for a different type."); - } - return_code_ArraySizeStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "ArraySizeStruct", type_ids_ArraySizeStruct); - if (return_code_ArraySizeStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "ArraySizeStruct: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } -} -void register_SequenceStruct_type_identifier() -{ - { - StructTypeFlag struct_flags_SequenceStruct = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_SequenceStruct; - TypeIdentifierPair type_ids_SequenceStruct; - QualifiedTypeName type_name_SequenceStruct = "SequenceStruct"; - eprosima::fastcdr::optional type_ann_builtin_SequenceStruct; - eprosima::fastcdr::optional ann_custom_SequenceStruct; - CompleteTypeDetail detail_SequenceStruct = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_SequenceStruct, ann_custom_SequenceStruct, type_name_SequenceStruct.to_string()); - CompleteStructHeader header_SequenceStruct; - header_SequenceStruct = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_SequenceStruct); - CompleteStructMemberSeq member_seq_SequenceStruct; - { - return_code_SequenceStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_sequence_int32_t_2", type_ids_SequenceStruct); - - if (return_code_SequenceStruct != eprosima::fastdds::dds::RETCODE_OK) - { - return_code_SequenceStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_SequenceStruct); - - if (return_code_SequenceStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Sequence element TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - TypeIdentifier* element_identifier_anonymous_sequence_int32_t_2 {nullptr}; - if (EK_COMPLETE == type_ids_SequenceStruct.type_identifier1()._d() || TK_NONE == type_ids_SequenceStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SequenceStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_SequenceStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SequenceStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_SequenceStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SequenceStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_SequenceStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SequenceStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_SequenceStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SequenceStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SequenceStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SequenceStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SequenceStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SequenceStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SequenceStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_sequence_int32_t_2 = new TypeIdentifier(type_ids_SequenceStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_SequenceStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SequenceStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_SequenceStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SequenceStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_SequenceStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SequenceStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_SequenceStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SequenceStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_SequenceStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SequenceStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SequenceStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SequenceStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SequenceStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SequenceStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SequenceStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_sequence_int32_t_2 = new TypeIdentifier(type_ids_SequenceStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Sequence element TypeIdentifier inconsistent."); - return; - } - EquivalenceKind equiv_kind_anonymous_sequence_int32_t_2 = EK_COMPLETE; - if (TK_NONE == type_ids_SequenceStruct.type_identifier2()._d()) - { - equiv_kind_anonymous_sequence_int32_t_2 = EK_BOTH; - } - CollectionElementFlag element_flags_anonymous_sequence_int32_t_2 = 0; - PlainCollectionHeader header_anonymous_sequence_int32_t_2 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_sequence_int32_t_2, element_flags_anonymous_sequence_int32_t_2); - std::string type_id_kind_anonymous_sequence_int32_t_2("TI_PLAIN_SEQUENCE_SMALL"); - if (type_id_kind_anonymous_sequence_int32_t_2 == "TI_PLAIN_SEQUENCE_SMALL") - { - SBound bound = static_cast(2); - PlainSequenceSElemDefn seq_sdefn = TypeObjectUtils::build_plain_sequence_s_elem_defn(header_anonymous_sequence_int32_t_2, bound, - eprosima::fastcdr::external(element_identifier_anonymous_sequence_int32_t_2)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_s_sequence_type_identifier(seq_sdefn, "anonymous_sequence_int32_t_2")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_sequence_int32_t_2 already registered in TypeObjectRegistry for a different type."); - } - } - else - { - LBound bound = 2; - PlainSequenceLElemDefn seq_ldefn = TypeObjectUtils::build_plain_sequence_l_elem_defn(header_anonymous_sequence_int32_t_2, bound, - eprosima::fastcdr::external(element_identifier_anonymous_sequence_int32_t_2)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_l_sequence_type_identifier(seq_ldefn, "anonymous_sequence_int32_t_2")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_sequence_int32_t_2 already registered in TypeObjectRegistry for a different type."); - } - } - return_code_SequenceStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_sequence_int32_t_2", type_ids_SequenceStruct); - if (return_code_SequenceStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_sequence_int32_t_2: Given Sequence TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_sequence = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_sequence; - MemberId member_id_my_sequence = 0x00000000; - if (EK_COMPLETE == type_ids_SequenceStruct.type_identifier1()._d() || TK_NONE == type_ids_SequenceStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SequenceStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_SequenceStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SequenceStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_SequenceStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SequenceStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_SequenceStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SequenceStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_SequenceStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SequenceStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SequenceStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SequenceStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SequenceStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SequenceStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SequenceStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_sequence = TypeObjectUtils::build_common_struct_member(member_id_my_sequence, member_flags_my_sequence, type_ids_SequenceStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_SequenceStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SequenceStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_SequenceStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SequenceStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_SequenceStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SequenceStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_SequenceStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SequenceStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_SequenceStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SequenceStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SequenceStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SequenceStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SequenceStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SequenceStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SequenceStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_sequence = TypeObjectUtils::build_common_struct_member(member_id_my_sequence, member_flags_my_sequence, type_ids_SequenceStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_sequence member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_sequence = "my_sequence"; - eprosima::fastcdr::optional member_ann_builtin_my_sequence; - ann_custom_SequenceStruct.reset(); - CompleteMemberDetail detail_my_sequence = TypeObjectUtils::build_complete_member_detail(name_my_sequence, member_ann_builtin_my_sequence, ann_custom_SequenceStruct); - CompleteStructMember member_my_sequence = TypeObjectUtils::build_complete_struct_member(common_my_sequence, detail_my_sequence); - TypeObjectUtils::add_complete_struct_member(member_seq_SequenceStruct, member_my_sequence); - } - CompleteStructType struct_type_SequenceStruct = TypeObjectUtils::build_complete_struct_type(struct_flags_SequenceStruct, header_SequenceStruct, member_seq_SequenceStruct); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_SequenceStruct, type_name_SequenceStruct.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "SequenceStruct already registered in TypeObjectRegistry for a different type."); - } - return_code_SequenceStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "SequenceStruct", type_ids_SequenceStruct); - if (return_code_SequenceStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "SequenceStruct: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } -} -void register_SequenceStructEqual_type_identifier() -{ - { - StructTypeFlag struct_flags_SequenceStructEqual = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_SequenceStructEqual; - TypeIdentifierPair type_ids_SequenceStructEqual; - QualifiedTypeName type_name_SequenceStructEqual = "SequenceStructEqual"; - eprosima::fastcdr::optional type_ann_builtin_SequenceStructEqual; - eprosima::fastcdr::optional ann_custom_SequenceStructEqual; - CompleteTypeDetail detail_SequenceStructEqual = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_SequenceStructEqual, ann_custom_SequenceStructEqual, type_name_SequenceStructEqual.to_string()); - CompleteStructHeader header_SequenceStructEqual; - header_SequenceStructEqual = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_SequenceStructEqual); - CompleteStructMemberSeq member_seq_SequenceStructEqual; - { - return_code_SequenceStructEqual = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_sequence_int32_t_2", type_ids_SequenceStructEqual); - - if (return_code_SequenceStructEqual != eprosima::fastdds::dds::RETCODE_OK) - { - return_code_SequenceStructEqual = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_SequenceStructEqual); - - if (return_code_SequenceStructEqual != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Sequence element TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - TypeIdentifier* element_identifier_anonymous_sequence_int32_t_2 {nullptr}; - if (EK_COMPLETE == type_ids_SequenceStructEqual.type_identifier1()._d() || TK_NONE == type_ids_SequenceStructEqual.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SequenceStructEqual.type_identifier1()._d() && - EK_COMPLETE == type_ids_SequenceStructEqual.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SequenceStructEqual.type_identifier1()._d() && - EK_COMPLETE == type_ids_SequenceStructEqual.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SequenceStructEqual.type_identifier1()._d() && - EK_COMPLETE == type_ids_SequenceStructEqual.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SequenceStructEqual.type_identifier1()._d() && - EK_COMPLETE == type_ids_SequenceStructEqual.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SequenceStructEqual.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SequenceStructEqual.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SequenceStructEqual.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SequenceStructEqual.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SequenceStructEqual.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SequenceStructEqual.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_sequence_int32_t_2 = new TypeIdentifier(type_ids_SequenceStructEqual.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_SequenceStructEqual.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SequenceStructEqual.type_identifier2()._d() && - EK_COMPLETE == type_ids_SequenceStructEqual.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SequenceStructEqual.type_identifier2()._d() && - EK_COMPLETE == type_ids_SequenceStructEqual.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SequenceStructEqual.type_identifier2()._d() && - EK_COMPLETE == type_ids_SequenceStructEqual.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SequenceStructEqual.type_identifier2()._d() && - EK_COMPLETE == type_ids_SequenceStructEqual.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SequenceStructEqual.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SequenceStructEqual.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SequenceStructEqual.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SequenceStructEqual.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SequenceStructEqual.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SequenceStructEqual.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_sequence_int32_t_2 = new TypeIdentifier(type_ids_SequenceStructEqual.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Sequence element TypeIdentifier inconsistent."); - return; - } - EquivalenceKind equiv_kind_anonymous_sequence_int32_t_2 = EK_COMPLETE; - if (TK_NONE == type_ids_SequenceStructEqual.type_identifier2()._d()) - { - equiv_kind_anonymous_sequence_int32_t_2 = EK_BOTH; - } - CollectionElementFlag element_flags_anonymous_sequence_int32_t_2 = 0; - PlainCollectionHeader header_anonymous_sequence_int32_t_2 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_sequence_int32_t_2, element_flags_anonymous_sequence_int32_t_2); - std::string type_id_kind_anonymous_sequence_int32_t_2("TI_PLAIN_SEQUENCE_SMALL"); - if (type_id_kind_anonymous_sequence_int32_t_2 == "TI_PLAIN_SEQUENCE_SMALL") - { - SBound bound = static_cast(2); - PlainSequenceSElemDefn seq_sdefn = TypeObjectUtils::build_plain_sequence_s_elem_defn(header_anonymous_sequence_int32_t_2, bound, - eprosima::fastcdr::external(element_identifier_anonymous_sequence_int32_t_2)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_s_sequence_type_identifier(seq_sdefn, "anonymous_sequence_int32_t_2")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_sequence_int32_t_2 already registered in TypeObjectRegistry for a different type."); - } - } - else - { - LBound bound = 2; - PlainSequenceLElemDefn seq_ldefn = TypeObjectUtils::build_plain_sequence_l_elem_defn(header_anonymous_sequence_int32_t_2, bound, - eprosima::fastcdr::external(element_identifier_anonymous_sequence_int32_t_2)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_l_sequence_type_identifier(seq_ldefn, "anonymous_sequence_int32_t_2")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_sequence_int32_t_2 already registered in TypeObjectRegistry for a different type."); - } - } - return_code_SequenceStructEqual = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_sequence_int32_t_2", type_ids_SequenceStructEqual); - if (return_code_SequenceStructEqual != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_sequence_int32_t_2: Given Sequence TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_sequence_equal = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_sequence_equal; - MemberId member_id_my_sequence_equal = 0x00000000; - if (EK_COMPLETE == type_ids_SequenceStructEqual.type_identifier1()._d() || TK_NONE == type_ids_SequenceStructEqual.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SequenceStructEqual.type_identifier1()._d() && - EK_COMPLETE == type_ids_SequenceStructEqual.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SequenceStructEqual.type_identifier1()._d() && - EK_COMPLETE == type_ids_SequenceStructEqual.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SequenceStructEqual.type_identifier1()._d() && - EK_COMPLETE == type_ids_SequenceStructEqual.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SequenceStructEqual.type_identifier1()._d() && - EK_COMPLETE == type_ids_SequenceStructEqual.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SequenceStructEqual.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SequenceStructEqual.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SequenceStructEqual.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SequenceStructEqual.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SequenceStructEqual.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SequenceStructEqual.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_sequence_equal = TypeObjectUtils::build_common_struct_member(member_id_my_sequence_equal, member_flags_my_sequence_equal, type_ids_SequenceStructEqual.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_SequenceStructEqual.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SequenceStructEqual.type_identifier2()._d() && - EK_COMPLETE == type_ids_SequenceStructEqual.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SequenceStructEqual.type_identifier2()._d() && - EK_COMPLETE == type_ids_SequenceStructEqual.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SequenceStructEqual.type_identifier2()._d() && - EK_COMPLETE == type_ids_SequenceStructEqual.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SequenceStructEqual.type_identifier2()._d() && - EK_COMPLETE == type_ids_SequenceStructEqual.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SequenceStructEqual.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SequenceStructEqual.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SequenceStructEqual.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SequenceStructEqual.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SequenceStructEqual.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SequenceStructEqual.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_sequence_equal = TypeObjectUtils::build_common_struct_member(member_id_my_sequence_equal, member_flags_my_sequence_equal, type_ids_SequenceStructEqual.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_sequence_equal member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_sequence_equal = "my_sequence_equal"; - eprosima::fastcdr::optional member_ann_builtin_my_sequence_equal; - ann_custom_SequenceStructEqual.reset(); - CompleteMemberDetail detail_my_sequence_equal = TypeObjectUtils::build_complete_member_detail(name_my_sequence_equal, member_ann_builtin_my_sequence_equal, ann_custom_SequenceStructEqual); - CompleteStructMember member_my_sequence_equal = TypeObjectUtils::build_complete_struct_member(common_my_sequence_equal, detail_my_sequence_equal); - TypeObjectUtils::add_complete_struct_member(member_seq_SequenceStructEqual, member_my_sequence_equal); - } - CompleteStructType struct_type_SequenceStructEqual = TypeObjectUtils::build_complete_struct_type(struct_flags_SequenceStructEqual, header_SequenceStructEqual, member_seq_SequenceStructEqual); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_SequenceStructEqual, type_name_SequenceStructEqual.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "SequenceStructEqual already registered in TypeObjectRegistry for a different type."); - } - return_code_SequenceStructEqual = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "SequenceStructEqual", type_ids_SequenceStructEqual); - if (return_code_SequenceStructEqual != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "SequenceStructEqual: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } -} -void register_SequenceBadStruct_type_identifier() -{ - { - StructTypeFlag struct_flags_SequenceBadStruct = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_SequenceBadStruct; - TypeIdentifierPair type_ids_SequenceBadStruct; - QualifiedTypeName type_name_SequenceBadStruct = "SequenceBadStruct"; - eprosima::fastcdr::optional type_ann_builtin_SequenceBadStruct; - eprosima::fastcdr::optional ann_custom_SequenceBadStruct; - CompleteTypeDetail detail_SequenceBadStruct = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_SequenceBadStruct, ann_custom_SequenceBadStruct, type_name_SequenceBadStruct.to_string()); - CompleteStructHeader header_SequenceBadStruct; - header_SequenceBadStruct = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_SequenceBadStruct); - CompleteStructMemberSeq member_seq_SequenceBadStruct; - { - return_code_SequenceBadStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_sequence_uint8_t_2", type_ids_SequenceBadStruct); - - if (return_code_SequenceBadStruct != eprosima::fastdds::dds::RETCODE_OK) - { - return_code_SequenceBadStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_byte", type_ids_SequenceBadStruct); - - if (return_code_SequenceBadStruct != 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_2 {nullptr}; - if (EK_COMPLETE == type_ids_SequenceBadStruct.type_identifier1()._d() || TK_NONE == type_ids_SequenceBadStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SequenceBadStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_SequenceBadStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SequenceBadStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_SequenceBadStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SequenceBadStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_SequenceBadStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SequenceBadStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_SequenceBadStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SequenceBadStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SequenceBadStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SequenceBadStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SequenceBadStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SequenceBadStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SequenceBadStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_sequence_uint8_t_2 = new TypeIdentifier(type_ids_SequenceBadStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_SequenceBadStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SequenceBadStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_SequenceBadStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SequenceBadStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_SequenceBadStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SequenceBadStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_SequenceBadStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SequenceBadStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_SequenceBadStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SequenceBadStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SequenceBadStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SequenceBadStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SequenceBadStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SequenceBadStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SequenceBadStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_sequence_uint8_t_2 = new TypeIdentifier(type_ids_SequenceBadStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Sequence element TypeIdentifier inconsistent."); - return; - } - EquivalenceKind equiv_kind_anonymous_sequence_uint8_t_2 = EK_COMPLETE; - if (TK_NONE == type_ids_SequenceBadStruct.type_identifier2()._d()) - { - equiv_kind_anonymous_sequence_uint8_t_2 = EK_BOTH; - } - CollectionElementFlag element_flags_anonymous_sequence_uint8_t_2 = 0; - PlainCollectionHeader header_anonymous_sequence_uint8_t_2 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_sequence_uint8_t_2, element_flags_anonymous_sequence_uint8_t_2); - std::string type_id_kind_anonymous_sequence_uint8_t_2("TI_PLAIN_SEQUENCE_SMALL"); - if (type_id_kind_anonymous_sequence_uint8_t_2 == "TI_PLAIN_SEQUENCE_SMALL") - { - SBound bound = static_cast(2); - PlainSequenceSElemDefn seq_sdefn = TypeObjectUtils::build_plain_sequence_s_elem_defn(header_anonymous_sequence_uint8_t_2, bound, - eprosima::fastcdr::external(element_identifier_anonymous_sequence_uint8_t_2)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_s_sequence_type_identifier(seq_sdefn, "anonymous_sequence_uint8_t_2")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_sequence_uint8_t_2 already registered in TypeObjectRegistry for a different type."); - } - } - else - { - LBound bound = 2; - PlainSequenceLElemDefn seq_ldefn = TypeObjectUtils::build_plain_sequence_l_elem_defn(header_anonymous_sequence_uint8_t_2, bound, - eprosima::fastcdr::external(element_identifier_anonymous_sequence_uint8_t_2)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_l_sequence_type_identifier(seq_ldefn, "anonymous_sequence_uint8_t_2")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_sequence_uint8_t_2 already registered in TypeObjectRegistry for a different type."); - } - } - return_code_SequenceBadStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_sequence_uint8_t_2", type_ids_SequenceBadStruct); - if (return_code_SequenceBadStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_sequence_uint8_t_2: Given Sequence TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_sequence = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_sequence; - MemberId member_id_my_sequence = 0x00000000; - if (EK_COMPLETE == type_ids_SequenceBadStruct.type_identifier1()._d() || TK_NONE == type_ids_SequenceBadStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SequenceBadStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_SequenceBadStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SequenceBadStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_SequenceBadStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SequenceBadStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_SequenceBadStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SequenceBadStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_SequenceBadStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SequenceBadStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SequenceBadStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SequenceBadStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SequenceBadStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SequenceBadStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SequenceBadStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_sequence = TypeObjectUtils::build_common_struct_member(member_id_my_sequence, member_flags_my_sequence, type_ids_SequenceBadStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_SequenceBadStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SequenceBadStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_SequenceBadStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SequenceBadStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_SequenceBadStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SequenceBadStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_SequenceBadStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SequenceBadStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_SequenceBadStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SequenceBadStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SequenceBadStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SequenceBadStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SequenceBadStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SequenceBadStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SequenceBadStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_sequence = TypeObjectUtils::build_common_struct_member(member_id_my_sequence, member_flags_my_sequence, type_ids_SequenceBadStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_sequence member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_sequence = "my_sequence"; - eprosima::fastcdr::optional member_ann_builtin_my_sequence; - ann_custom_SequenceBadStruct.reset(); - CompleteMemberDetail detail_my_sequence = TypeObjectUtils::build_complete_member_detail(name_my_sequence, member_ann_builtin_my_sequence, ann_custom_SequenceBadStruct); - CompleteStructMember member_my_sequence = TypeObjectUtils::build_complete_struct_member(common_my_sequence, detail_my_sequence); - TypeObjectUtils::add_complete_struct_member(member_seq_SequenceBadStruct, member_my_sequence); - } - CompleteStructType struct_type_SequenceBadStruct = TypeObjectUtils::build_complete_struct_type(struct_flags_SequenceBadStruct, header_SequenceBadStruct, member_seq_SequenceBadStruct); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_SequenceBadStruct, type_name_SequenceBadStruct.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "SequenceBadStruct already registered in TypeObjectRegistry for a different type."); - } - return_code_SequenceBadStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "SequenceBadStruct", type_ids_SequenceBadStruct); - if (return_code_SequenceBadStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "SequenceBadStruct: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } -} -void register_SequenceBoundsStruct_type_identifier() -{ - { - StructTypeFlag struct_flags_SequenceBoundsStruct = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_SequenceBoundsStruct; - TypeIdentifierPair type_ids_SequenceBoundsStruct; - QualifiedTypeName type_name_SequenceBoundsStruct = "SequenceBoundsStruct"; - eprosima::fastcdr::optional type_ann_builtin_SequenceBoundsStruct; - eprosima::fastcdr::optional ann_custom_SequenceBoundsStruct; - CompleteTypeDetail detail_SequenceBoundsStruct = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_SequenceBoundsStruct, ann_custom_SequenceBoundsStruct, type_name_SequenceBoundsStruct.to_string()); - CompleteStructHeader header_SequenceBoundsStruct; - header_SequenceBoundsStruct = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_SequenceBoundsStruct); - CompleteStructMemberSeq member_seq_SequenceBoundsStruct; - { - return_code_SequenceBoundsStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_sequence_int32_t_4", type_ids_SequenceBoundsStruct); - - if (return_code_SequenceBoundsStruct != eprosima::fastdds::dds::RETCODE_OK) - { - return_code_SequenceBoundsStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_SequenceBoundsStruct); - - if (return_code_SequenceBoundsStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Sequence element TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - TypeIdentifier* element_identifier_anonymous_sequence_int32_t_4 {nullptr}; - if (EK_COMPLETE == type_ids_SequenceBoundsStruct.type_identifier1()._d() || TK_NONE == type_ids_SequenceBoundsStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SequenceBoundsStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_SequenceBoundsStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SequenceBoundsStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_SequenceBoundsStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SequenceBoundsStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_SequenceBoundsStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SequenceBoundsStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_SequenceBoundsStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SequenceBoundsStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SequenceBoundsStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SequenceBoundsStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SequenceBoundsStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SequenceBoundsStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SequenceBoundsStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_sequence_int32_t_4 = new TypeIdentifier(type_ids_SequenceBoundsStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_SequenceBoundsStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SequenceBoundsStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_SequenceBoundsStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SequenceBoundsStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_SequenceBoundsStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SequenceBoundsStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_SequenceBoundsStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SequenceBoundsStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_SequenceBoundsStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SequenceBoundsStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SequenceBoundsStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SequenceBoundsStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SequenceBoundsStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SequenceBoundsStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SequenceBoundsStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_sequence_int32_t_4 = new TypeIdentifier(type_ids_SequenceBoundsStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Sequence element TypeIdentifier inconsistent."); - return; - } - EquivalenceKind equiv_kind_anonymous_sequence_int32_t_4 = EK_COMPLETE; - if (TK_NONE == type_ids_SequenceBoundsStruct.type_identifier2()._d()) - { - equiv_kind_anonymous_sequence_int32_t_4 = EK_BOTH; - } - CollectionElementFlag element_flags_anonymous_sequence_int32_t_4 = 0; - PlainCollectionHeader header_anonymous_sequence_int32_t_4 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_sequence_int32_t_4, element_flags_anonymous_sequence_int32_t_4); - std::string type_id_kind_anonymous_sequence_int32_t_4("TI_PLAIN_SEQUENCE_SMALL"); - if (type_id_kind_anonymous_sequence_int32_t_4 == "TI_PLAIN_SEQUENCE_SMALL") - { - SBound bound = static_cast(4); - PlainSequenceSElemDefn seq_sdefn = TypeObjectUtils::build_plain_sequence_s_elem_defn(header_anonymous_sequence_int32_t_4, bound, - eprosima::fastcdr::external(element_identifier_anonymous_sequence_int32_t_4)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_s_sequence_type_identifier(seq_sdefn, "anonymous_sequence_int32_t_4")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_sequence_int32_t_4 already registered in TypeObjectRegistry for a different type."); - } - } - else - { - LBound bound = 4; - PlainSequenceLElemDefn seq_ldefn = TypeObjectUtils::build_plain_sequence_l_elem_defn(header_anonymous_sequence_int32_t_4, bound, - eprosima::fastcdr::external(element_identifier_anonymous_sequence_int32_t_4)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_l_sequence_type_identifier(seq_ldefn, "anonymous_sequence_int32_t_4")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_sequence_int32_t_4 already registered in TypeObjectRegistry for a different type."); - } - } - return_code_SequenceBoundsStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_sequence_int32_t_4", type_ids_SequenceBoundsStruct); - if (return_code_SequenceBoundsStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_sequence_int32_t_4: Given Sequence TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_sequence = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_sequence; - MemberId member_id_my_sequence = 0x00000000; - if (EK_COMPLETE == type_ids_SequenceBoundsStruct.type_identifier1()._d() || TK_NONE == type_ids_SequenceBoundsStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SequenceBoundsStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_SequenceBoundsStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SequenceBoundsStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_SequenceBoundsStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SequenceBoundsStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_SequenceBoundsStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SequenceBoundsStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_SequenceBoundsStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SequenceBoundsStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SequenceBoundsStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SequenceBoundsStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SequenceBoundsStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SequenceBoundsStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SequenceBoundsStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_sequence = TypeObjectUtils::build_common_struct_member(member_id_my_sequence, member_flags_my_sequence, type_ids_SequenceBoundsStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_SequenceBoundsStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SequenceBoundsStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_SequenceBoundsStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SequenceBoundsStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_SequenceBoundsStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SequenceBoundsStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_SequenceBoundsStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SequenceBoundsStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_SequenceBoundsStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SequenceBoundsStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SequenceBoundsStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SequenceBoundsStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SequenceBoundsStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SequenceBoundsStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SequenceBoundsStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_sequence = TypeObjectUtils::build_common_struct_member(member_id_my_sequence, member_flags_my_sequence, type_ids_SequenceBoundsStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_sequence member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_sequence = "my_sequence"; - eprosima::fastcdr::optional member_ann_builtin_my_sequence; - ann_custom_SequenceBoundsStruct.reset(); - CompleteMemberDetail detail_my_sequence = TypeObjectUtils::build_complete_member_detail(name_my_sequence, member_ann_builtin_my_sequence, ann_custom_SequenceBoundsStruct); - CompleteStructMember member_my_sequence = TypeObjectUtils::build_complete_struct_member(common_my_sequence, detail_my_sequence); - TypeObjectUtils::add_complete_struct_member(member_seq_SequenceBoundsStruct, member_my_sequence); - } - CompleteStructType struct_type_SequenceBoundsStruct = TypeObjectUtils::build_complete_struct_type(struct_flags_SequenceBoundsStruct, header_SequenceBoundsStruct, member_seq_SequenceBoundsStruct); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_SequenceBoundsStruct, type_name_SequenceBoundsStruct.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "SequenceBoundsStruct already registered in TypeObjectRegistry for a different type."); - } - return_code_SequenceBoundsStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "SequenceBoundsStruct", type_ids_SequenceBoundsStruct); - if (return_code_SequenceBoundsStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "SequenceBoundsStruct: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } -} -void register_SequenceSequenceStruct_type_identifier() -{ - { - StructTypeFlag struct_flags_SequenceSequenceStruct = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_SequenceSequenceStruct; - TypeIdentifierPair type_ids_SequenceSequenceStruct; - QualifiedTypeName type_name_SequenceSequenceStruct = "SequenceSequenceStruct"; - eprosima::fastcdr::optional type_ann_builtin_SequenceSequenceStruct; - eprosima::fastcdr::optional ann_custom_SequenceSequenceStruct; - CompleteTypeDetail detail_SequenceSequenceStruct = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_SequenceSequenceStruct, ann_custom_SequenceSequenceStruct, type_name_SequenceSequenceStruct.to_string()); - CompleteStructHeader header_SequenceSequenceStruct; - header_SequenceSequenceStruct = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_SequenceSequenceStruct); - CompleteStructMemberSeq member_seq_SequenceSequenceStruct; - { - return_code_SequenceSequenceStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_sequence_anonymous_sequence_int32_t_2_3", type_ids_SequenceSequenceStruct); - - if (return_code_SequenceSequenceStruct != eprosima::fastdds::dds::RETCODE_OK) - { - return_code_SequenceSequenceStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_sequence_int32_t_2", type_ids_SequenceSequenceStruct); - - if (return_code_SequenceSequenceStruct != eprosima::fastdds::dds::RETCODE_OK) - { - return_code_SequenceSequenceStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_SequenceSequenceStruct); - - if (return_code_SequenceSequenceStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Sequence element TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - TypeIdentifier* element_identifier_anonymous_sequence_int32_t_2 {nullptr}; - if (EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier1()._d() || TK_NONE == type_ids_SequenceSequenceStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SequenceSequenceStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SequenceSequenceStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SequenceSequenceStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SequenceSequenceStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SequenceSequenceStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SequenceSequenceStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_sequence_int32_t_2 = new TypeIdentifier(type_ids_SequenceSequenceStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SequenceSequenceStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SequenceSequenceStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SequenceSequenceStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SequenceSequenceStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SequenceSequenceStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SequenceSequenceStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_sequence_int32_t_2 = new TypeIdentifier(type_ids_SequenceSequenceStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Sequence element TypeIdentifier inconsistent."); - return; - } - EquivalenceKind equiv_kind_anonymous_sequence_int32_t_2 = EK_COMPLETE; - if (TK_NONE == type_ids_SequenceSequenceStruct.type_identifier2()._d()) - { - equiv_kind_anonymous_sequence_int32_t_2 = EK_BOTH; - } - CollectionElementFlag element_flags_anonymous_sequence_int32_t_2 = 0; - PlainCollectionHeader header_anonymous_sequence_int32_t_2 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_sequence_int32_t_2, element_flags_anonymous_sequence_int32_t_2); - std::string type_id_kind_anonymous_sequence_int32_t_2("TI_PLAIN_SEQUENCE_SMALL"); - if (type_id_kind_anonymous_sequence_int32_t_2 == "TI_PLAIN_SEQUENCE_SMALL") - { - SBound bound = static_cast(2); - PlainSequenceSElemDefn seq_sdefn = TypeObjectUtils::build_plain_sequence_s_elem_defn(header_anonymous_sequence_int32_t_2, bound, - eprosima::fastcdr::external(element_identifier_anonymous_sequence_int32_t_2)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_s_sequence_type_identifier(seq_sdefn, "anonymous_sequence_int32_t_2")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_sequence_int32_t_2 already registered in TypeObjectRegistry for a different type."); - } - } - else - { - LBound bound = 2; - PlainSequenceLElemDefn seq_ldefn = TypeObjectUtils::build_plain_sequence_l_elem_defn(header_anonymous_sequence_int32_t_2, bound, - eprosima::fastcdr::external(element_identifier_anonymous_sequence_int32_t_2)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_l_sequence_type_identifier(seq_ldefn, "anonymous_sequence_int32_t_2")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_sequence_int32_t_2 already registered in TypeObjectRegistry for a different type."); - } - } - return_code_SequenceSequenceStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_sequence_int32_t_2", type_ids_SequenceSequenceStruct); - if (return_code_SequenceSequenceStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_sequence_int32_t_2: Given Sequence TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - TypeIdentifier* element_identifier_anonymous_sequence_anonymous_sequence_int32_t_2_3 {nullptr}; - if (EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier1()._d() || TK_NONE == type_ids_SequenceSequenceStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SequenceSequenceStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SequenceSequenceStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SequenceSequenceStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SequenceSequenceStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SequenceSequenceStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SequenceSequenceStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_sequence_anonymous_sequence_int32_t_2_3 = new TypeIdentifier(type_ids_SequenceSequenceStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SequenceSequenceStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SequenceSequenceStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SequenceSequenceStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SequenceSequenceStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SequenceSequenceStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SequenceSequenceStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_sequence_anonymous_sequence_int32_t_2_3 = new TypeIdentifier(type_ids_SequenceSequenceStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Sequence element TypeIdentifier inconsistent."); - return; - } - EquivalenceKind equiv_kind_anonymous_sequence_anonymous_sequence_int32_t_2_3 = EK_COMPLETE; - if (TK_NONE == type_ids_SequenceSequenceStruct.type_identifier2()._d()) - { - equiv_kind_anonymous_sequence_anonymous_sequence_int32_t_2_3 = EK_BOTH; - } - CollectionElementFlag element_flags_anonymous_sequence_anonymous_sequence_int32_t_2_3 = 0; - PlainCollectionHeader header_anonymous_sequence_anonymous_sequence_int32_t_2_3 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_sequence_anonymous_sequence_int32_t_2_3, element_flags_anonymous_sequence_anonymous_sequence_int32_t_2_3); - std::string type_id_kind_anonymous_sequence_anonymous_sequence_int32_t_2_3("TI_PLAIN_SEQUENCE_SMALL"); - if (type_id_kind_anonymous_sequence_anonymous_sequence_int32_t_2_3 == "TI_PLAIN_SEQUENCE_SMALL") - { - SBound bound = static_cast(3); - PlainSequenceSElemDefn seq_sdefn = TypeObjectUtils::build_plain_sequence_s_elem_defn(header_anonymous_sequence_anonymous_sequence_int32_t_2_3, bound, - eprosima::fastcdr::external(element_identifier_anonymous_sequence_anonymous_sequence_int32_t_2_3)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_s_sequence_type_identifier(seq_sdefn, "anonymous_sequence_anonymous_sequence_int32_t_2_3")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_sequence_anonymous_sequence_int32_t_2_3 already registered in TypeObjectRegistry for a different type."); - } - } - else - { - LBound bound = 3; - PlainSequenceLElemDefn seq_ldefn = TypeObjectUtils::build_plain_sequence_l_elem_defn(header_anonymous_sequence_anonymous_sequence_int32_t_2_3, bound, - eprosima::fastcdr::external(element_identifier_anonymous_sequence_anonymous_sequence_int32_t_2_3)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_l_sequence_type_identifier(seq_ldefn, "anonymous_sequence_anonymous_sequence_int32_t_2_3")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_sequence_anonymous_sequence_int32_t_2_3 already registered in TypeObjectRegistry for a different type."); - } - } - return_code_SequenceSequenceStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_sequence_anonymous_sequence_int32_t_2_3", type_ids_SequenceSequenceStruct); - if (return_code_SequenceSequenceStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_sequence_anonymous_sequence_int32_t_2_3: Given Sequence TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_sequence_sequence = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_sequence_sequence; - MemberId member_id_my_sequence_sequence = 0x00000000; - if (EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier1()._d() || TK_NONE == type_ids_SequenceSequenceStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SequenceSequenceStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SequenceSequenceStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SequenceSequenceStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SequenceSequenceStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SequenceSequenceStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SequenceSequenceStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_sequence_sequence = TypeObjectUtils::build_common_struct_member(member_id_my_sequence_sequence, member_flags_my_sequence_sequence, type_ids_SequenceSequenceStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SequenceSequenceStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SequenceSequenceStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SequenceSequenceStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SequenceSequenceStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SequenceSequenceStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SequenceSequenceStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SequenceSequenceStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_sequence_sequence = TypeObjectUtils::build_common_struct_member(member_id_my_sequence_sequence, member_flags_my_sequence_sequence, type_ids_SequenceSequenceStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_sequence_sequence member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_sequence_sequence = "my_sequence_sequence"; - eprosima::fastcdr::optional member_ann_builtin_my_sequence_sequence; - ann_custom_SequenceSequenceStruct.reset(); - CompleteMemberDetail detail_my_sequence_sequence = TypeObjectUtils::build_complete_member_detail(name_my_sequence_sequence, member_ann_builtin_my_sequence_sequence, ann_custom_SequenceSequenceStruct); - CompleteStructMember member_my_sequence_sequence = TypeObjectUtils::build_complete_struct_member(common_my_sequence_sequence, detail_my_sequence_sequence); - TypeObjectUtils::add_complete_struct_member(member_seq_SequenceSequenceStruct, member_my_sequence_sequence); - } - CompleteStructType struct_type_SequenceSequenceStruct = TypeObjectUtils::build_complete_struct_type(struct_flags_SequenceSequenceStruct, header_SequenceSequenceStruct, member_seq_SequenceSequenceStruct); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_SequenceSequenceStruct, type_name_SequenceSequenceStruct.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "SequenceSequenceStruct already registered in TypeObjectRegistry for a different type."); - } - return_code_SequenceSequenceStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "SequenceSequenceStruct", type_ids_SequenceSequenceStruct); - if (return_code_SequenceSequenceStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "SequenceSequenceStruct: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } -} -void register_SequenceSequenceBoundsStruct_type_identifier() -{ - { - StructTypeFlag struct_flags_SequenceSequenceBoundsStruct = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_SequenceSequenceBoundsStruct; - TypeIdentifierPair type_ids_SequenceSequenceBoundsStruct; - QualifiedTypeName type_name_SequenceSequenceBoundsStruct = "SequenceSequenceBoundsStruct"; - eprosima::fastcdr::optional type_ann_builtin_SequenceSequenceBoundsStruct; - eprosima::fastcdr::optional ann_custom_SequenceSequenceBoundsStruct; - CompleteTypeDetail detail_SequenceSequenceBoundsStruct = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_SequenceSequenceBoundsStruct, ann_custom_SequenceSequenceBoundsStruct, type_name_SequenceSequenceBoundsStruct.to_string()); - CompleteStructHeader header_SequenceSequenceBoundsStruct; - header_SequenceSequenceBoundsStruct = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_SequenceSequenceBoundsStruct); - CompleteStructMemberSeq member_seq_SequenceSequenceBoundsStruct; - { - return_code_SequenceSequenceBoundsStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_sequence_anonymous_sequence_int32_t_5_5", type_ids_SequenceSequenceBoundsStruct); - - if (return_code_SequenceSequenceBoundsStruct != eprosima::fastdds::dds::RETCODE_OK) - { - return_code_SequenceSequenceBoundsStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_sequence_int32_t_5", type_ids_SequenceSequenceBoundsStruct); - - if (return_code_SequenceSequenceBoundsStruct != eprosima::fastdds::dds::RETCODE_OK) - { - return_code_SequenceSequenceBoundsStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_SequenceSequenceBoundsStruct); - - if (return_code_SequenceSequenceBoundsStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Sequence element TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - TypeIdentifier* element_identifier_anonymous_sequence_int32_t_5 {nullptr}; - if (EK_COMPLETE == type_ids_SequenceSequenceBoundsStruct.type_identifier1()._d() || TK_NONE == type_ids_SequenceSequenceBoundsStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SequenceSequenceBoundsStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_SequenceSequenceBoundsStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SequenceSequenceBoundsStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_SequenceSequenceBoundsStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SequenceSequenceBoundsStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_SequenceSequenceBoundsStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SequenceSequenceBoundsStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_SequenceSequenceBoundsStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SequenceSequenceBoundsStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SequenceSequenceBoundsStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SequenceSequenceBoundsStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SequenceSequenceBoundsStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SequenceSequenceBoundsStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SequenceSequenceBoundsStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_sequence_int32_t_5 = new TypeIdentifier(type_ids_SequenceSequenceBoundsStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_SequenceSequenceBoundsStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SequenceSequenceBoundsStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_SequenceSequenceBoundsStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SequenceSequenceBoundsStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_SequenceSequenceBoundsStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SequenceSequenceBoundsStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_SequenceSequenceBoundsStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SequenceSequenceBoundsStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_SequenceSequenceBoundsStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SequenceSequenceBoundsStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SequenceSequenceBoundsStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SequenceSequenceBoundsStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SequenceSequenceBoundsStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SequenceSequenceBoundsStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SequenceSequenceBoundsStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_sequence_int32_t_5 = new TypeIdentifier(type_ids_SequenceSequenceBoundsStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Sequence element TypeIdentifier inconsistent."); - return; - } - EquivalenceKind equiv_kind_anonymous_sequence_int32_t_5 = EK_COMPLETE; - if (TK_NONE == type_ids_SequenceSequenceBoundsStruct.type_identifier2()._d()) - { - equiv_kind_anonymous_sequence_int32_t_5 = EK_BOTH; - } - CollectionElementFlag element_flags_anonymous_sequence_int32_t_5 = 0; - PlainCollectionHeader header_anonymous_sequence_int32_t_5 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_sequence_int32_t_5, element_flags_anonymous_sequence_int32_t_5); - std::string type_id_kind_anonymous_sequence_int32_t_5("TI_PLAIN_SEQUENCE_SMALL"); - if (type_id_kind_anonymous_sequence_int32_t_5 == "TI_PLAIN_SEQUENCE_SMALL") - { - SBound bound = static_cast(5); - PlainSequenceSElemDefn seq_sdefn = TypeObjectUtils::build_plain_sequence_s_elem_defn(header_anonymous_sequence_int32_t_5, bound, - eprosima::fastcdr::external(element_identifier_anonymous_sequence_int32_t_5)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_s_sequence_type_identifier(seq_sdefn, "anonymous_sequence_int32_t_5")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_sequence_int32_t_5 already registered in TypeObjectRegistry for a different type."); - } - } - else - { - LBound bound = 5; - PlainSequenceLElemDefn seq_ldefn = TypeObjectUtils::build_plain_sequence_l_elem_defn(header_anonymous_sequence_int32_t_5, bound, - eprosima::fastcdr::external(element_identifier_anonymous_sequence_int32_t_5)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_l_sequence_type_identifier(seq_ldefn, "anonymous_sequence_int32_t_5")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_sequence_int32_t_5 already registered in TypeObjectRegistry for a different type."); - } - } - return_code_SequenceSequenceBoundsStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_sequence_int32_t_5", type_ids_SequenceSequenceBoundsStruct); - if (return_code_SequenceSequenceBoundsStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_sequence_int32_t_5: Given Sequence TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - TypeIdentifier* element_identifier_anonymous_sequence_anonymous_sequence_int32_t_5_5 {nullptr}; - if (EK_COMPLETE == type_ids_SequenceSequenceBoundsStruct.type_identifier1()._d() || TK_NONE == type_ids_SequenceSequenceBoundsStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SequenceSequenceBoundsStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_SequenceSequenceBoundsStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SequenceSequenceBoundsStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_SequenceSequenceBoundsStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SequenceSequenceBoundsStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_SequenceSequenceBoundsStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SequenceSequenceBoundsStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_SequenceSequenceBoundsStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SequenceSequenceBoundsStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SequenceSequenceBoundsStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SequenceSequenceBoundsStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SequenceSequenceBoundsStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SequenceSequenceBoundsStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SequenceSequenceBoundsStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_sequence_anonymous_sequence_int32_t_5_5 = new TypeIdentifier(type_ids_SequenceSequenceBoundsStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_SequenceSequenceBoundsStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SequenceSequenceBoundsStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_SequenceSequenceBoundsStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SequenceSequenceBoundsStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_SequenceSequenceBoundsStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SequenceSequenceBoundsStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_SequenceSequenceBoundsStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SequenceSequenceBoundsStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_SequenceSequenceBoundsStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SequenceSequenceBoundsStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SequenceSequenceBoundsStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SequenceSequenceBoundsStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SequenceSequenceBoundsStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SequenceSequenceBoundsStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SequenceSequenceBoundsStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_sequence_anonymous_sequence_int32_t_5_5 = new TypeIdentifier(type_ids_SequenceSequenceBoundsStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Sequence element TypeIdentifier inconsistent."); - return; - } - EquivalenceKind equiv_kind_anonymous_sequence_anonymous_sequence_int32_t_5_5 = EK_COMPLETE; - if (TK_NONE == type_ids_SequenceSequenceBoundsStruct.type_identifier2()._d()) - { - equiv_kind_anonymous_sequence_anonymous_sequence_int32_t_5_5 = EK_BOTH; - } - CollectionElementFlag element_flags_anonymous_sequence_anonymous_sequence_int32_t_5_5 = 0; - PlainCollectionHeader header_anonymous_sequence_anonymous_sequence_int32_t_5_5 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_sequence_anonymous_sequence_int32_t_5_5, element_flags_anonymous_sequence_anonymous_sequence_int32_t_5_5); - std::string type_id_kind_anonymous_sequence_anonymous_sequence_int32_t_5_5("TI_PLAIN_SEQUENCE_SMALL"); - if (type_id_kind_anonymous_sequence_anonymous_sequence_int32_t_5_5 == "TI_PLAIN_SEQUENCE_SMALL") - { - SBound bound = static_cast(5); - PlainSequenceSElemDefn seq_sdefn = TypeObjectUtils::build_plain_sequence_s_elem_defn(header_anonymous_sequence_anonymous_sequence_int32_t_5_5, bound, - eprosima::fastcdr::external(element_identifier_anonymous_sequence_anonymous_sequence_int32_t_5_5)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_s_sequence_type_identifier(seq_sdefn, "anonymous_sequence_anonymous_sequence_int32_t_5_5")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_sequence_anonymous_sequence_int32_t_5_5 already registered in TypeObjectRegistry for a different type."); - } - } - else - { - LBound bound = 5; - PlainSequenceLElemDefn seq_ldefn = TypeObjectUtils::build_plain_sequence_l_elem_defn(header_anonymous_sequence_anonymous_sequence_int32_t_5_5, bound, - eprosima::fastcdr::external(element_identifier_anonymous_sequence_anonymous_sequence_int32_t_5_5)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_l_sequence_type_identifier(seq_ldefn, "anonymous_sequence_anonymous_sequence_int32_t_5_5")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_sequence_anonymous_sequence_int32_t_5_5 already registered in TypeObjectRegistry for a different type."); - } - } - return_code_SequenceSequenceBoundsStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_sequence_anonymous_sequence_int32_t_5_5", type_ids_SequenceSequenceBoundsStruct); - if (return_code_SequenceSequenceBoundsStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_sequence_anonymous_sequence_int32_t_5_5: Given Sequence TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_sequence_sequence = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_sequence_sequence; - MemberId member_id_my_sequence_sequence = 0x00000000; - if (EK_COMPLETE == type_ids_SequenceSequenceBoundsStruct.type_identifier1()._d() || TK_NONE == type_ids_SequenceSequenceBoundsStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SequenceSequenceBoundsStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_SequenceSequenceBoundsStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SequenceSequenceBoundsStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_SequenceSequenceBoundsStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SequenceSequenceBoundsStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_SequenceSequenceBoundsStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SequenceSequenceBoundsStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_SequenceSequenceBoundsStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SequenceSequenceBoundsStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SequenceSequenceBoundsStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SequenceSequenceBoundsStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SequenceSequenceBoundsStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SequenceSequenceBoundsStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SequenceSequenceBoundsStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_sequence_sequence = TypeObjectUtils::build_common_struct_member(member_id_my_sequence_sequence, member_flags_my_sequence_sequence, type_ids_SequenceSequenceBoundsStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_SequenceSequenceBoundsStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SequenceSequenceBoundsStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_SequenceSequenceBoundsStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SequenceSequenceBoundsStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_SequenceSequenceBoundsStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SequenceSequenceBoundsStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_SequenceSequenceBoundsStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SequenceSequenceBoundsStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_SequenceSequenceBoundsStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SequenceSequenceBoundsStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SequenceSequenceBoundsStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SequenceSequenceBoundsStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SequenceSequenceBoundsStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SequenceSequenceBoundsStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SequenceSequenceBoundsStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_sequence_sequence = TypeObjectUtils::build_common_struct_member(member_id_my_sequence_sequence, member_flags_my_sequence_sequence, type_ids_SequenceSequenceBoundsStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_sequence_sequence member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_sequence_sequence = "my_sequence_sequence"; - eprosima::fastcdr::optional member_ann_builtin_my_sequence_sequence; - ann_custom_SequenceSequenceBoundsStruct.reset(); - CompleteMemberDetail detail_my_sequence_sequence = TypeObjectUtils::build_complete_member_detail(name_my_sequence_sequence, member_ann_builtin_my_sequence_sequence, ann_custom_SequenceSequenceBoundsStruct); - CompleteStructMember member_my_sequence_sequence = TypeObjectUtils::build_complete_struct_member(common_my_sequence_sequence, detail_my_sequence_sequence); - TypeObjectUtils::add_complete_struct_member(member_seq_SequenceSequenceBoundsStruct, member_my_sequence_sequence); - } - CompleteStructType struct_type_SequenceSequenceBoundsStruct = TypeObjectUtils::build_complete_struct_type(struct_flags_SequenceSequenceBoundsStruct, header_SequenceSequenceBoundsStruct, member_seq_SequenceSequenceBoundsStruct); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_SequenceSequenceBoundsStruct, type_name_SequenceSequenceBoundsStruct.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "SequenceSequenceBoundsStruct already registered in TypeObjectRegistry for a different type."); - } - return_code_SequenceSequenceBoundsStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "SequenceSequenceBoundsStruct", type_ids_SequenceSequenceBoundsStruct); - if (return_code_SequenceSequenceBoundsStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "SequenceSequenceBoundsStruct: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } -} -void register_MapStruct_type_identifier() -{ - { - StructTypeFlag struct_flags_MapStruct = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_MapStruct; - TypeIdentifierPair type_ids_MapStruct; - QualifiedTypeName type_name_MapStruct = "MapStruct"; - eprosima::fastcdr::optional type_ann_builtin_MapStruct; - eprosima::fastcdr::optional ann_custom_MapStruct; - CompleteTypeDetail detail_MapStruct = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_MapStruct, ann_custom_MapStruct, type_name_MapStruct.to_string()); - CompleteStructHeader header_MapStruct; - header_MapStruct = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_MapStruct); - CompleteStructMemberSeq member_seq_MapStruct; - { - return_code_MapStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_map_int32_t_int32_t_2", type_ids_MapStruct); - - if (return_code_MapStruct != eprosima::fastdds::dds::RETCODE_OK) - { - return_code_MapStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_MapStruct); - - if (return_code_MapStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Map element TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - TypeIdentifier* element_identifier_anonymous_map_int32_t_int32_t_2 {nullptr}; - if (EK_COMPLETE == type_ids_MapStruct.type_identifier1()._d() || TK_NONE == type_ids_MapStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_MapStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_MapStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_MapStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_MapStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_MapStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_MapStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_MapStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_MapStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_map_int32_t_int32_t_2 = new TypeIdentifier(type_ids_MapStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_MapStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_MapStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_MapStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_MapStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_MapStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_MapStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_MapStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_MapStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_MapStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_map_int32_t_int32_t_2 = new TypeIdentifier(type_ids_MapStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_int32_t_2 inconsistent element TypeIdentifier."); - return; - } - return_code_MapStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_MapStruct); - - if (return_code_MapStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Map key TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - TypeIdentifier* key_identifier_anonymous_map_int32_t_int32_t_2 {nullptr}; - if (EK_COMPLETE == type_ids_MapStruct.type_identifier1()._d() || TK_NONE == type_ids_MapStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_MapStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_MapStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_MapStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_MapStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_MapStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_MapStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_MapStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_MapStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - key_identifier_anonymous_map_int32_t_int32_t_2 = new TypeIdentifier(type_ids_MapStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_MapStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_MapStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_MapStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_MapStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_MapStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_MapStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_MapStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_MapStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_MapStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - key_identifier_anonymous_map_int32_t_int32_t_2 = new TypeIdentifier(type_ids_MapStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_int32_t_2 inconsistent key TypeIdentifier."); - return; - } - EquivalenceKind equiv_kind_anonymous_map_int32_t_int32_t_2 = EK_BOTH; - if ((EK_COMPLETE == key_identifier_anonymous_map_int32_t_int32_t_2->_d() || EK_COMPLETE == element_identifier_anonymous_map_int32_t_int32_t_2->_d()) || - (TI_PLAIN_SEQUENCE_SMALL == element_identifier_anonymous_map_int32_t_int32_t_2->_d() && EK_COMPLETE == element_identifier_anonymous_map_int32_t_int32_t_2->seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == element_identifier_anonymous_map_int32_t_int32_t_2->_d() && EK_COMPLETE == element_identifier_anonymous_map_int32_t_int32_t_2->seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == element_identifier_anonymous_map_int32_t_int32_t_2->_d() && EK_COMPLETE == element_identifier_anonymous_map_int32_t_int32_t_2->array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == element_identifier_anonymous_map_int32_t_int32_t_2->_d() && EK_COMPLETE == element_identifier_anonymous_map_int32_t_int32_t_2->array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == element_identifier_anonymous_map_int32_t_int32_t_2->_d() && (EK_COMPLETE == element_identifier_anonymous_map_int32_t_int32_t_2->map_sdefn().key_identifier()->_d() || EK_COMPLETE == element_identifier_anonymous_map_int32_t_int32_t_2->map_sdefn().header().equiv_kind())) || - (TI_PLAIN_MAP_LARGE == element_identifier_anonymous_map_int32_t_int32_t_2->_d() && (EK_COMPLETE == element_identifier_anonymous_map_int32_t_int32_t_2->map_ldefn().key_identifier()->_d() || EK_COMPLETE == element_identifier_anonymous_map_int32_t_int32_t_2->map_ldefn().header().equiv_kind()))) - { - equiv_kind_anonymous_map_int32_t_int32_t_2 = EK_COMPLETE; - } - CollectionElementFlag element_flags_anonymous_map_int32_t_int32_t_2 = 0; - CollectionElementFlag key_flags_anonymous_map_int32_t_int32_t_2 = 0; - PlainCollectionHeader header_anonymous_map_int32_t_int32_t_2 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_map_int32_t_int32_t_2, element_flags_anonymous_map_int32_t_int32_t_2); - std::string type_id_kind_anonymous_map_int32_t_int32_t_2("TI_PLAIN_MAP_SMALL"); - if (type_id_kind_anonymous_map_int32_t_int32_t_2 == "TI_PLAIN_MAP_SMALL") - { - SBound bound = static_cast(2); - PlainMapSTypeDefn map_sdefn = TypeObjectUtils::build_plain_map_s_type_defn(header_anonymous_map_int32_t_int32_t_2, bound, - eprosima::fastcdr::external(element_identifier_anonymous_map_int32_t_int32_t_2), key_flags_anonymous_map_int32_t_int32_t_2, - eprosima::fastcdr::external(key_identifier_anonymous_map_int32_t_int32_t_2)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_s_map_type_identifier(map_sdefn, "anonymous_map_int32_t_int32_t_2")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_int32_t_2 already registered in TypeObjectRegistry for a different type."); - } - } - else - { - LBound bound = 2; - PlainMapLTypeDefn map_ldefn = TypeObjectUtils::build_plain_map_l_type_defn(header_anonymous_map_int32_t_int32_t_2, bound, - eprosima::fastcdr::external(element_identifier_anonymous_map_int32_t_int32_t_2), key_flags_anonymous_map_int32_t_int32_t_2, - eprosima::fastcdr::external(key_identifier_anonymous_map_int32_t_int32_t_2)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_l_map_type_identifier(map_ldefn, "anonymous_map_int32_t_int32_t_2")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_int32_t_2 already registered in TypeObjectRegistry for a different type."); - } - } - return_code_MapStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_map_int32_t_int32_t_2", type_ids_MapStruct); - if (return_code_MapStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_int32_t_2: Given Map TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_map = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_map; - MemberId member_id_my_map = 0x00000000; - if (EK_COMPLETE == type_ids_MapStruct.type_identifier1()._d() || TK_NONE == type_ids_MapStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_MapStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_MapStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_MapStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_MapStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_MapStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_MapStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_MapStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_MapStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_map = TypeObjectUtils::build_common_struct_member(member_id_my_map, member_flags_my_map, type_ids_MapStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_MapStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_MapStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_MapStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_MapStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_MapStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_MapStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_MapStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_MapStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_MapStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_map = TypeObjectUtils::build_common_struct_member(member_id_my_map, member_flags_my_map, type_ids_MapStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_map member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_map = "my_map"; - eprosima::fastcdr::optional member_ann_builtin_my_map; - ann_custom_MapStruct.reset(); - CompleteMemberDetail detail_my_map = TypeObjectUtils::build_complete_member_detail(name_my_map, member_ann_builtin_my_map, ann_custom_MapStruct); - CompleteStructMember member_my_map = TypeObjectUtils::build_complete_struct_member(common_my_map, detail_my_map); - TypeObjectUtils::add_complete_struct_member(member_seq_MapStruct, member_my_map); - } - CompleteStructType struct_type_MapStruct = TypeObjectUtils::build_complete_struct_type(struct_flags_MapStruct, header_MapStruct, member_seq_MapStruct); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_MapStruct, type_name_MapStruct.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MapStruct already registered in TypeObjectRegistry for a different type."); - } - return_code_MapStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MapStruct", type_ids_MapStruct); - if (return_code_MapStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MapStruct: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } -} -void register_MapStructEqual_type_identifier() -{ - { - StructTypeFlag struct_flags_MapStructEqual = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_MapStructEqual; - TypeIdentifierPair type_ids_MapStructEqual; - QualifiedTypeName type_name_MapStructEqual = "MapStructEqual"; - eprosima::fastcdr::optional type_ann_builtin_MapStructEqual; - eprosima::fastcdr::optional ann_custom_MapStructEqual; - CompleteTypeDetail detail_MapStructEqual = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_MapStructEqual, ann_custom_MapStructEqual, type_name_MapStructEqual.to_string()); - CompleteStructHeader header_MapStructEqual; - header_MapStructEqual = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_MapStructEqual); - CompleteStructMemberSeq member_seq_MapStructEqual; - { - return_code_MapStructEqual = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_map_int32_t_int32_t_2", type_ids_MapStructEqual); - - if (return_code_MapStructEqual != eprosima::fastdds::dds::RETCODE_OK) - { - return_code_MapStructEqual = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_MapStructEqual); - - if (return_code_MapStructEqual != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Map element TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - TypeIdentifier* element_identifier_anonymous_map_int32_t_int32_t_2 {nullptr}; - if (EK_COMPLETE == type_ids_MapStructEqual.type_identifier1()._d() || TK_NONE == type_ids_MapStructEqual.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_MapStructEqual.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapStructEqual.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_MapStructEqual.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapStructEqual.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_MapStructEqual.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapStructEqual.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_MapStructEqual.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapStructEqual.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_MapStructEqual.type_identifier1()._d() && - (EK_COMPLETE == type_ids_MapStructEqual.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapStructEqual.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_MapStructEqual.type_identifier1()._d() && - (EK_COMPLETE == type_ids_MapStructEqual.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapStructEqual.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_map_int32_t_int32_t_2 = new TypeIdentifier(type_ids_MapStructEqual.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_MapStructEqual.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_MapStructEqual.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapStructEqual.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_MapStructEqual.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapStructEqual.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_MapStructEqual.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapStructEqual.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_MapStructEqual.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapStructEqual.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_MapStructEqual.type_identifier2()._d() && - (EK_COMPLETE == type_ids_MapStructEqual.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapStructEqual.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_MapStructEqual.type_identifier2()._d() && - (EK_COMPLETE == type_ids_MapStructEqual.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapStructEqual.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_map_int32_t_int32_t_2 = new TypeIdentifier(type_ids_MapStructEqual.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_int32_t_2 inconsistent element TypeIdentifier."); - return; - } - return_code_MapStructEqual = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_MapStructEqual); - - if (return_code_MapStructEqual != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Map key TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - TypeIdentifier* key_identifier_anonymous_map_int32_t_int32_t_2 {nullptr}; - if (EK_COMPLETE == type_ids_MapStructEqual.type_identifier1()._d() || TK_NONE == type_ids_MapStructEqual.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_MapStructEqual.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapStructEqual.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_MapStructEqual.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapStructEqual.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_MapStructEqual.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapStructEqual.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_MapStructEqual.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapStructEqual.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_MapStructEqual.type_identifier1()._d() && - (EK_COMPLETE == type_ids_MapStructEqual.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapStructEqual.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_MapStructEqual.type_identifier1()._d() && - (EK_COMPLETE == type_ids_MapStructEqual.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapStructEqual.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - key_identifier_anonymous_map_int32_t_int32_t_2 = new TypeIdentifier(type_ids_MapStructEqual.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_MapStructEqual.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_MapStructEqual.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapStructEqual.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_MapStructEqual.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapStructEqual.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_MapStructEqual.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapStructEqual.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_MapStructEqual.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapStructEqual.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_MapStructEqual.type_identifier2()._d() && - (EK_COMPLETE == type_ids_MapStructEqual.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapStructEqual.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_MapStructEqual.type_identifier2()._d() && - (EK_COMPLETE == type_ids_MapStructEqual.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapStructEqual.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - key_identifier_anonymous_map_int32_t_int32_t_2 = new TypeIdentifier(type_ids_MapStructEqual.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_int32_t_2 inconsistent key TypeIdentifier."); - return; - } - EquivalenceKind equiv_kind_anonymous_map_int32_t_int32_t_2 = EK_BOTH; - if ((EK_COMPLETE == key_identifier_anonymous_map_int32_t_int32_t_2->_d() || EK_COMPLETE == element_identifier_anonymous_map_int32_t_int32_t_2->_d()) || - (TI_PLAIN_SEQUENCE_SMALL == element_identifier_anonymous_map_int32_t_int32_t_2->_d() && EK_COMPLETE == element_identifier_anonymous_map_int32_t_int32_t_2->seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == element_identifier_anonymous_map_int32_t_int32_t_2->_d() && EK_COMPLETE == element_identifier_anonymous_map_int32_t_int32_t_2->seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == element_identifier_anonymous_map_int32_t_int32_t_2->_d() && EK_COMPLETE == element_identifier_anonymous_map_int32_t_int32_t_2->array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == element_identifier_anonymous_map_int32_t_int32_t_2->_d() && EK_COMPLETE == element_identifier_anonymous_map_int32_t_int32_t_2->array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == element_identifier_anonymous_map_int32_t_int32_t_2->_d() && (EK_COMPLETE == element_identifier_anonymous_map_int32_t_int32_t_2->map_sdefn().key_identifier()->_d() || EK_COMPLETE == element_identifier_anonymous_map_int32_t_int32_t_2->map_sdefn().header().equiv_kind())) || - (TI_PLAIN_MAP_LARGE == element_identifier_anonymous_map_int32_t_int32_t_2->_d() && (EK_COMPLETE == element_identifier_anonymous_map_int32_t_int32_t_2->map_ldefn().key_identifier()->_d() || EK_COMPLETE == element_identifier_anonymous_map_int32_t_int32_t_2->map_ldefn().header().equiv_kind()))) - { - equiv_kind_anonymous_map_int32_t_int32_t_2 = EK_COMPLETE; - } - CollectionElementFlag element_flags_anonymous_map_int32_t_int32_t_2 = 0; - CollectionElementFlag key_flags_anonymous_map_int32_t_int32_t_2 = 0; - PlainCollectionHeader header_anonymous_map_int32_t_int32_t_2 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_map_int32_t_int32_t_2, element_flags_anonymous_map_int32_t_int32_t_2); - std::string type_id_kind_anonymous_map_int32_t_int32_t_2("TI_PLAIN_MAP_SMALL"); - if (type_id_kind_anonymous_map_int32_t_int32_t_2 == "TI_PLAIN_MAP_SMALL") - { - SBound bound = static_cast(2); - PlainMapSTypeDefn map_sdefn = TypeObjectUtils::build_plain_map_s_type_defn(header_anonymous_map_int32_t_int32_t_2, bound, - eprosima::fastcdr::external(element_identifier_anonymous_map_int32_t_int32_t_2), key_flags_anonymous_map_int32_t_int32_t_2, - eprosima::fastcdr::external(key_identifier_anonymous_map_int32_t_int32_t_2)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_s_map_type_identifier(map_sdefn, "anonymous_map_int32_t_int32_t_2")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_int32_t_2 already registered in TypeObjectRegistry for a different type."); - } - } - else - { - LBound bound = 2; - PlainMapLTypeDefn map_ldefn = TypeObjectUtils::build_plain_map_l_type_defn(header_anonymous_map_int32_t_int32_t_2, bound, - eprosima::fastcdr::external(element_identifier_anonymous_map_int32_t_int32_t_2), key_flags_anonymous_map_int32_t_int32_t_2, - eprosima::fastcdr::external(key_identifier_anonymous_map_int32_t_int32_t_2)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_l_map_type_identifier(map_ldefn, "anonymous_map_int32_t_int32_t_2")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_int32_t_2 already registered in TypeObjectRegistry for a different type."); - } - } - return_code_MapStructEqual = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_map_int32_t_int32_t_2", type_ids_MapStructEqual); - if (return_code_MapStructEqual != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_int32_t_2: Given Map TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_map_equal = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_map_equal; - MemberId member_id_my_map_equal = 0x00000000; - if (EK_COMPLETE == type_ids_MapStructEqual.type_identifier1()._d() || TK_NONE == type_ids_MapStructEqual.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_MapStructEqual.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapStructEqual.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_MapStructEqual.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapStructEqual.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_MapStructEqual.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapStructEqual.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_MapStructEqual.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapStructEqual.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_MapStructEqual.type_identifier1()._d() && - (EK_COMPLETE == type_ids_MapStructEqual.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapStructEqual.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_MapStructEqual.type_identifier1()._d() && - (EK_COMPLETE == type_ids_MapStructEqual.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapStructEqual.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_map_equal = TypeObjectUtils::build_common_struct_member(member_id_my_map_equal, member_flags_my_map_equal, type_ids_MapStructEqual.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_MapStructEqual.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_MapStructEqual.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapStructEqual.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_MapStructEqual.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapStructEqual.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_MapStructEqual.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapStructEqual.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_MapStructEqual.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapStructEqual.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_MapStructEqual.type_identifier2()._d() && - (EK_COMPLETE == type_ids_MapStructEqual.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapStructEqual.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_MapStructEqual.type_identifier2()._d() && - (EK_COMPLETE == type_ids_MapStructEqual.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapStructEqual.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_map_equal = TypeObjectUtils::build_common_struct_member(member_id_my_map_equal, member_flags_my_map_equal, type_ids_MapStructEqual.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_map_equal member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_map_equal = "my_map_equal"; - eprosima::fastcdr::optional member_ann_builtin_my_map_equal; - ann_custom_MapStructEqual.reset(); - CompleteMemberDetail detail_my_map_equal = TypeObjectUtils::build_complete_member_detail(name_my_map_equal, member_ann_builtin_my_map_equal, ann_custom_MapStructEqual); - CompleteStructMember member_my_map_equal = TypeObjectUtils::build_complete_struct_member(common_my_map_equal, detail_my_map_equal); - TypeObjectUtils::add_complete_struct_member(member_seq_MapStructEqual, member_my_map_equal); - } - CompleteStructType struct_type_MapStructEqual = TypeObjectUtils::build_complete_struct_type(struct_flags_MapStructEqual, header_MapStructEqual, member_seq_MapStructEqual); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_MapStructEqual, type_name_MapStructEqual.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MapStructEqual already registered in TypeObjectRegistry for a different type."); - } - return_code_MapStructEqual = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MapStructEqual", type_ids_MapStructEqual); - if (return_code_MapStructEqual != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MapStructEqual: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } -} -void register_MapBadKeyStruct_type_identifier() -{ - { - StructTypeFlag struct_flags_MapBadKeyStruct = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_MapBadKeyStruct; - TypeIdentifierPair type_ids_MapBadKeyStruct; - QualifiedTypeName type_name_MapBadKeyStruct = "MapBadKeyStruct"; - eprosima::fastcdr::optional type_ann_builtin_MapBadKeyStruct; - eprosima::fastcdr::optional ann_custom_MapBadKeyStruct; - CompleteTypeDetail detail_MapBadKeyStruct = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_MapBadKeyStruct, ann_custom_MapBadKeyStruct, type_name_MapBadKeyStruct.to_string()); - CompleteStructHeader header_MapBadKeyStruct; - header_MapBadKeyStruct = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_MapBadKeyStruct); - CompleteStructMemberSeq member_seq_MapBadKeyStruct; - { - return_code_MapBadKeyStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_map_uint8_t_int32_t_2", type_ids_MapBadKeyStruct); - - if (return_code_MapBadKeyStruct != eprosima::fastdds::dds::RETCODE_OK) - { - return_code_MapBadKeyStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_MapBadKeyStruct); - - if (return_code_MapBadKeyStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Map element TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - TypeIdentifier* element_identifier_anonymous_map_uint8_t_int32_t_2 {nullptr}; - if (EK_COMPLETE == type_ids_MapBadKeyStruct.type_identifier1()._d() || TK_NONE == type_ids_MapBadKeyStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_MapBadKeyStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapBadKeyStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_MapBadKeyStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapBadKeyStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_MapBadKeyStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapBadKeyStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_MapBadKeyStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapBadKeyStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_MapBadKeyStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_MapBadKeyStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapBadKeyStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_MapBadKeyStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_MapBadKeyStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapBadKeyStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_map_uint8_t_int32_t_2 = new TypeIdentifier(type_ids_MapBadKeyStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_MapBadKeyStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_MapBadKeyStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapBadKeyStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_MapBadKeyStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapBadKeyStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_MapBadKeyStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapBadKeyStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_MapBadKeyStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapBadKeyStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_MapBadKeyStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_MapBadKeyStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapBadKeyStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_MapBadKeyStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_MapBadKeyStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapBadKeyStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_map_uint8_t_int32_t_2 = new TypeIdentifier(type_ids_MapBadKeyStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_uint8_t_int32_t_2 inconsistent element TypeIdentifier."); - return; - } - return_code_MapBadKeyStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_byte", type_ids_MapBadKeyStruct); - - if (return_code_MapBadKeyStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Map key TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - TypeIdentifier* key_identifier_anonymous_map_uint8_t_int32_t_2 {nullptr}; - if (EK_COMPLETE == type_ids_MapBadKeyStruct.type_identifier1()._d() || TK_NONE == type_ids_MapBadKeyStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_MapBadKeyStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapBadKeyStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_MapBadKeyStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapBadKeyStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_MapBadKeyStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapBadKeyStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_MapBadKeyStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapBadKeyStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_MapBadKeyStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_MapBadKeyStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapBadKeyStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_MapBadKeyStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_MapBadKeyStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapBadKeyStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - key_identifier_anonymous_map_uint8_t_int32_t_2 = new TypeIdentifier(type_ids_MapBadKeyStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_MapBadKeyStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_MapBadKeyStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapBadKeyStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_MapBadKeyStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapBadKeyStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_MapBadKeyStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapBadKeyStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_MapBadKeyStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapBadKeyStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_MapBadKeyStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_MapBadKeyStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapBadKeyStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_MapBadKeyStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_MapBadKeyStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapBadKeyStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - key_identifier_anonymous_map_uint8_t_int32_t_2 = new TypeIdentifier(type_ids_MapBadKeyStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_uint8_t_int32_t_2 inconsistent key TypeIdentifier."); - return; - } - EquivalenceKind equiv_kind_anonymous_map_uint8_t_int32_t_2 = EK_BOTH; - if ((EK_COMPLETE == key_identifier_anonymous_map_uint8_t_int32_t_2->_d() || EK_COMPLETE == element_identifier_anonymous_map_uint8_t_int32_t_2->_d()) || - (TI_PLAIN_SEQUENCE_SMALL == element_identifier_anonymous_map_uint8_t_int32_t_2->_d() && EK_COMPLETE == element_identifier_anonymous_map_uint8_t_int32_t_2->seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == element_identifier_anonymous_map_uint8_t_int32_t_2->_d() && EK_COMPLETE == element_identifier_anonymous_map_uint8_t_int32_t_2->seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == element_identifier_anonymous_map_uint8_t_int32_t_2->_d() && EK_COMPLETE == element_identifier_anonymous_map_uint8_t_int32_t_2->array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == element_identifier_anonymous_map_uint8_t_int32_t_2->_d() && EK_COMPLETE == element_identifier_anonymous_map_uint8_t_int32_t_2->array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == element_identifier_anonymous_map_uint8_t_int32_t_2->_d() && (EK_COMPLETE == element_identifier_anonymous_map_uint8_t_int32_t_2->map_sdefn().key_identifier()->_d() || EK_COMPLETE == element_identifier_anonymous_map_uint8_t_int32_t_2->map_sdefn().header().equiv_kind())) || - (TI_PLAIN_MAP_LARGE == element_identifier_anonymous_map_uint8_t_int32_t_2->_d() && (EK_COMPLETE == element_identifier_anonymous_map_uint8_t_int32_t_2->map_ldefn().key_identifier()->_d() || EK_COMPLETE == element_identifier_anonymous_map_uint8_t_int32_t_2->map_ldefn().header().equiv_kind()))) - { - equiv_kind_anonymous_map_uint8_t_int32_t_2 = EK_COMPLETE; - } - CollectionElementFlag element_flags_anonymous_map_uint8_t_int32_t_2 = 0; - CollectionElementFlag key_flags_anonymous_map_uint8_t_int32_t_2 = 0; - PlainCollectionHeader header_anonymous_map_uint8_t_int32_t_2 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_map_uint8_t_int32_t_2, element_flags_anonymous_map_uint8_t_int32_t_2); - std::string type_id_kind_anonymous_map_uint8_t_int32_t_2("TI_PLAIN_MAP_SMALL"); - if (type_id_kind_anonymous_map_uint8_t_int32_t_2 == "TI_PLAIN_MAP_SMALL") - { - SBound bound = static_cast(2); - PlainMapSTypeDefn map_sdefn = TypeObjectUtils::build_plain_map_s_type_defn(header_anonymous_map_uint8_t_int32_t_2, bound, - eprosima::fastcdr::external(element_identifier_anonymous_map_uint8_t_int32_t_2), key_flags_anonymous_map_uint8_t_int32_t_2, - eprosima::fastcdr::external(key_identifier_anonymous_map_uint8_t_int32_t_2)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_s_map_type_identifier(map_sdefn, "anonymous_map_uint8_t_int32_t_2")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_uint8_t_int32_t_2 already registered in TypeObjectRegistry for a different type."); - } - } - else - { - LBound bound = 2; - PlainMapLTypeDefn map_ldefn = TypeObjectUtils::build_plain_map_l_type_defn(header_anonymous_map_uint8_t_int32_t_2, bound, - eprosima::fastcdr::external(element_identifier_anonymous_map_uint8_t_int32_t_2), key_flags_anonymous_map_uint8_t_int32_t_2, - eprosima::fastcdr::external(key_identifier_anonymous_map_uint8_t_int32_t_2)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_l_map_type_identifier(map_ldefn, "anonymous_map_uint8_t_int32_t_2")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_uint8_t_int32_t_2 already registered in TypeObjectRegistry for a different type."); - } - } - return_code_MapBadKeyStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_map_uint8_t_int32_t_2", type_ids_MapBadKeyStruct); - if (return_code_MapBadKeyStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_uint8_t_int32_t_2: Given Map TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_map = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_map; - MemberId member_id_my_map = 0x00000000; - if (EK_COMPLETE == type_ids_MapBadKeyStruct.type_identifier1()._d() || TK_NONE == type_ids_MapBadKeyStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_MapBadKeyStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapBadKeyStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_MapBadKeyStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapBadKeyStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_MapBadKeyStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapBadKeyStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_MapBadKeyStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapBadKeyStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_MapBadKeyStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_MapBadKeyStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapBadKeyStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_MapBadKeyStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_MapBadKeyStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapBadKeyStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_map = TypeObjectUtils::build_common_struct_member(member_id_my_map, member_flags_my_map, type_ids_MapBadKeyStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_MapBadKeyStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_MapBadKeyStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapBadKeyStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_MapBadKeyStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapBadKeyStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_MapBadKeyStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapBadKeyStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_MapBadKeyStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapBadKeyStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_MapBadKeyStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_MapBadKeyStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapBadKeyStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_MapBadKeyStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_MapBadKeyStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapBadKeyStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_map = TypeObjectUtils::build_common_struct_member(member_id_my_map, member_flags_my_map, type_ids_MapBadKeyStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_map member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_map = "my_map"; - eprosima::fastcdr::optional member_ann_builtin_my_map; - ann_custom_MapBadKeyStruct.reset(); - CompleteMemberDetail detail_my_map = TypeObjectUtils::build_complete_member_detail(name_my_map, member_ann_builtin_my_map, ann_custom_MapBadKeyStruct); - CompleteStructMember member_my_map = TypeObjectUtils::build_complete_struct_member(common_my_map, detail_my_map); - TypeObjectUtils::add_complete_struct_member(member_seq_MapBadKeyStruct, member_my_map); - } - CompleteStructType struct_type_MapBadKeyStruct = TypeObjectUtils::build_complete_struct_type(struct_flags_MapBadKeyStruct, header_MapBadKeyStruct, member_seq_MapBadKeyStruct); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_MapBadKeyStruct, type_name_MapBadKeyStruct.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MapBadKeyStruct already registered in TypeObjectRegistry for a different type."); - } - return_code_MapBadKeyStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MapBadKeyStruct", type_ids_MapBadKeyStruct); - if (return_code_MapBadKeyStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MapBadKeyStruct: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } -} -void register_MapBadElemStruct_type_identifier() -{ - { - StructTypeFlag struct_flags_MapBadElemStruct = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_MapBadElemStruct; - TypeIdentifierPair type_ids_MapBadElemStruct; - QualifiedTypeName type_name_MapBadElemStruct = "MapBadElemStruct"; - eprosima::fastcdr::optional type_ann_builtin_MapBadElemStruct; - eprosima::fastcdr::optional ann_custom_MapBadElemStruct; - CompleteTypeDetail detail_MapBadElemStruct = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_MapBadElemStruct, ann_custom_MapBadElemStruct, type_name_MapBadElemStruct.to_string()); - CompleteStructHeader header_MapBadElemStruct; - header_MapBadElemStruct = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_MapBadElemStruct); - CompleteStructMemberSeq member_seq_MapBadElemStruct; - { - return_code_MapBadElemStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_map_int32_t_int64_t_2", type_ids_MapBadElemStruct); - - if (return_code_MapBadElemStruct != eprosima::fastdds::dds::RETCODE_OK) - { - return_code_MapBadElemStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int64_t", type_ids_MapBadElemStruct); - - if (return_code_MapBadElemStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Map element TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - TypeIdentifier* element_identifier_anonymous_map_int32_t_int64_t_2 {nullptr}; - if (EK_COMPLETE == type_ids_MapBadElemStruct.type_identifier1()._d() || TK_NONE == type_ids_MapBadElemStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_MapBadElemStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapBadElemStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_MapBadElemStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapBadElemStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_MapBadElemStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapBadElemStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_MapBadElemStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapBadElemStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_MapBadElemStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_MapBadElemStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapBadElemStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_MapBadElemStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_MapBadElemStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapBadElemStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_map_int32_t_int64_t_2 = new TypeIdentifier(type_ids_MapBadElemStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_MapBadElemStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_MapBadElemStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapBadElemStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_MapBadElemStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapBadElemStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_MapBadElemStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapBadElemStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_MapBadElemStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapBadElemStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_MapBadElemStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_MapBadElemStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapBadElemStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_MapBadElemStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_MapBadElemStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapBadElemStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_map_int32_t_int64_t_2 = new TypeIdentifier(type_ids_MapBadElemStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_int64_t_2 inconsistent element TypeIdentifier."); - return; - } - return_code_MapBadElemStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_MapBadElemStruct); - - if (return_code_MapBadElemStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Map key TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - TypeIdentifier* key_identifier_anonymous_map_int32_t_int64_t_2 {nullptr}; - if (EK_COMPLETE == type_ids_MapBadElemStruct.type_identifier1()._d() || TK_NONE == type_ids_MapBadElemStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_MapBadElemStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapBadElemStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_MapBadElemStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapBadElemStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_MapBadElemStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapBadElemStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_MapBadElemStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapBadElemStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_MapBadElemStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_MapBadElemStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapBadElemStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_MapBadElemStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_MapBadElemStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapBadElemStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - key_identifier_anonymous_map_int32_t_int64_t_2 = new TypeIdentifier(type_ids_MapBadElemStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_MapBadElemStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_MapBadElemStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapBadElemStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_MapBadElemStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapBadElemStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_MapBadElemStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapBadElemStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_MapBadElemStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapBadElemStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_MapBadElemStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_MapBadElemStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapBadElemStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_MapBadElemStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_MapBadElemStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapBadElemStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - key_identifier_anonymous_map_int32_t_int64_t_2 = new TypeIdentifier(type_ids_MapBadElemStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_int64_t_2 inconsistent key TypeIdentifier."); - return; - } - EquivalenceKind equiv_kind_anonymous_map_int32_t_int64_t_2 = EK_BOTH; - if ((EK_COMPLETE == key_identifier_anonymous_map_int32_t_int64_t_2->_d() || EK_COMPLETE == element_identifier_anonymous_map_int32_t_int64_t_2->_d()) || - (TI_PLAIN_SEQUENCE_SMALL == element_identifier_anonymous_map_int32_t_int64_t_2->_d() && EK_COMPLETE == element_identifier_anonymous_map_int32_t_int64_t_2->seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == element_identifier_anonymous_map_int32_t_int64_t_2->_d() && EK_COMPLETE == element_identifier_anonymous_map_int32_t_int64_t_2->seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == element_identifier_anonymous_map_int32_t_int64_t_2->_d() && EK_COMPLETE == element_identifier_anonymous_map_int32_t_int64_t_2->array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == element_identifier_anonymous_map_int32_t_int64_t_2->_d() && EK_COMPLETE == element_identifier_anonymous_map_int32_t_int64_t_2->array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == element_identifier_anonymous_map_int32_t_int64_t_2->_d() && (EK_COMPLETE == element_identifier_anonymous_map_int32_t_int64_t_2->map_sdefn().key_identifier()->_d() || EK_COMPLETE == element_identifier_anonymous_map_int32_t_int64_t_2->map_sdefn().header().equiv_kind())) || - (TI_PLAIN_MAP_LARGE == element_identifier_anonymous_map_int32_t_int64_t_2->_d() && (EK_COMPLETE == element_identifier_anonymous_map_int32_t_int64_t_2->map_ldefn().key_identifier()->_d() || EK_COMPLETE == element_identifier_anonymous_map_int32_t_int64_t_2->map_ldefn().header().equiv_kind()))) - { - equiv_kind_anonymous_map_int32_t_int64_t_2 = EK_COMPLETE; - } - CollectionElementFlag element_flags_anonymous_map_int32_t_int64_t_2 = 0; - CollectionElementFlag key_flags_anonymous_map_int32_t_int64_t_2 = 0; - PlainCollectionHeader header_anonymous_map_int32_t_int64_t_2 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_map_int32_t_int64_t_2, element_flags_anonymous_map_int32_t_int64_t_2); - std::string type_id_kind_anonymous_map_int32_t_int64_t_2("TI_PLAIN_MAP_SMALL"); - if (type_id_kind_anonymous_map_int32_t_int64_t_2 == "TI_PLAIN_MAP_SMALL") - { - SBound bound = static_cast(2); - PlainMapSTypeDefn map_sdefn = TypeObjectUtils::build_plain_map_s_type_defn(header_anonymous_map_int32_t_int64_t_2, bound, - eprosima::fastcdr::external(element_identifier_anonymous_map_int32_t_int64_t_2), key_flags_anonymous_map_int32_t_int64_t_2, - eprosima::fastcdr::external(key_identifier_anonymous_map_int32_t_int64_t_2)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_s_map_type_identifier(map_sdefn, "anonymous_map_int32_t_int64_t_2")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_int64_t_2 already registered in TypeObjectRegistry for a different type."); - } - } - else - { - LBound bound = 2; - PlainMapLTypeDefn map_ldefn = TypeObjectUtils::build_plain_map_l_type_defn(header_anonymous_map_int32_t_int64_t_2, bound, - eprosima::fastcdr::external(element_identifier_anonymous_map_int32_t_int64_t_2), key_flags_anonymous_map_int32_t_int64_t_2, - eprosima::fastcdr::external(key_identifier_anonymous_map_int32_t_int64_t_2)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_l_map_type_identifier(map_ldefn, "anonymous_map_int32_t_int64_t_2")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_int64_t_2 already registered in TypeObjectRegistry for a different type."); - } - } - return_code_MapBadElemStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_map_int32_t_int64_t_2", type_ids_MapBadElemStruct); - if (return_code_MapBadElemStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_int64_t_2: Given Map TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_map = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_map; - MemberId member_id_my_map = 0x00000000; - if (EK_COMPLETE == type_ids_MapBadElemStruct.type_identifier1()._d() || TK_NONE == type_ids_MapBadElemStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_MapBadElemStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapBadElemStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_MapBadElemStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapBadElemStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_MapBadElemStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapBadElemStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_MapBadElemStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapBadElemStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_MapBadElemStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_MapBadElemStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapBadElemStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_MapBadElemStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_MapBadElemStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapBadElemStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_map = TypeObjectUtils::build_common_struct_member(member_id_my_map, member_flags_my_map, type_ids_MapBadElemStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_MapBadElemStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_MapBadElemStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapBadElemStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_MapBadElemStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapBadElemStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_MapBadElemStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapBadElemStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_MapBadElemStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapBadElemStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_MapBadElemStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_MapBadElemStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapBadElemStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_MapBadElemStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_MapBadElemStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapBadElemStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_map = TypeObjectUtils::build_common_struct_member(member_id_my_map, member_flags_my_map, type_ids_MapBadElemStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_map member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_map = "my_map"; - eprosima::fastcdr::optional member_ann_builtin_my_map; - ann_custom_MapBadElemStruct.reset(); - CompleteMemberDetail detail_my_map = TypeObjectUtils::build_complete_member_detail(name_my_map, member_ann_builtin_my_map, ann_custom_MapBadElemStruct); - CompleteStructMember member_my_map = TypeObjectUtils::build_complete_struct_member(common_my_map, detail_my_map); - TypeObjectUtils::add_complete_struct_member(member_seq_MapBadElemStruct, member_my_map); - } - CompleteStructType struct_type_MapBadElemStruct = TypeObjectUtils::build_complete_struct_type(struct_flags_MapBadElemStruct, header_MapBadElemStruct, member_seq_MapBadElemStruct); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_MapBadElemStruct, type_name_MapBadElemStruct.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MapBadElemStruct already registered in TypeObjectRegistry for a different type."); - } - return_code_MapBadElemStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MapBadElemStruct", type_ids_MapBadElemStruct); - if (return_code_MapBadElemStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MapBadElemStruct: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } -} -void register_MapBoundsStruct_type_identifier() -{ - { - StructTypeFlag struct_flags_MapBoundsStruct = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_MapBoundsStruct; - TypeIdentifierPair type_ids_MapBoundsStruct; - QualifiedTypeName type_name_MapBoundsStruct = "MapBoundsStruct"; - eprosima::fastcdr::optional type_ann_builtin_MapBoundsStruct; - eprosima::fastcdr::optional ann_custom_MapBoundsStruct; - CompleteTypeDetail detail_MapBoundsStruct = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_MapBoundsStruct, ann_custom_MapBoundsStruct, type_name_MapBoundsStruct.to_string()); - CompleteStructHeader header_MapBoundsStruct; - header_MapBoundsStruct = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_MapBoundsStruct); - CompleteStructMemberSeq member_seq_MapBoundsStruct; - { - return_code_MapBoundsStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_map_int32_t_int32_t_4", type_ids_MapBoundsStruct); - - if (return_code_MapBoundsStruct != eprosima::fastdds::dds::RETCODE_OK) - { - return_code_MapBoundsStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_MapBoundsStruct); - - if (return_code_MapBoundsStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Map element TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - TypeIdentifier* element_identifier_anonymous_map_int32_t_int32_t_4 {nullptr}; - if (EK_COMPLETE == type_ids_MapBoundsStruct.type_identifier1()._d() || TK_NONE == type_ids_MapBoundsStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_MapBoundsStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapBoundsStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_MapBoundsStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapBoundsStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_MapBoundsStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapBoundsStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_MapBoundsStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapBoundsStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_MapBoundsStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_MapBoundsStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapBoundsStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_MapBoundsStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_MapBoundsStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapBoundsStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_map_int32_t_int32_t_4 = new TypeIdentifier(type_ids_MapBoundsStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_MapBoundsStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_MapBoundsStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapBoundsStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_MapBoundsStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapBoundsStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_MapBoundsStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapBoundsStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_MapBoundsStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapBoundsStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_MapBoundsStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_MapBoundsStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapBoundsStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_MapBoundsStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_MapBoundsStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapBoundsStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_map_int32_t_int32_t_4 = new TypeIdentifier(type_ids_MapBoundsStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_int32_t_4 inconsistent element TypeIdentifier."); - return; - } - return_code_MapBoundsStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_MapBoundsStruct); - - if (return_code_MapBoundsStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Map key TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - TypeIdentifier* key_identifier_anonymous_map_int32_t_int32_t_4 {nullptr}; - if (EK_COMPLETE == type_ids_MapBoundsStruct.type_identifier1()._d() || TK_NONE == type_ids_MapBoundsStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_MapBoundsStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapBoundsStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_MapBoundsStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapBoundsStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_MapBoundsStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapBoundsStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_MapBoundsStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapBoundsStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_MapBoundsStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_MapBoundsStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapBoundsStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_MapBoundsStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_MapBoundsStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapBoundsStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - key_identifier_anonymous_map_int32_t_int32_t_4 = new TypeIdentifier(type_ids_MapBoundsStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_MapBoundsStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_MapBoundsStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapBoundsStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_MapBoundsStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapBoundsStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_MapBoundsStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapBoundsStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_MapBoundsStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapBoundsStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_MapBoundsStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_MapBoundsStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapBoundsStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_MapBoundsStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_MapBoundsStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapBoundsStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - key_identifier_anonymous_map_int32_t_int32_t_4 = new TypeIdentifier(type_ids_MapBoundsStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_int32_t_4 inconsistent key TypeIdentifier."); - return; - } - EquivalenceKind equiv_kind_anonymous_map_int32_t_int32_t_4 = EK_BOTH; - if ((EK_COMPLETE == key_identifier_anonymous_map_int32_t_int32_t_4->_d() || EK_COMPLETE == element_identifier_anonymous_map_int32_t_int32_t_4->_d()) || - (TI_PLAIN_SEQUENCE_SMALL == element_identifier_anonymous_map_int32_t_int32_t_4->_d() && EK_COMPLETE == element_identifier_anonymous_map_int32_t_int32_t_4->seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == element_identifier_anonymous_map_int32_t_int32_t_4->_d() && EK_COMPLETE == element_identifier_anonymous_map_int32_t_int32_t_4->seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == element_identifier_anonymous_map_int32_t_int32_t_4->_d() && EK_COMPLETE == element_identifier_anonymous_map_int32_t_int32_t_4->array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == element_identifier_anonymous_map_int32_t_int32_t_4->_d() && EK_COMPLETE == element_identifier_anonymous_map_int32_t_int32_t_4->array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == element_identifier_anonymous_map_int32_t_int32_t_4->_d() && (EK_COMPLETE == element_identifier_anonymous_map_int32_t_int32_t_4->map_sdefn().key_identifier()->_d() || EK_COMPLETE == element_identifier_anonymous_map_int32_t_int32_t_4->map_sdefn().header().equiv_kind())) || - (TI_PLAIN_MAP_LARGE == element_identifier_anonymous_map_int32_t_int32_t_4->_d() && (EK_COMPLETE == element_identifier_anonymous_map_int32_t_int32_t_4->map_ldefn().key_identifier()->_d() || EK_COMPLETE == element_identifier_anonymous_map_int32_t_int32_t_4->map_ldefn().header().equiv_kind()))) - { - equiv_kind_anonymous_map_int32_t_int32_t_4 = EK_COMPLETE; - } - CollectionElementFlag element_flags_anonymous_map_int32_t_int32_t_4 = 0; - CollectionElementFlag key_flags_anonymous_map_int32_t_int32_t_4 = 0; - PlainCollectionHeader header_anonymous_map_int32_t_int32_t_4 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_map_int32_t_int32_t_4, element_flags_anonymous_map_int32_t_int32_t_4); - std::string type_id_kind_anonymous_map_int32_t_int32_t_4("TI_PLAIN_MAP_SMALL"); - if (type_id_kind_anonymous_map_int32_t_int32_t_4 == "TI_PLAIN_MAP_SMALL") - { - SBound bound = static_cast(4); - PlainMapSTypeDefn map_sdefn = TypeObjectUtils::build_plain_map_s_type_defn(header_anonymous_map_int32_t_int32_t_4, bound, - eprosima::fastcdr::external(element_identifier_anonymous_map_int32_t_int32_t_4), key_flags_anonymous_map_int32_t_int32_t_4, - eprosima::fastcdr::external(key_identifier_anonymous_map_int32_t_int32_t_4)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_s_map_type_identifier(map_sdefn, "anonymous_map_int32_t_int32_t_4")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_int32_t_4 already registered in TypeObjectRegistry for a different type."); - } - } - else - { - LBound bound = 4; - PlainMapLTypeDefn map_ldefn = TypeObjectUtils::build_plain_map_l_type_defn(header_anonymous_map_int32_t_int32_t_4, bound, - eprosima::fastcdr::external(element_identifier_anonymous_map_int32_t_int32_t_4), key_flags_anonymous_map_int32_t_int32_t_4, - eprosima::fastcdr::external(key_identifier_anonymous_map_int32_t_int32_t_4)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_l_map_type_identifier(map_ldefn, "anonymous_map_int32_t_int32_t_4")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_int32_t_4 already registered in TypeObjectRegistry for a different type."); - } - } - return_code_MapBoundsStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_map_int32_t_int32_t_4", type_ids_MapBoundsStruct); - if (return_code_MapBoundsStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_int32_t_4: Given Map TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_map = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_map; - MemberId member_id_my_map = 0x00000000; - if (EK_COMPLETE == type_ids_MapBoundsStruct.type_identifier1()._d() || TK_NONE == type_ids_MapBoundsStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_MapBoundsStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapBoundsStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_MapBoundsStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapBoundsStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_MapBoundsStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapBoundsStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_MapBoundsStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapBoundsStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_MapBoundsStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_MapBoundsStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapBoundsStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_MapBoundsStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_MapBoundsStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapBoundsStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_map = TypeObjectUtils::build_common_struct_member(member_id_my_map, member_flags_my_map, type_ids_MapBoundsStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_MapBoundsStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_MapBoundsStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapBoundsStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_MapBoundsStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapBoundsStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_MapBoundsStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapBoundsStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_MapBoundsStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapBoundsStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_MapBoundsStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_MapBoundsStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapBoundsStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_MapBoundsStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_MapBoundsStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapBoundsStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_map = TypeObjectUtils::build_common_struct_member(member_id_my_map, member_flags_my_map, type_ids_MapBoundsStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_map member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_map = "my_map"; - eprosima::fastcdr::optional member_ann_builtin_my_map; - ann_custom_MapBoundsStruct.reset(); - CompleteMemberDetail detail_my_map = TypeObjectUtils::build_complete_member_detail(name_my_map, member_ann_builtin_my_map, ann_custom_MapBoundsStruct); - CompleteStructMember member_my_map = TypeObjectUtils::build_complete_struct_member(common_my_map, detail_my_map); - TypeObjectUtils::add_complete_struct_member(member_seq_MapBoundsStruct, member_my_map); - } - CompleteStructType struct_type_MapBoundsStruct = TypeObjectUtils::build_complete_struct_type(struct_flags_MapBoundsStruct, header_MapBoundsStruct, member_seq_MapBoundsStruct); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_MapBoundsStruct, type_name_MapBoundsStruct.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MapBoundsStruct already registered in TypeObjectRegistry for a different type."); - } - return_code_MapBoundsStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MapBoundsStruct", type_ids_MapBoundsStruct); - if (return_code_MapBoundsStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MapBoundsStruct: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } -} -void register_MapMapStruct_type_identifier() -{ - { - StructTypeFlag struct_flags_MapMapStruct = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_MapMapStruct; - TypeIdentifierPair type_ids_MapMapStruct; - QualifiedTypeName type_name_MapMapStruct = "MapMapStruct"; - eprosima::fastcdr::optional type_ann_builtin_MapMapStruct; - eprosima::fastcdr::optional ann_custom_MapMapStruct; - CompleteTypeDetail detail_MapMapStruct = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_MapMapStruct, ann_custom_MapMapStruct, type_name_MapMapStruct.to_string()); - CompleteStructHeader header_MapMapStruct; - header_MapMapStruct = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_MapMapStruct); - CompleteStructMemberSeq member_seq_MapMapStruct; - { - return_code_MapMapStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_map_int32_t_anonymous_map_int32_t_int32_t_2_2", type_ids_MapMapStruct); - - if (return_code_MapMapStruct != eprosima::fastdds::dds::RETCODE_OK) - { - return_code_MapMapStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_map_int32_t_int32_t_2", type_ids_MapMapStruct); - - if (return_code_MapMapStruct != eprosima::fastdds::dds::RETCODE_OK) - { - return_code_MapMapStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_MapMapStruct); - - if (return_code_MapMapStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Map element TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - TypeIdentifier* element_identifier_anonymous_map_int32_t_int32_t_2 {nullptr}; - if (EK_COMPLETE == type_ids_MapMapStruct.type_identifier1()._d() || TK_NONE == type_ids_MapMapStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_MapMapStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapMapStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_MapMapStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapMapStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_MapMapStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapMapStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_MapMapStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapMapStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_MapMapStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_MapMapStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapMapStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_MapMapStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_MapMapStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapMapStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_map_int32_t_int32_t_2 = new TypeIdentifier(type_ids_MapMapStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_MapMapStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_MapMapStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapMapStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_MapMapStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapMapStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_MapMapStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapMapStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_MapMapStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapMapStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_MapMapStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_MapMapStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapMapStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_MapMapStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_MapMapStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapMapStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_map_int32_t_int32_t_2 = new TypeIdentifier(type_ids_MapMapStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_int32_t_2 inconsistent element TypeIdentifier."); - return; - } - return_code_MapMapStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_MapMapStruct); - - if (return_code_MapMapStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Map key TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - TypeIdentifier* key_identifier_anonymous_map_int32_t_int32_t_2 {nullptr}; - if (EK_COMPLETE == type_ids_MapMapStruct.type_identifier1()._d() || TK_NONE == type_ids_MapMapStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_MapMapStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapMapStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_MapMapStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapMapStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_MapMapStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapMapStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_MapMapStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapMapStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_MapMapStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_MapMapStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapMapStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_MapMapStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_MapMapStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapMapStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - key_identifier_anonymous_map_int32_t_int32_t_2 = new TypeIdentifier(type_ids_MapMapStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_MapMapStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_MapMapStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapMapStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_MapMapStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapMapStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_MapMapStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapMapStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_MapMapStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapMapStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_MapMapStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_MapMapStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapMapStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_MapMapStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_MapMapStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapMapStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - key_identifier_anonymous_map_int32_t_int32_t_2 = new TypeIdentifier(type_ids_MapMapStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_int32_t_2 inconsistent key TypeIdentifier."); - return; - } - EquivalenceKind equiv_kind_anonymous_map_int32_t_int32_t_2 = EK_BOTH; - if ((EK_COMPLETE == key_identifier_anonymous_map_int32_t_int32_t_2->_d() || EK_COMPLETE == element_identifier_anonymous_map_int32_t_int32_t_2->_d()) || - (TI_PLAIN_SEQUENCE_SMALL == element_identifier_anonymous_map_int32_t_int32_t_2->_d() && EK_COMPLETE == element_identifier_anonymous_map_int32_t_int32_t_2->seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == element_identifier_anonymous_map_int32_t_int32_t_2->_d() && EK_COMPLETE == element_identifier_anonymous_map_int32_t_int32_t_2->seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == element_identifier_anonymous_map_int32_t_int32_t_2->_d() && EK_COMPLETE == element_identifier_anonymous_map_int32_t_int32_t_2->array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == element_identifier_anonymous_map_int32_t_int32_t_2->_d() && EK_COMPLETE == element_identifier_anonymous_map_int32_t_int32_t_2->array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == element_identifier_anonymous_map_int32_t_int32_t_2->_d() && (EK_COMPLETE == element_identifier_anonymous_map_int32_t_int32_t_2->map_sdefn().key_identifier()->_d() || EK_COMPLETE == element_identifier_anonymous_map_int32_t_int32_t_2->map_sdefn().header().equiv_kind())) || - (TI_PLAIN_MAP_LARGE == element_identifier_anonymous_map_int32_t_int32_t_2->_d() && (EK_COMPLETE == element_identifier_anonymous_map_int32_t_int32_t_2->map_ldefn().key_identifier()->_d() || EK_COMPLETE == element_identifier_anonymous_map_int32_t_int32_t_2->map_ldefn().header().equiv_kind()))) - { - equiv_kind_anonymous_map_int32_t_int32_t_2 = EK_COMPLETE; - } - CollectionElementFlag element_flags_anonymous_map_int32_t_int32_t_2 = 0; - CollectionElementFlag key_flags_anonymous_map_int32_t_int32_t_2 = 0; - PlainCollectionHeader header_anonymous_map_int32_t_int32_t_2 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_map_int32_t_int32_t_2, element_flags_anonymous_map_int32_t_int32_t_2); - std::string type_id_kind_anonymous_map_int32_t_int32_t_2("TI_PLAIN_MAP_SMALL"); - if (type_id_kind_anonymous_map_int32_t_int32_t_2 == "TI_PLAIN_MAP_SMALL") - { - SBound bound = static_cast(2); - PlainMapSTypeDefn map_sdefn = TypeObjectUtils::build_plain_map_s_type_defn(header_anonymous_map_int32_t_int32_t_2, bound, - eprosima::fastcdr::external(element_identifier_anonymous_map_int32_t_int32_t_2), key_flags_anonymous_map_int32_t_int32_t_2, - eprosima::fastcdr::external(key_identifier_anonymous_map_int32_t_int32_t_2)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_s_map_type_identifier(map_sdefn, "anonymous_map_int32_t_int32_t_2")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_int32_t_2 already registered in TypeObjectRegistry for a different type."); - } - } - else - { - LBound bound = 2; - PlainMapLTypeDefn map_ldefn = TypeObjectUtils::build_plain_map_l_type_defn(header_anonymous_map_int32_t_int32_t_2, bound, - eprosima::fastcdr::external(element_identifier_anonymous_map_int32_t_int32_t_2), key_flags_anonymous_map_int32_t_int32_t_2, - eprosima::fastcdr::external(key_identifier_anonymous_map_int32_t_int32_t_2)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_l_map_type_identifier(map_ldefn, "anonymous_map_int32_t_int32_t_2")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_int32_t_2 already registered in TypeObjectRegistry for a different type."); - } - } - return_code_MapMapStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_map_int32_t_int32_t_2", type_ids_MapMapStruct); - if (return_code_MapMapStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_int32_t_2: Given Map TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - TypeIdentifier* element_identifier_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_2_2 {nullptr}; - if (EK_COMPLETE == type_ids_MapMapStruct.type_identifier1()._d() || TK_NONE == type_ids_MapMapStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_MapMapStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapMapStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_MapMapStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapMapStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_MapMapStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapMapStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_MapMapStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapMapStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_MapMapStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_MapMapStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapMapStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_MapMapStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_MapMapStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapMapStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_2_2 = new TypeIdentifier(type_ids_MapMapStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_MapMapStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_MapMapStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapMapStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_MapMapStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapMapStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_MapMapStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapMapStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_MapMapStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapMapStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_MapMapStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_MapMapStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapMapStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_MapMapStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_MapMapStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapMapStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_2_2 = new TypeIdentifier(type_ids_MapMapStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_anonymous_map_int32_t_int32_t_2_2 inconsistent element TypeIdentifier."); - return; - } - return_code_MapMapStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_MapMapStruct); - - if (return_code_MapMapStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Map key TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - TypeIdentifier* key_identifier_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_2_2 {nullptr}; - if (EK_COMPLETE == type_ids_MapMapStruct.type_identifier1()._d() || TK_NONE == type_ids_MapMapStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_MapMapStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapMapStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_MapMapStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapMapStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_MapMapStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapMapStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_MapMapStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapMapStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_MapMapStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_MapMapStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapMapStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_MapMapStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_MapMapStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapMapStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - key_identifier_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_2_2 = new TypeIdentifier(type_ids_MapMapStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_MapMapStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_MapMapStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapMapStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_MapMapStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapMapStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_MapMapStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapMapStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_MapMapStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapMapStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_MapMapStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_MapMapStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapMapStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_MapMapStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_MapMapStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapMapStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - key_identifier_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_2_2 = new TypeIdentifier(type_ids_MapMapStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_anonymous_map_int32_t_int32_t_2_2 inconsistent key TypeIdentifier."); - return; - } - EquivalenceKind equiv_kind_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_2_2 = EK_BOTH; - if ((EK_COMPLETE == key_identifier_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_2_2->_d() || EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_2_2->_d()) || - (TI_PLAIN_SEQUENCE_SMALL == element_identifier_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_2_2->_d() && EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_2_2->seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == element_identifier_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_2_2->_d() && EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_2_2->seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == element_identifier_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_2_2->_d() && EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_2_2->array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == element_identifier_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_2_2->_d() && EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_2_2->array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == element_identifier_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_2_2->_d() && (EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_2_2->map_sdefn().key_identifier()->_d() || EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_2_2->map_sdefn().header().equiv_kind())) || - (TI_PLAIN_MAP_LARGE == element_identifier_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_2_2->_d() && (EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_2_2->map_ldefn().key_identifier()->_d() || EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_2_2->map_ldefn().header().equiv_kind()))) - { - equiv_kind_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_2_2 = EK_COMPLETE; - } - CollectionElementFlag element_flags_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_2_2 = 0; - CollectionElementFlag key_flags_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_2_2 = 0; - PlainCollectionHeader header_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_2_2 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_2_2, element_flags_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_2_2); - std::string type_id_kind_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_2_2("TI_PLAIN_MAP_SMALL"); - if (type_id_kind_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_2_2 == "TI_PLAIN_MAP_SMALL") - { - SBound bound = static_cast(2); - PlainMapSTypeDefn map_sdefn = TypeObjectUtils::build_plain_map_s_type_defn(header_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_2_2, bound, - eprosima::fastcdr::external(element_identifier_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_2_2), key_flags_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_2_2, - eprosima::fastcdr::external(key_identifier_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_2_2)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_s_map_type_identifier(map_sdefn, "anonymous_map_int32_t_anonymous_map_int32_t_int32_t_2_2")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_anonymous_map_int32_t_int32_t_2_2 already registered in TypeObjectRegistry for a different type."); - } - } - else - { - LBound bound = 2; - PlainMapLTypeDefn map_ldefn = TypeObjectUtils::build_plain_map_l_type_defn(header_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_2_2, bound, - eprosima::fastcdr::external(element_identifier_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_2_2), key_flags_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_2_2, - eprosima::fastcdr::external(key_identifier_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_2_2)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_l_map_type_identifier(map_ldefn, "anonymous_map_int32_t_anonymous_map_int32_t_int32_t_2_2")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_anonymous_map_int32_t_int32_t_2_2 already registered in TypeObjectRegistry for a different type."); - } - } - return_code_MapMapStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_map_int32_t_anonymous_map_int32_t_int32_t_2_2", type_ids_MapMapStruct); - if (return_code_MapMapStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_anonymous_map_int32_t_int32_t_2_2: Given Map TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_map_map = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_map_map; - MemberId member_id_my_map_map = 0x00000000; - if (EK_COMPLETE == type_ids_MapMapStruct.type_identifier1()._d() || TK_NONE == type_ids_MapMapStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_MapMapStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapMapStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_MapMapStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapMapStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_MapMapStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapMapStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_MapMapStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapMapStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_MapMapStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_MapMapStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapMapStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_MapMapStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_MapMapStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapMapStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_map_map = TypeObjectUtils::build_common_struct_member(member_id_my_map_map, member_flags_my_map_map, type_ids_MapMapStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_MapMapStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_MapMapStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapMapStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_MapMapStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapMapStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_MapMapStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapMapStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_MapMapStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapMapStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_MapMapStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_MapMapStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapMapStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_MapMapStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_MapMapStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapMapStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_map_map = TypeObjectUtils::build_common_struct_member(member_id_my_map_map, member_flags_my_map_map, type_ids_MapMapStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_map_map member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_map_map = "my_map_map"; - eprosima::fastcdr::optional member_ann_builtin_my_map_map; - ann_custom_MapMapStruct.reset(); - CompleteMemberDetail detail_my_map_map = TypeObjectUtils::build_complete_member_detail(name_my_map_map, member_ann_builtin_my_map_map, ann_custom_MapMapStruct); - CompleteStructMember member_my_map_map = TypeObjectUtils::build_complete_struct_member(common_my_map_map, detail_my_map_map); - TypeObjectUtils::add_complete_struct_member(member_seq_MapMapStruct, member_my_map_map); - } - CompleteStructType struct_type_MapMapStruct = TypeObjectUtils::build_complete_struct_type(struct_flags_MapMapStruct, header_MapMapStruct, member_seq_MapMapStruct); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_MapMapStruct, type_name_MapMapStruct.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MapMapStruct already registered in TypeObjectRegistry for a different type."); - } - return_code_MapMapStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MapMapStruct", type_ids_MapMapStruct); - if (return_code_MapMapStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MapMapStruct: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } -} -void register_MapMapBoundsStruct_type_identifier() -{ - { - StructTypeFlag struct_flags_MapMapBoundsStruct = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_MapMapBoundsStruct; - TypeIdentifierPair type_ids_MapMapBoundsStruct; - QualifiedTypeName type_name_MapMapBoundsStruct = "MapMapBoundsStruct"; - eprosima::fastcdr::optional type_ann_builtin_MapMapBoundsStruct; - eprosima::fastcdr::optional ann_custom_MapMapBoundsStruct; - CompleteTypeDetail detail_MapMapBoundsStruct = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_MapMapBoundsStruct, ann_custom_MapMapBoundsStruct, type_name_MapMapBoundsStruct.to_string()); - CompleteStructHeader header_MapMapBoundsStruct; - header_MapMapBoundsStruct = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_MapMapBoundsStruct); - CompleteStructMemberSeq member_seq_MapMapBoundsStruct; - { - return_code_MapMapBoundsStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_map_int32_t_anonymous_map_int32_t_int32_t_3_3", type_ids_MapMapBoundsStruct); - - if (return_code_MapMapBoundsStruct != eprosima::fastdds::dds::RETCODE_OK) - { - return_code_MapMapBoundsStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_map_int32_t_int32_t_3", type_ids_MapMapBoundsStruct); - - if (return_code_MapMapBoundsStruct != eprosima::fastdds::dds::RETCODE_OK) - { - return_code_MapMapBoundsStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_MapMapBoundsStruct); - - if (return_code_MapMapBoundsStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Map element TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - TypeIdentifier* element_identifier_anonymous_map_int32_t_int32_t_3 {nullptr}; - if (EK_COMPLETE == type_ids_MapMapBoundsStruct.type_identifier1()._d() || TK_NONE == type_ids_MapMapBoundsStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_MapMapBoundsStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapMapBoundsStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_MapMapBoundsStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapMapBoundsStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_MapMapBoundsStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapMapBoundsStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_MapMapBoundsStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapMapBoundsStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_MapMapBoundsStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_MapMapBoundsStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapMapBoundsStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_MapMapBoundsStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_MapMapBoundsStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapMapBoundsStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_map_int32_t_int32_t_3 = new TypeIdentifier(type_ids_MapMapBoundsStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_MapMapBoundsStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_MapMapBoundsStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapMapBoundsStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_MapMapBoundsStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapMapBoundsStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_MapMapBoundsStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapMapBoundsStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_MapMapBoundsStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapMapBoundsStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_MapMapBoundsStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_MapMapBoundsStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapMapBoundsStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_MapMapBoundsStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_MapMapBoundsStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapMapBoundsStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_map_int32_t_int32_t_3 = new TypeIdentifier(type_ids_MapMapBoundsStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_int32_t_3 inconsistent element TypeIdentifier."); - return; - } - return_code_MapMapBoundsStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_MapMapBoundsStruct); - - if (return_code_MapMapBoundsStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Map key TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - TypeIdentifier* key_identifier_anonymous_map_int32_t_int32_t_3 {nullptr}; - if (EK_COMPLETE == type_ids_MapMapBoundsStruct.type_identifier1()._d() || TK_NONE == type_ids_MapMapBoundsStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_MapMapBoundsStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapMapBoundsStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_MapMapBoundsStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapMapBoundsStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_MapMapBoundsStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapMapBoundsStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_MapMapBoundsStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapMapBoundsStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_MapMapBoundsStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_MapMapBoundsStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapMapBoundsStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_MapMapBoundsStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_MapMapBoundsStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapMapBoundsStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - key_identifier_anonymous_map_int32_t_int32_t_3 = new TypeIdentifier(type_ids_MapMapBoundsStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_MapMapBoundsStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_MapMapBoundsStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapMapBoundsStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_MapMapBoundsStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapMapBoundsStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_MapMapBoundsStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapMapBoundsStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_MapMapBoundsStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapMapBoundsStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_MapMapBoundsStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_MapMapBoundsStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapMapBoundsStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_MapMapBoundsStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_MapMapBoundsStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapMapBoundsStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - key_identifier_anonymous_map_int32_t_int32_t_3 = new TypeIdentifier(type_ids_MapMapBoundsStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_int32_t_3 inconsistent key TypeIdentifier."); - return; - } - EquivalenceKind equiv_kind_anonymous_map_int32_t_int32_t_3 = EK_BOTH; - if ((EK_COMPLETE == key_identifier_anonymous_map_int32_t_int32_t_3->_d() || EK_COMPLETE == element_identifier_anonymous_map_int32_t_int32_t_3->_d()) || - (TI_PLAIN_SEQUENCE_SMALL == element_identifier_anonymous_map_int32_t_int32_t_3->_d() && EK_COMPLETE == element_identifier_anonymous_map_int32_t_int32_t_3->seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == element_identifier_anonymous_map_int32_t_int32_t_3->_d() && EK_COMPLETE == element_identifier_anonymous_map_int32_t_int32_t_3->seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == element_identifier_anonymous_map_int32_t_int32_t_3->_d() && EK_COMPLETE == element_identifier_anonymous_map_int32_t_int32_t_3->array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == element_identifier_anonymous_map_int32_t_int32_t_3->_d() && EK_COMPLETE == element_identifier_anonymous_map_int32_t_int32_t_3->array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == element_identifier_anonymous_map_int32_t_int32_t_3->_d() && (EK_COMPLETE == element_identifier_anonymous_map_int32_t_int32_t_3->map_sdefn().key_identifier()->_d() || EK_COMPLETE == element_identifier_anonymous_map_int32_t_int32_t_3->map_sdefn().header().equiv_kind())) || - (TI_PLAIN_MAP_LARGE == element_identifier_anonymous_map_int32_t_int32_t_3->_d() && (EK_COMPLETE == element_identifier_anonymous_map_int32_t_int32_t_3->map_ldefn().key_identifier()->_d() || EK_COMPLETE == element_identifier_anonymous_map_int32_t_int32_t_3->map_ldefn().header().equiv_kind()))) - { - equiv_kind_anonymous_map_int32_t_int32_t_3 = EK_COMPLETE; - } - CollectionElementFlag element_flags_anonymous_map_int32_t_int32_t_3 = 0; - CollectionElementFlag key_flags_anonymous_map_int32_t_int32_t_3 = 0; - PlainCollectionHeader header_anonymous_map_int32_t_int32_t_3 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_map_int32_t_int32_t_3, element_flags_anonymous_map_int32_t_int32_t_3); - std::string type_id_kind_anonymous_map_int32_t_int32_t_3("TI_PLAIN_MAP_SMALL"); - if (type_id_kind_anonymous_map_int32_t_int32_t_3 == "TI_PLAIN_MAP_SMALL") - { - SBound bound = static_cast(3); - PlainMapSTypeDefn map_sdefn = TypeObjectUtils::build_plain_map_s_type_defn(header_anonymous_map_int32_t_int32_t_3, bound, - eprosima::fastcdr::external(element_identifier_anonymous_map_int32_t_int32_t_3), key_flags_anonymous_map_int32_t_int32_t_3, - eprosima::fastcdr::external(key_identifier_anonymous_map_int32_t_int32_t_3)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_s_map_type_identifier(map_sdefn, "anonymous_map_int32_t_int32_t_3")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_int32_t_3 already registered in TypeObjectRegistry for a different type."); - } - } - else - { - LBound bound = 3; - PlainMapLTypeDefn map_ldefn = TypeObjectUtils::build_plain_map_l_type_defn(header_anonymous_map_int32_t_int32_t_3, bound, - eprosima::fastcdr::external(element_identifier_anonymous_map_int32_t_int32_t_3), key_flags_anonymous_map_int32_t_int32_t_3, - eprosima::fastcdr::external(key_identifier_anonymous_map_int32_t_int32_t_3)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_l_map_type_identifier(map_ldefn, "anonymous_map_int32_t_int32_t_3")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_int32_t_3 already registered in TypeObjectRegistry for a different type."); - } - } - return_code_MapMapBoundsStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_map_int32_t_int32_t_3", type_ids_MapMapBoundsStruct); - if (return_code_MapMapBoundsStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_int32_t_3: Given Map TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - TypeIdentifier* element_identifier_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_3_3 {nullptr}; - if (EK_COMPLETE == type_ids_MapMapBoundsStruct.type_identifier1()._d() || TK_NONE == type_ids_MapMapBoundsStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_MapMapBoundsStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapMapBoundsStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_MapMapBoundsStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapMapBoundsStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_MapMapBoundsStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapMapBoundsStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_MapMapBoundsStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapMapBoundsStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_MapMapBoundsStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_MapMapBoundsStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapMapBoundsStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_MapMapBoundsStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_MapMapBoundsStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapMapBoundsStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_3_3 = new TypeIdentifier(type_ids_MapMapBoundsStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_MapMapBoundsStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_MapMapBoundsStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapMapBoundsStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_MapMapBoundsStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapMapBoundsStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_MapMapBoundsStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapMapBoundsStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_MapMapBoundsStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapMapBoundsStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_MapMapBoundsStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_MapMapBoundsStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapMapBoundsStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_MapMapBoundsStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_MapMapBoundsStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapMapBoundsStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - element_identifier_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_3_3 = new TypeIdentifier(type_ids_MapMapBoundsStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_anonymous_map_int32_t_int32_t_3_3 inconsistent element TypeIdentifier."); - return; - } - return_code_MapMapBoundsStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_MapMapBoundsStruct); - - if (return_code_MapMapBoundsStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Map key TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - TypeIdentifier* key_identifier_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_3_3 {nullptr}; - if (EK_COMPLETE == type_ids_MapMapBoundsStruct.type_identifier1()._d() || TK_NONE == type_ids_MapMapBoundsStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_MapMapBoundsStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapMapBoundsStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_MapMapBoundsStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapMapBoundsStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_MapMapBoundsStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapMapBoundsStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_MapMapBoundsStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapMapBoundsStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_MapMapBoundsStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_MapMapBoundsStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapMapBoundsStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_MapMapBoundsStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_MapMapBoundsStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapMapBoundsStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - key_identifier_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_3_3 = new TypeIdentifier(type_ids_MapMapBoundsStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_MapMapBoundsStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_MapMapBoundsStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapMapBoundsStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_MapMapBoundsStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapMapBoundsStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_MapMapBoundsStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapMapBoundsStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_MapMapBoundsStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapMapBoundsStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_MapMapBoundsStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_MapMapBoundsStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapMapBoundsStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_MapMapBoundsStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_MapMapBoundsStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapMapBoundsStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - key_identifier_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_3_3 = new TypeIdentifier(type_ids_MapMapBoundsStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_anonymous_map_int32_t_int32_t_3_3 inconsistent key TypeIdentifier."); - return; - } - EquivalenceKind equiv_kind_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_3_3 = EK_BOTH; - if ((EK_COMPLETE == key_identifier_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_3_3->_d() || EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_3_3->_d()) || - (TI_PLAIN_SEQUENCE_SMALL == element_identifier_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_3_3->_d() && EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_3_3->seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == element_identifier_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_3_3->_d() && EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_3_3->seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == element_identifier_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_3_3->_d() && EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_3_3->array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == element_identifier_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_3_3->_d() && EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_3_3->array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == element_identifier_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_3_3->_d() && (EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_3_3->map_sdefn().key_identifier()->_d() || EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_3_3->map_sdefn().header().equiv_kind())) || - (TI_PLAIN_MAP_LARGE == element_identifier_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_3_3->_d() && (EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_3_3->map_ldefn().key_identifier()->_d() || EK_COMPLETE == element_identifier_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_3_3->map_ldefn().header().equiv_kind()))) - { - equiv_kind_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_3_3 = EK_COMPLETE; - } - CollectionElementFlag element_flags_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_3_3 = 0; - CollectionElementFlag key_flags_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_3_3 = 0; - PlainCollectionHeader header_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_3_3 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_3_3, element_flags_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_3_3); - std::string type_id_kind_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_3_3("TI_PLAIN_MAP_SMALL"); - if (type_id_kind_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_3_3 == "TI_PLAIN_MAP_SMALL") - { - SBound bound = static_cast(3); - PlainMapSTypeDefn map_sdefn = TypeObjectUtils::build_plain_map_s_type_defn(header_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_3_3, bound, - eprosima::fastcdr::external(element_identifier_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_3_3), key_flags_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_3_3, - eprosima::fastcdr::external(key_identifier_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_3_3)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_s_map_type_identifier(map_sdefn, "anonymous_map_int32_t_anonymous_map_int32_t_int32_t_3_3")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_anonymous_map_int32_t_int32_t_3_3 already registered in TypeObjectRegistry for a different type."); - } - } - else - { - LBound bound = 3; - PlainMapLTypeDefn map_ldefn = TypeObjectUtils::build_plain_map_l_type_defn(header_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_3_3, bound, - eprosima::fastcdr::external(element_identifier_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_3_3), key_flags_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_3_3, - eprosima::fastcdr::external(key_identifier_anonymous_map_int32_t_anonymous_map_int32_t_int32_t_3_3)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_l_map_type_identifier(map_ldefn, "anonymous_map_int32_t_anonymous_map_int32_t_int32_t_3_3")) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_anonymous_map_int32_t_int32_t_3_3 already registered in TypeObjectRegistry for a different type."); - } - } - return_code_MapMapBoundsStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_map_int32_t_anonymous_map_int32_t_int32_t_3_3", type_ids_MapMapBoundsStruct); - if (return_code_MapMapBoundsStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_int32_t_anonymous_map_int32_t_int32_t_3_3: Given Map TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_map_map = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_map_map; - MemberId member_id_my_map_map = 0x00000000; - if (EK_COMPLETE == type_ids_MapMapBoundsStruct.type_identifier1()._d() || TK_NONE == type_ids_MapMapBoundsStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_MapMapBoundsStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapMapBoundsStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_MapMapBoundsStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapMapBoundsStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_MapMapBoundsStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapMapBoundsStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_MapMapBoundsStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MapMapBoundsStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_MapMapBoundsStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_MapMapBoundsStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapMapBoundsStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_MapMapBoundsStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_MapMapBoundsStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapMapBoundsStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_map_map = TypeObjectUtils::build_common_struct_member(member_id_my_map_map, member_flags_my_map_map, type_ids_MapMapBoundsStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_MapMapBoundsStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_MapMapBoundsStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapMapBoundsStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_MapMapBoundsStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapMapBoundsStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_MapMapBoundsStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapMapBoundsStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_MapMapBoundsStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MapMapBoundsStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_MapMapBoundsStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_MapMapBoundsStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapMapBoundsStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_MapMapBoundsStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_MapMapBoundsStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MapMapBoundsStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_map_map = TypeObjectUtils::build_common_struct_member(member_id_my_map_map, member_flags_my_map_map, type_ids_MapMapBoundsStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_map_map member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_map_map = "my_map_map"; - eprosima::fastcdr::optional member_ann_builtin_my_map_map; - ann_custom_MapMapBoundsStruct.reset(); - CompleteMemberDetail detail_my_map_map = TypeObjectUtils::build_complete_member_detail(name_my_map_map, member_ann_builtin_my_map_map, ann_custom_MapMapBoundsStruct); - CompleteStructMember member_my_map_map = TypeObjectUtils::build_complete_struct_member(common_my_map_map, detail_my_map_map); - TypeObjectUtils::add_complete_struct_member(member_seq_MapMapBoundsStruct, member_my_map_map); - } - CompleteStructType struct_type_MapMapBoundsStruct = TypeObjectUtils::build_complete_struct_type(struct_flags_MapMapBoundsStruct, header_MapMapBoundsStruct, member_seq_MapMapBoundsStruct); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_MapMapBoundsStruct, type_name_MapMapBoundsStruct.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MapMapBoundsStruct already registered in TypeObjectRegistry for a different type."); - } - return_code_MapMapBoundsStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MapMapBoundsStruct", type_ids_MapMapBoundsStruct); - if (return_code_MapMapBoundsStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MapMapBoundsStruct: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } -} -void register_SimpleUnion_type_identifier() -{ - { - ReturnCode_t return_code_SimpleUnion; - TypeIdentifierPair type_ids_SimpleUnion; - UnionTypeFlag union_flags_SimpleUnion = TypeObjectUtils::build_union_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - QualifiedTypeName type_name_SimpleUnion = "SimpleUnion"; - eprosima::fastcdr::optional type_ann_builtin_SimpleUnion; - eprosima::fastcdr::optional ann_custom_SimpleUnion; - CompleteTypeDetail detail_SimpleUnion = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_SimpleUnion, ann_custom_SimpleUnion, type_name_SimpleUnion.to_string()); - CompleteUnionHeader header_SimpleUnion = TypeObjectUtils::build_complete_union_header(detail_SimpleUnion); - UnionDiscriminatorFlag member_flags_SimpleUnion = TypeObjectUtils::build_union_discriminator_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false); - return_code_SimpleUnion = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_SimpleUnion); - - if (return_code_SimpleUnion != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Union discriminator TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - CommonDiscriminatorMember common_SimpleUnion; - if (EK_COMPLETE == type_ids_SimpleUnion.type_identifier1()._d() || TK_NONE == type_ids_SimpleUnion.type_identifier2()._d()) - { - common_SimpleUnion = TypeObjectUtils::build_common_discriminator_member(member_flags_SimpleUnion, type_ids_SimpleUnion.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_SimpleUnion.type_identifier2()._d()) - { - common_SimpleUnion = TypeObjectUtils::build_common_discriminator_member(member_flags_SimpleUnion, type_ids_SimpleUnion.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "SimpleUnion discriminator TypeIdentifier inconsistent."); - return; - } - type_ann_builtin_SimpleUnion.reset(); - ann_custom_SimpleUnion.reset(); - CompleteDiscriminatorMember discriminator_SimpleUnion = TypeObjectUtils::build_complete_discriminator_member(common_SimpleUnion, - type_ann_builtin_SimpleUnion, ann_custom_SimpleUnion); - CompleteUnionMemberSeq member_seq_SimpleUnion; - { - return_code_SimpleUnion = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_SimpleUnion); - - if (return_code_SimpleUnion != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "first Union member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - UnionMemberFlag member_flags_first = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false); - UnionCaseLabelSeq label_seq_first; - TypeObjectUtils::add_union_case_label(label_seq_first, static_cast(0)); - CommonUnionMember common_first; - MemberId member_id_first = 0x00000001; - if (EK_COMPLETE == type_ids_SimpleUnion.type_identifier1()._d() || TK_NONE == type_ids_SimpleUnion.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SimpleUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SimpleUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SimpleUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SimpleUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SimpleUnion.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SimpleUnion.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_first = TypeObjectUtils::build_common_union_member(member_id_first, member_flags_first, type_ids_SimpleUnion.type_identifier1(), - label_seq_first); - } - else if (EK_COMPLETE == type_ids_SimpleUnion.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SimpleUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SimpleUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SimpleUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SimpleUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SimpleUnion.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SimpleUnion.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_first = TypeObjectUtils::build_common_union_member(member_id_first, member_flags_first, type_ids_SimpleUnion.type_identifier2(), - label_seq_first); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Union first member TypeIdentifier inconsistent."); - return; - } - MemberName name_first = "first"; - eprosima::fastcdr::optional member_ann_builtin_first; - ann_custom_SimpleUnion.reset(); - CompleteMemberDetail detail_first = TypeObjectUtils::build_complete_member_detail(name_first, member_ann_builtin_first, ann_custom_SimpleUnion); - CompleteUnionMember member_first = TypeObjectUtils::build_complete_union_member(common_first, detail_first); - TypeObjectUtils::add_complete_union_member(member_seq_SimpleUnion, member_first); - } - { - return_code_SimpleUnion = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int64_t", type_ids_SimpleUnion); - - if (return_code_SimpleUnion != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "second Union member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - UnionMemberFlag member_flags_second = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false); - UnionCaseLabelSeq label_seq_second; - TypeObjectUtils::add_union_case_label(label_seq_second, static_cast(1)); - CommonUnionMember common_second; - MemberId member_id_second = 0x00000002; - if (EK_COMPLETE == type_ids_SimpleUnion.type_identifier1()._d() || TK_NONE == type_ids_SimpleUnion.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SimpleUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SimpleUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SimpleUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SimpleUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SimpleUnion.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SimpleUnion.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_second = TypeObjectUtils::build_common_union_member(member_id_second, member_flags_second, type_ids_SimpleUnion.type_identifier1(), - label_seq_second); - } - else if (EK_COMPLETE == type_ids_SimpleUnion.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SimpleUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SimpleUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SimpleUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SimpleUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SimpleUnion.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SimpleUnion.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_second = TypeObjectUtils::build_common_union_member(member_id_second, member_flags_second, type_ids_SimpleUnion.type_identifier2(), - label_seq_second); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Union second member TypeIdentifier inconsistent."); - return; - } - MemberName name_second = "second"; - eprosima::fastcdr::optional member_ann_builtin_second; - ann_custom_SimpleUnion.reset(); - CompleteMemberDetail detail_second = TypeObjectUtils::build_complete_member_detail(name_second, member_ann_builtin_second, ann_custom_SimpleUnion); - CompleteUnionMember member_second = TypeObjectUtils::build_complete_union_member(common_second, detail_second); - TypeObjectUtils::add_complete_union_member(member_seq_SimpleUnion, member_second); - } - CompleteUnionType union_type_SimpleUnion = TypeObjectUtils::build_complete_union_type(union_flags_SimpleUnion, header_SimpleUnion, discriminator_SimpleUnion, - member_seq_SimpleUnion); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_union_type_object(union_type_SimpleUnion, type_name_SimpleUnion.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "SimpleUnion already registered in TypeObjectRegistry for a different type."); - } - return_code_SimpleUnion = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "SimpleUnion", type_ids_SimpleUnion); - if (return_code_SimpleUnion != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "SimpleUnion: Given Union TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } -} -void register_SimpleUnionNames_type_identifier() -{ - { - ReturnCode_t return_code_SimpleUnionNames; - TypeIdentifierPair type_ids_SimpleUnionNames; - UnionTypeFlag union_flags_SimpleUnionNames = TypeObjectUtils::build_union_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - QualifiedTypeName type_name_SimpleUnionNames = "SimpleUnionNames"; - eprosima::fastcdr::optional type_ann_builtin_SimpleUnionNames; - eprosima::fastcdr::optional ann_custom_SimpleUnionNames; - CompleteTypeDetail detail_SimpleUnionNames = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_SimpleUnionNames, ann_custom_SimpleUnionNames, type_name_SimpleUnionNames.to_string()); - CompleteUnionHeader header_SimpleUnionNames = TypeObjectUtils::build_complete_union_header(detail_SimpleUnionNames); - UnionDiscriminatorFlag member_flags_SimpleUnionNames = TypeObjectUtils::build_union_discriminator_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false); - return_code_SimpleUnionNames = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_SimpleUnionNames); - - if (return_code_SimpleUnionNames != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Union discriminator TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - CommonDiscriminatorMember common_SimpleUnionNames; - if (EK_COMPLETE == type_ids_SimpleUnionNames.type_identifier1()._d() || TK_NONE == type_ids_SimpleUnionNames.type_identifier2()._d()) - { - common_SimpleUnionNames = TypeObjectUtils::build_common_discriminator_member(member_flags_SimpleUnionNames, type_ids_SimpleUnionNames.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_SimpleUnionNames.type_identifier2()._d()) - { - common_SimpleUnionNames = TypeObjectUtils::build_common_discriminator_member(member_flags_SimpleUnionNames, type_ids_SimpleUnionNames.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "SimpleUnionNames discriminator TypeIdentifier inconsistent."); - return; - } - type_ann_builtin_SimpleUnionNames.reset(); - ann_custom_SimpleUnionNames.reset(); - CompleteDiscriminatorMember discriminator_SimpleUnionNames = TypeObjectUtils::build_complete_discriminator_member(common_SimpleUnionNames, - type_ann_builtin_SimpleUnionNames, ann_custom_SimpleUnionNames); - CompleteUnionMemberSeq member_seq_SimpleUnionNames; - { - return_code_SimpleUnionNames = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_SimpleUnionNames); - - if (return_code_SimpleUnionNames != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "first_case Union member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - UnionMemberFlag member_flags_first_case = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false); - UnionCaseLabelSeq label_seq_first_case; - TypeObjectUtils::add_union_case_label(label_seq_first_case, static_cast(0)); - CommonUnionMember common_first_case; - MemberId member_id_first_case = 0x00000001; - if (EK_COMPLETE == type_ids_SimpleUnionNames.type_identifier1()._d() || TK_NONE == type_ids_SimpleUnionNames.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SimpleUnionNames.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleUnionNames.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SimpleUnionNames.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleUnionNames.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SimpleUnionNames.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleUnionNames.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SimpleUnionNames.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleUnionNames.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SimpleUnionNames.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SimpleUnionNames.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleUnionNames.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SimpleUnionNames.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SimpleUnionNames.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleUnionNames.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_first_case = TypeObjectUtils::build_common_union_member(member_id_first_case, member_flags_first_case, type_ids_SimpleUnionNames.type_identifier1(), - label_seq_first_case); - } - else if (EK_COMPLETE == type_ids_SimpleUnionNames.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SimpleUnionNames.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleUnionNames.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SimpleUnionNames.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleUnionNames.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SimpleUnionNames.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleUnionNames.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SimpleUnionNames.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleUnionNames.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SimpleUnionNames.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SimpleUnionNames.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleUnionNames.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SimpleUnionNames.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SimpleUnionNames.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleUnionNames.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_first_case = TypeObjectUtils::build_common_union_member(member_id_first_case, member_flags_first_case, type_ids_SimpleUnionNames.type_identifier2(), - label_seq_first_case); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Union first_case member TypeIdentifier inconsistent."); - return; - } - MemberName name_first_case = "first_case"; - eprosima::fastcdr::optional member_ann_builtin_first_case; - ann_custom_SimpleUnionNames.reset(); - CompleteMemberDetail detail_first_case = TypeObjectUtils::build_complete_member_detail(name_first_case, member_ann_builtin_first_case, ann_custom_SimpleUnionNames); - CompleteUnionMember member_first_case = TypeObjectUtils::build_complete_union_member(common_first_case, detail_first_case); - TypeObjectUtils::add_complete_union_member(member_seq_SimpleUnionNames, member_first_case); - } - { - return_code_SimpleUnionNames = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int64_t", type_ids_SimpleUnionNames); - - if (return_code_SimpleUnionNames != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "second_case Union member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - UnionMemberFlag member_flags_second_case = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false); - UnionCaseLabelSeq label_seq_second_case; - TypeObjectUtils::add_union_case_label(label_seq_second_case, static_cast(1)); - CommonUnionMember common_second_case; - MemberId member_id_second_case = 0x00000002; - if (EK_COMPLETE == type_ids_SimpleUnionNames.type_identifier1()._d() || TK_NONE == type_ids_SimpleUnionNames.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SimpleUnionNames.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleUnionNames.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SimpleUnionNames.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleUnionNames.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SimpleUnionNames.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleUnionNames.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SimpleUnionNames.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleUnionNames.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SimpleUnionNames.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SimpleUnionNames.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleUnionNames.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SimpleUnionNames.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SimpleUnionNames.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleUnionNames.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_second_case = TypeObjectUtils::build_common_union_member(member_id_second_case, member_flags_second_case, type_ids_SimpleUnionNames.type_identifier1(), - label_seq_second_case); - } - else if (EK_COMPLETE == type_ids_SimpleUnionNames.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SimpleUnionNames.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleUnionNames.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SimpleUnionNames.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleUnionNames.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SimpleUnionNames.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleUnionNames.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SimpleUnionNames.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleUnionNames.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SimpleUnionNames.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SimpleUnionNames.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleUnionNames.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SimpleUnionNames.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SimpleUnionNames.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleUnionNames.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_second_case = TypeObjectUtils::build_common_union_member(member_id_second_case, member_flags_second_case, type_ids_SimpleUnionNames.type_identifier2(), - label_seq_second_case); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Union second_case member TypeIdentifier inconsistent."); - return; - } - MemberName name_second_case = "second_case"; - eprosima::fastcdr::optional member_ann_builtin_second_case; - ann_custom_SimpleUnionNames.reset(); - CompleteMemberDetail detail_second_case = TypeObjectUtils::build_complete_member_detail(name_second_case, member_ann_builtin_second_case, ann_custom_SimpleUnionNames); - CompleteUnionMember member_second_case = TypeObjectUtils::build_complete_union_member(common_second_case, detail_second_case); - TypeObjectUtils::add_complete_union_member(member_seq_SimpleUnionNames, member_second_case); - } - CompleteUnionType union_type_SimpleUnionNames = TypeObjectUtils::build_complete_union_type(union_flags_SimpleUnionNames, header_SimpleUnionNames, discriminator_SimpleUnionNames, - member_seq_SimpleUnionNames); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_union_type_object(union_type_SimpleUnionNames, type_name_SimpleUnionNames.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "SimpleUnionNames already registered in TypeObjectRegistry for a different type."); - } - return_code_SimpleUnionNames = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "SimpleUnionNames", type_ids_SimpleUnionNames); - if (return_code_SimpleUnionNames != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "SimpleUnionNames: Given Union TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } -} -void register_SimpleTypeUnion_type_identifier() -{ - { - ReturnCode_t return_code_SimpleTypeUnion; - TypeIdentifierPair type_ids_SimpleTypeUnion; - UnionTypeFlag union_flags_SimpleTypeUnion = TypeObjectUtils::build_union_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - QualifiedTypeName type_name_SimpleTypeUnion = "SimpleTypeUnion"; - eprosima::fastcdr::optional type_ann_builtin_SimpleTypeUnion; - eprosima::fastcdr::optional ann_custom_SimpleTypeUnion; - CompleteTypeDetail detail_SimpleTypeUnion = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_SimpleTypeUnion, ann_custom_SimpleTypeUnion, type_name_SimpleTypeUnion.to_string()); - CompleteUnionHeader header_SimpleTypeUnion = TypeObjectUtils::build_complete_union_header(detail_SimpleTypeUnion); - UnionDiscriminatorFlag member_flags_SimpleTypeUnion = TypeObjectUtils::build_union_discriminator_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false); - return_code_SimpleTypeUnion = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_SimpleTypeUnion); - - if (return_code_SimpleTypeUnion != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Union discriminator TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - CommonDiscriminatorMember common_SimpleTypeUnion; - if (EK_COMPLETE == type_ids_SimpleTypeUnion.type_identifier1()._d() || TK_NONE == type_ids_SimpleTypeUnion.type_identifier2()._d()) - { - common_SimpleTypeUnion = TypeObjectUtils::build_common_discriminator_member(member_flags_SimpleTypeUnion, type_ids_SimpleTypeUnion.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_SimpleTypeUnion.type_identifier2()._d()) - { - common_SimpleTypeUnion = TypeObjectUtils::build_common_discriminator_member(member_flags_SimpleTypeUnion, type_ids_SimpleTypeUnion.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "SimpleTypeUnion discriminator TypeIdentifier inconsistent."); - return; - } - type_ann_builtin_SimpleTypeUnion.reset(); - ann_custom_SimpleTypeUnion.reset(); - CompleteDiscriminatorMember discriminator_SimpleTypeUnion = TypeObjectUtils::build_complete_discriminator_member(common_SimpleTypeUnion, - type_ann_builtin_SimpleTypeUnion, ann_custom_SimpleTypeUnion); - CompleteUnionMemberSeq member_seq_SimpleTypeUnion; - { - return_code_SimpleTypeUnion = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_byte", type_ids_SimpleTypeUnion); - - if (return_code_SimpleTypeUnion != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "first Union member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - UnionMemberFlag member_flags_first = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false); - UnionCaseLabelSeq label_seq_first; - TypeObjectUtils::add_union_case_label(label_seq_first, static_cast(0)); - CommonUnionMember common_first; - MemberId member_id_first = 0x00000001; - if (EK_COMPLETE == type_ids_SimpleTypeUnion.type_identifier1()._d() || TK_NONE == type_ids_SimpleTypeUnion.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SimpleTypeUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleTypeUnion.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SimpleTypeUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleTypeUnion.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SimpleTypeUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleTypeUnion.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SimpleTypeUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleTypeUnion.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SimpleTypeUnion.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SimpleTypeUnion.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleTypeUnion.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SimpleTypeUnion.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SimpleTypeUnion.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleTypeUnion.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_first = TypeObjectUtils::build_common_union_member(member_id_first, member_flags_first, type_ids_SimpleTypeUnion.type_identifier1(), - label_seq_first); - } - else if (EK_COMPLETE == type_ids_SimpleTypeUnion.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SimpleTypeUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleTypeUnion.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SimpleTypeUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleTypeUnion.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SimpleTypeUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleTypeUnion.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SimpleTypeUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleTypeUnion.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SimpleTypeUnion.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SimpleTypeUnion.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleTypeUnion.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SimpleTypeUnion.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SimpleTypeUnion.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleTypeUnion.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_first = TypeObjectUtils::build_common_union_member(member_id_first, member_flags_first, type_ids_SimpleTypeUnion.type_identifier2(), - label_seq_first); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Union first member TypeIdentifier inconsistent."); - return; - } - MemberName name_first = "first"; - eprosima::fastcdr::optional member_ann_builtin_first; - ann_custom_SimpleTypeUnion.reset(); - CompleteMemberDetail detail_first = TypeObjectUtils::build_complete_member_detail(name_first, member_ann_builtin_first, ann_custom_SimpleTypeUnion); - CompleteUnionMember member_first = TypeObjectUtils::build_complete_union_member(common_first, detail_first); - TypeObjectUtils::add_complete_union_member(member_seq_SimpleTypeUnion, member_first); - } - { - return_code_SimpleTypeUnion = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int64_t", type_ids_SimpleTypeUnion); - - if (return_code_SimpleTypeUnion != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "second Union member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - UnionMemberFlag member_flags_second = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false); - UnionCaseLabelSeq label_seq_second; - TypeObjectUtils::add_union_case_label(label_seq_second, static_cast(1)); - CommonUnionMember common_second; - MemberId member_id_second = 0x00000002; - if (EK_COMPLETE == type_ids_SimpleTypeUnion.type_identifier1()._d() || TK_NONE == type_ids_SimpleTypeUnion.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SimpleTypeUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleTypeUnion.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SimpleTypeUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleTypeUnion.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SimpleTypeUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleTypeUnion.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SimpleTypeUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleTypeUnion.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SimpleTypeUnion.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SimpleTypeUnion.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleTypeUnion.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SimpleTypeUnion.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SimpleTypeUnion.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleTypeUnion.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_second = TypeObjectUtils::build_common_union_member(member_id_second, member_flags_second, type_ids_SimpleTypeUnion.type_identifier1(), - label_seq_second); - } - else if (EK_COMPLETE == type_ids_SimpleTypeUnion.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SimpleTypeUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleTypeUnion.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SimpleTypeUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleTypeUnion.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SimpleTypeUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleTypeUnion.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SimpleTypeUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleTypeUnion.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SimpleTypeUnion.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SimpleTypeUnion.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleTypeUnion.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SimpleTypeUnion.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SimpleTypeUnion.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleTypeUnion.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_second = TypeObjectUtils::build_common_union_member(member_id_second, member_flags_second, type_ids_SimpleTypeUnion.type_identifier2(), - label_seq_second); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Union second member TypeIdentifier inconsistent."); - return; - } - MemberName name_second = "second"; - eprosima::fastcdr::optional member_ann_builtin_second; - ann_custom_SimpleTypeUnion.reset(); - CompleteMemberDetail detail_second = TypeObjectUtils::build_complete_member_detail(name_second, member_ann_builtin_second, ann_custom_SimpleTypeUnion); - CompleteUnionMember member_second = TypeObjectUtils::build_complete_union_member(common_second, detail_second); - TypeObjectUtils::add_complete_union_member(member_seq_SimpleTypeUnion, member_second); - } - CompleteUnionType union_type_SimpleTypeUnion = TypeObjectUtils::build_complete_union_type(union_flags_SimpleTypeUnion, header_SimpleTypeUnion, discriminator_SimpleTypeUnion, - member_seq_SimpleTypeUnion); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_union_type_object(union_type_SimpleTypeUnion, type_name_SimpleTypeUnion.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "SimpleTypeUnion already registered in TypeObjectRegistry for a different type."); - } - return_code_SimpleTypeUnion = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "SimpleTypeUnion", type_ids_SimpleTypeUnion); - if (return_code_SimpleTypeUnion != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "SimpleTypeUnion: Given Union TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } -} -void register_SimpleBadUnion_type_identifier() -{ - { - ReturnCode_t return_code_SimpleBadUnion; - TypeIdentifierPair type_ids_SimpleBadUnion; - UnionTypeFlag union_flags_SimpleBadUnion = TypeObjectUtils::build_union_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - QualifiedTypeName type_name_SimpleBadUnion = "SimpleBadUnion"; - eprosima::fastcdr::optional type_ann_builtin_SimpleBadUnion; - eprosima::fastcdr::optional ann_custom_SimpleBadUnion; - CompleteTypeDetail detail_SimpleBadUnion = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_SimpleBadUnion, ann_custom_SimpleBadUnion, type_name_SimpleBadUnion.to_string()); - CompleteUnionHeader header_SimpleBadUnion = TypeObjectUtils::build_complete_union_header(detail_SimpleBadUnion); - UnionDiscriminatorFlag member_flags_SimpleBadUnion = TypeObjectUtils::build_union_discriminator_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false); - return_code_SimpleBadUnion = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_SimpleBadUnion); - - if (return_code_SimpleBadUnion != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Union discriminator TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - CommonDiscriminatorMember common_SimpleBadUnion; - if (EK_COMPLETE == type_ids_SimpleBadUnion.type_identifier1()._d() || TK_NONE == type_ids_SimpleBadUnion.type_identifier2()._d()) - { - common_SimpleBadUnion = TypeObjectUtils::build_common_discriminator_member(member_flags_SimpleBadUnion, type_ids_SimpleBadUnion.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_SimpleBadUnion.type_identifier2()._d()) - { - common_SimpleBadUnion = TypeObjectUtils::build_common_discriminator_member(member_flags_SimpleBadUnion, type_ids_SimpleBadUnion.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "SimpleBadUnion discriminator TypeIdentifier inconsistent."); - return; - } - type_ann_builtin_SimpleBadUnion.reset(); - ann_custom_SimpleBadUnion.reset(); - CompleteDiscriminatorMember discriminator_SimpleBadUnion = TypeObjectUtils::build_complete_discriminator_member(common_SimpleBadUnion, - type_ann_builtin_SimpleBadUnion, ann_custom_SimpleBadUnion); - CompleteUnionMemberSeq member_seq_SimpleBadUnion; - { - return_code_SimpleBadUnion = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_SimpleBadUnion); - - if (return_code_SimpleBadUnion != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "first Union member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - UnionMemberFlag member_flags_first = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false); - UnionCaseLabelSeq label_seq_first; - TypeObjectUtils::add_union_case_label(label_seq_first, static_cast(0)); - CommonUnionMember common_first; - MemberId member_id_first = 0x00000001; - if (EK_COMPLETE == type_ids_SimpleBadUnion.type_identifier1()._d() || TK_NONE == type_ids_SimpleBadUnion.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SimpleBadUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleBadUnion.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SimpleBadUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleBadUnion.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SimpleBadUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleBadUnion.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SimpleBadUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleBadUnion.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SimpleBadUnion.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SimpleBadUnion.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleBadUnion.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SimpleBadUnion.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SimpleBadUnion.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleBadUnion.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_first = TypeObjectUtils::build_common_union_member(member_id_first, member_flags_first, type_ids_SimpleBadUnion.type_identifier1(), - label_seq_first); - } - else if (EK_COMPLETE == type_ids_SimpleBadUnion.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SimpleBadUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleBadUnion.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SimpleBadUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleBadUnion.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SimpleBadUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleBadUnion.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SimpleBadUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleBadUnion.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SimpleBadUnion.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SimpleBadUnion.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleBadUnion.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SimpleBadUnion.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SimpleBadUnion.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleBadUnion.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_first = TypeObjectUtils::build_common_union_member(member_id_first, member_flags_first, type_ids_SimpleBadUnion.type_identifier2(), - label_seq_first); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Union first member TypeIdentifier inconsistent."); - return; - } - MemberName name_first = "first"; - eprosima::fastcdr::optional member_ann_builtin_first; - ann_custom_SimpleBadUnion.reset(); - CompleteMemberDetail detail_first = TypeObjectUtils::build_complete_member_detail(name_first, member_ann_builtin_first, ann_custom_SimpleBadUnion); - CompleteUnionMember member_first = TypeObjectUtils::build_complete_union_member(common_first, detail_first); - TypeObjectUtils::add_complete_union_member(member_seq_SimpleBadUnion, member_first); - } - { - return_code_SimpleBadUnion = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int64_t", type_ids_SimpleBadUnion); - - if (return_code_SimpleBadUnion != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "second Union member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - UnionMemberFlag member_flags_second = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false); - UnionCaseLabelSeq label_seq_second; - TypeObjectUtils::add_union_case_label(label_seq_second, static_cast(2)); - CommonUnionMember common_second; - MemberId member_id_second = 0x00000002; - if (EK_COMPLETE == type_ids_SimpleBadUnion.type_identifier1()._d() || TK_NONE == type_ids_SimpleBadUnion.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SimpleBadUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleBadUnion.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SimpleBadUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleBadUnion.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SimpleBadUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleBadUnion.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SimpleBadUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleBadUnion.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SimpleBadUnion.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SimpleBadUnion.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleBadUnion.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SimpleBadUnion.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SimpleBadUnion.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleBadUnion.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_second = TypeObjectUtils::build_common_union_member(member_id_second, member_flags_second, type_ids_SimpleBadUnion.type_identifier1(), - label_seq_second); - } - else if (EK_COMPLETE == type_ids_SimpleBadUnion.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SimpleBadUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleBadUnion.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SimpleBadUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleBadUnion.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SimpleBadUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleBadUnion.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SimpleBadUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleBadUnion.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SimpleBadUnion.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SimpleBadUnion.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleBadUnion.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SimpleBadUnion.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SimpleBadUnion.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleBadUnion.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_second = TypeObjectUtils::build_common_union_member(member_id_second, member_flags_second, type_ids_SimpleBadUnion.type_identifier2(), - label_seq_second); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Union second member TypeIdentifier inconsistent."); - return; - } - MemberName name_second = "second"; - eprosima::fastcdr::optional member_ann_builtin_second; - ann_custom_SimpleBadUnion.reset(); - CompleteMemberDetail detail_second = TypeObjectUtils::build_complete_member_detail(name_second, member_ann_builtin_second, ann_custom_SimpleBadUnion); - CompleteUnionMember member_second = TypeObjectUtils::build_complete_union_member(common_second, detail_second); - TypeObjectUtils::add_complete_union_member(member_seq_SimpleBadUnion, member_second); - } - CompleteUnionType union_type_SimpleBadUnion = TypeObjectUtils::build_complete_union_type(union_flags_SimpleBadUnion, header_SimpleBadUnion, discriminator_SimpleBadUnion, - member_seq_SimpleBadUnion); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_union_type_object(union_type_SimpleBadUnion, type_name_SimpleBadUnion.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "SimpleBadUnion already registered in TypeObjectRegistry for a different type."); - } - return_code_SimpleBadUnion = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "SimpleBadUnion", type_ids_SimpleBadUnion); - if (return_code_SimpleBadUnion != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "SimpleBadUnion: Given Union TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } -} -void register_SimpleBadDiscUnion_type_identifier() -{ - { - ReturnCode_t return_code_SimpleBadDiscUnion; - TypeIdentifierPair type_ids_SimpleBadDiscUnion; - UnionTypeFlag union_flags_SimpleBadDiscUnion = TypeObjectUtils::build_union_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - QualifiedTypeName type_name_SimpleBadDiscUnion = "SimpleBadDiscUnion"; - eprosima::fastcdr::optional type_ann_builtin_SimpleBadDiscUnion; - eprosima::fastcdr::optional ann_custom_SimpleBadDiscUnion; - CompleteTypeDetail detail_SimpleBadDiscUnion = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_SimpleBadDiscUnion, ann_custom_SimpleBadDiscUnion, type_name_SimpleBadDiscUnion.to_string()); - CompleteUnionHeader header_SimpleBadDiscUnion = TypeObjectUtils::build_complete_union_header(detail_SimpleBadDiscUnion); - UnionDiscriminatorFlag member_flags_SimpleBadDiscUnion = TypeObjectUtils::build_union_discriminator_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false); - return_code_SimpleBadDiscUnion = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_byte", type_ids_SimpleBadDiscUnion); - - if (return_code_SimpleBadDiscUnion != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Union discriminator TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - CommonDiscriminatorMember common_SimpleBadDiscUnion; - if (EK_COMPLETE == type_ids_SimpleBadDiscUnion.type_identifier1()._d() || TK_NONE == type_ids_SimpleBadDiscUnion.type_identifier2()._d()) - { - common_SimpleBadDiscUnion = TypeObjectUtils::build_common_discriminator_member(member_flags_SimpleBadDiscUnion, type_ids_SimpleBadDiscUnion.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_SimpleBadDiscUnion.type_identifier2()._d()) - { - common_SimpleBadDiscUnion = TypeObjectUtils::build_common_discriminator_member(member_flags_SimpleBadDiscUnion, type_ids_SimpleBadDiscUnion.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "SimpleBadDiscUnion discriminator TypeIdentifier inconsistent."); - return; - } - type_ann_builtin_SimpleBadDiscUnion.reset(); - ann_custom_SimpleBadDiscUnion.reset(); - CompleteDiscriminatorMember discriminator_SimpleBadDiscUnion = TypeObjectUtils::build_complete_discriminator_member(common_SimpleBadDiscUnion, - type_ann_builtin_SimpleBadDiscUnion, ann_custom_SimpleBadDiscUnion); - CompleteUnionMemberSeq member_seq_SimpleBadDiscUnion; - { - return_code_SimpleBadDiscUnion = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_SimpleBadDiscUnion); - - if (return_code_SimpleBadDiscUnion != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "first Union member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - UnionMemberFlag member_flags_first = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false); - UnionCaseLabelSeq label_seq_first; - TypeObjectUtils::add_union_case_label(label_seq_first, static_cast(0)); - CommonUnionMember common_first; - MemberId member_id_first = 0x00000001; - if (EK_COMPLETE == type_ids_SimpleBadDiscUnion.type_identifier1()._d() || TK_NONE == type_ids_SimpleBadDiscUnion.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SimpleBadDiscUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleBadDiscUnion.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SimpleBadDiscUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleBadDiscUnion.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SimpleBadDiscUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleBadDiscUnion.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SimpleBadDiscUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleBadDiscUnion.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SimpleBadDiscUnion.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SimpleBadDiscUnion.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleBadDiscUnion.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SimpleBadDiscUnion.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SimpleBadDiscUnion.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleBadDiscUnion.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_first = TypeObjectUtils::build_common_union_member(member_id_first, member_flags_first, type_ids_SimpleBadDiscUnion.type_identifier1(), - label_seq_first); - } - else if (EK_COMPLETE == type_ids_SimpleBadDiscUnion.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SimpleBadDiscUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleBadDiscUnion.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SimpleBadDiscUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleBadDiscUnion.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SimpleBadDiscUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleBadDiscUnion.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SimpleBadDiscUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleBadDiscUnion.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SimpleBadDiscUnion.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SimpleBadDiscUnion.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleBadDiscUnion.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SimpleBadDiscUnion.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SimpleBadDiscUnion.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleBadDiscUnion.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_first = TypeObjectUtils::build_common_union_member(member_id_first, member_flags_first, type_ids_SimpleBadDiscUnion.type_identifier2(), - label_seq_first); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Union first member TypeIdentifier inconsistent."); - return; - } - MemberName name_first = "first"; - eprosima::fastcdr::optional member_ann_builtin_first; - ann_custom_SimpleBadDiscUnion.reset(); - CompleteMemberDetail detail_first = TypeObjectUtils::build_complete_member_detail(name_first, member_ann_builtin_first, ann_custom_SimpleBadDiscUnion); - CompleteUnionMember member_first = TypeObjectUtils::build_complete_union_member(common_first, detail_first); - TypeObjectUtils::add_complete_union_member(member_seq_SimpleBadDiscUnion, member_first); - } - { - return_code_SimpleBadDiscUnion = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int64_t", type_ids_SimpleBadDiscUnion); - - if (return_code_SimpleBadDiscUnion != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "second Union member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - UnionMemberFlag member_flags_second = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false); - UnionCaseLabelSeq label_seq_second; - TypeObjectUtils::add_union_case_label(label_seq_second, static_cast(1)); - CommonUnionMember common_second; - MemberId member_id_second = 0x00000002; - if (EK_COMPLETE == type_ids_SimpleBadDiscUnion.type_identifier1()._d() || TK_NONE == type_ids_SimpleBadDiscUnion.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SimpleBadDiscUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleBadDiscUnion.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SimpleBadDiscUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleBadDiscUnion.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SimpleBadDiscUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleBadDiscUnion.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SimpleBadDiscUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleBadDiscUnion.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SimpleBadDiscUnion.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SimpleBadDiscUnion.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleBadDiscUnion.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SimpleBadDiscUnion.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SimpleBadDiscUnion.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleBadDiscUnion.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_second = TypeObjectUtils::build_common_union_member(member_id_second, member_flags_second, type_ids_SimpleBadDiscUnion.type_identifier1(), - label_seq_second); - } - else if (EK_COMPLETE == type_ids_SimpleBadDiscUnion.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SimpleBadDiscUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleBadDiscUnion.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SimpleBadDiscUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleBadDiscUnion.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SimpleBadDiscUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleBadDiscUnion.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SimpleBadDiscUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleBadDiscUnion.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SimpleBadDiscUnion.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SimpleBadDiscUnion.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleBadDiscUnion.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SimpleBadDiscUnion.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SimpleBadDiscUnion.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleBadDiscUnion.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_second = TypeObjectUtils::build_common_union_member(member_id_second, member_flags_second, type_ids_SimpleBadDiscUnion.type_identifier2(), - label_seq_second); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Union second member TypeIdentifier inconsistent."); - return; - } - MemberName name_second = "second"; - eprosima::fastcdr::optional member_ann_builtin_second; - ann_custom_SimpleBadDiscUnion.reset(); - CompleteMemberDetail detail_second = TypeObjectUtils::build_complete_member_detail(name_second, member_ann_builtin_second, ann_custom_SimpleBadDiscUnion); - CompleteUnionMember member_second = TypeObjectUtils::build_complete_union_member(common_second, detail_second); - TypeObjectUtils::add_complete_union_member(member_seq_SimpleBadDiscUnion, member_second); - } - CompleteUnionType union_type_SimpleBadDiscUnion = TypeObjectUtils::build_complete_union_type(union_flags_SimpleBadDiscUnion, header_SimpleBadDiscUnion, discriminator_SimpleBadDiscUnion, - member_seq_SimpleBadDiscUnion); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_union_type_object(union_type_SimpleBadDiscUnion, type_name_SimpleBadDiscUnion.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "SimpleBadDiscUnion already registered in TypeObjectRegistry for a different type."); - } - return_code_SimpleBadDiscUnion = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "SimpleBadDiscUnion", type_ids_SimpleBadDiscUnion); - if (return_code_SimpleBadDiscUnion != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "SimpleBadDiscUnion: Given Union TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } -} -void register_SimpleUnionStruct_type_identifier() -{ - { - StructTypeFlag struct_flags_SimpleUnionStruct = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_SimpleUnionStruct; - TypeIdentifierPair type_ids_SimpleUnionStruct; - QualifiedTypeName type_name_SimpleUnionStruct = "SimpleUnionStruct"; - eprosima::fastcdr::optional type_ann_builtin_SimpleUnionStruct; - eprosima::fastcdr::optional ann_custom_SimpleUnionStruct; - CompleteTypeDetail detail_SimpleUnionStruct = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_SimpleUnionStruct, ann_custom_SimpleUnionStruct, type_name_SimpleUnionStruct.to_string()); - CompleteStructHeader header_SimpleUnionStruct; - header_SimpleUnionStruct = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_SimpleUnionStruct); - CompleteStructMemberSeq member_seq_SimpleUnionStruct; - { - return_code_SimpleUnionStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "SimpleUnion", type_ids_SimpleUnionStruct); - - if (return_code_SimpleUnionStruct != eprosima::fastdds::dds::RETCODE_OK) - { - { - ReturnCode_t return_code_SimpleUnion; - TypeIdentifierPair type_ids_SimpleUnion; - UnionTypeFlag union_flags_SimpleUnion = TypeObjectUtils::build_union_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - QualifiedTypeName type_name_SimpleUnion = "SimpleUnion"; - eprosima::fastcdr::optional type_ann_builtin_SimpleUnion; - eprosima::fastcdr::optional ann_custom_SimpleUnion; - CompleteTypeDetail detail_SimpleUnion = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_SimpleUnion, ann_custom_SimpleUnion, type_name_SimpleUnion.to_string()); - CompleteUnionHeader header_SimpleUnion = TypeObjectUtils::build_complete_union_header(detail_SimpleUnion); - UnionDiscriminatorFlag member_flags_SimpleUnion = TypeObjectUtils::build_union_discriminator_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false); - return_code_SimpleUnion = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_SimpleUnion); - - if (return_code_SimpleUnion != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Union discriminator TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - CommonDiscriminatorMember common_SimpleUnion; - if (EK_COMPLETE == type_ids_SimpleUnion.type_identifier1()._d() || TK_NONE == type_ids_SimpleUnion.type_identifier2()._d()) - { - common_SimpleUnion = TypeObjectUtils::build_common_discriminator_member(member_flags_SimpleUnion, type_ids_SimpleUnion.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_SimpleUnion.type_identifier2()._d()) - { - common_SimpleUnion = TypeObjectUtils::build_common_discriminator_member(member_flags_SimpleUnion, type_ids_SimpleUnion.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "SimpleUnion discriminator TypeIdentifier inconsistent."); - return; - } - type_ann_builtin_SimpleUnion.reset(); - ann_custom_SimpleUnion.reset(); - CompleteDiscriminatorMember discriminator_SimpleUnion = TypeObjectUtils::build_complete_discriminator_member(common_SimpleUnion, - type_ann_builtin_SimpleUnion, ann_custom_SimpleUnion); - CompleteUnionMemberSeq member_seq_SimpleUnion; - { - return_code_SimpleUnion = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_SimpleUnion); - - if (return_code_SimpleUnion != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "first Union member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - UnionMemberFlag member_flags_first = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false); - UnionCaseLabelSeq label_seq_first; - TypeObjectUtils::add_union_case_label(label_seq_first, static_cast(0)); - CommonUnionMember common_first; - MemberId member_id_first = 0x00000001; - if (EK_COMPLETE == type_ids_SimpleUnion.type_identifier1()._d() || TK_NONE == type_ids_SimpleUnion.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SimpleUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SimpleUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SimpleUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SimpleUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SimpleUnion.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SimpleUnion.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_first = TypeObjectUtils::build_common_union_member(member_id_first, member_flags_first, type_ids_SimpleUnion.type_identifier1(), - label_seq_first); - } - else if (EK_COMPLETE == type_ids_SimpleUnion.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SimpleUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SimpleUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SimpleUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SimpleUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SimpleUnion.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SimpleUnion.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_first = TypeObjectUtils::build_common_union_member(member_id_first, member_flags_first, type_ids_SimpleUnion.type_identifier2(), - label_seq_first); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Union first member TypeIdentifier inconsistent."); - return; - } - MemberName name_first = "first"; - eprosima::fastcdr::optional member_ann_builtin_first; - ann_custom_SimpleUnion.reset(); - CompleteMemberDetail detail_first = TypeObjectUtils::build_complete_member_detail(name_first, member_ann_builtin_first, ann_custom_SimpleUnion); - CompleteUnionMember member_first = TypeObjectUtils::build_complete_union_member(common_first, detail_first); - TypeObjectUtils::add_complete_union_member(member_seq_SimpleUnion, member_first); - } - { - return_code_SimpleUnion = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int64_t", type_ids_SimpleUnion); - - if (return_code_SimpleUnion != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "second Union member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - UnionMemberFlag member_flags_second = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false); - UnionCaseLabelSeq label_seq_second; - TypeObjectUtils::add_union_case_label(label_seq_second, static_cast(1)); - CommonUnionMember common_second; - MemberId member_id_second = 0x00000002; - if (EK_COMPLETE == type_ids_SimpleUnion.type_identifier1()._d() || TK_NONE == type_ids_SimpleUnion.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SimpleUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SimpleUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SimpleUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SimpleUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SimpleUnion.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SimpleUnion.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_second = TypeObjectUtils::build_common_union_member(member_id_second, member_flags_second, type_ids_SimpleUnion.type_identifier1(), - label_seq_second); - } - else if (EK_COMPLETE == type_ids_SimpleUnion.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SimpleUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SimpleUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SimpleUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SimpleUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SimpleUnion.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SimpleUnion.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_second = TypeObjectUtils::build_common_union_member(member_id_second, member_flags_second, type_ids_SimpleUnion.type_identifier2(), - label_seq_second); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Union second member TypeIdentifier inconsistent."); - return; - } - MemberName name_second = "second"; - eprosima::fastcdr::optional member_ann_builtin_second; - ann_custom_SimpleUnion.reset(); - CompleteMemberDetail detail_second = TypeObjectUtils::build_complete_member_detail(name_second, member_ann_builtin_second, ann_custom_SimpleUnion); - CompleteUnionMember member_second = TypeObjectUtils::build_complete_union_member(common_second, detail_second); - TypeObjectUtils::add_complete_union_member(member_seq_SimpleUnion, member_second); - } - CompleteUnionType union_type_SimpleUnion = TypeObjectUtils::build_complete_union_type(union_flags_SimpleUnion, header_SimpleUnion, discriminator_SimpleUnion, - member_seq_SimpleUnion); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_union_type_object(union_type_SimpleUnion, type_name_SimpleUnion.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "SimpleUnion already registered in TypeObjectRegistry for a different type."); - } - return_code_SimpleUnion = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "SimpleUnion", type_ids_SimpleUnion); - if (return_code_SimpleUnion != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "SimpleUnion: Given Union TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - } - StructMemberFlag member_flags_my_union = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_union; - MemberId member_id_my_union = 0x00000000; - if (EK_COMPLETE == type_ids_SimpleUnionStruct.type_identifier1()._d() || TK_NONE == type_ids_SimpleUnionStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SimpleUnionStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleUnionStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SimpleUnionStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleUnionStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SimpleUnionStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleUnionStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SimpleUnionStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleUnionStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SimpleUnionStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SimpleUnionStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleUnionStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SimpleUnionStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SimpleUnionStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleUnionStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_union = TypeObjectUtils::build_common_struct_member(member_id_my_union, member_flags_my_union, type_ids_SimpleUnionStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_SimpleUnionStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SimpleUnionStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleUnionStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SimpleUnionStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleUnionStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SimpleUnionStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleUnionStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SimpleUnionStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleUnionStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SimpleUnionStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SimpleUnionStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleUnionStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SimpleUnionStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SimpleUnionStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleUnionStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_union = TypeObjectUtils::build_common_struct_member(member_id_my_union, member_flags_my_union, type_ids_SimpleUnionStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_union member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_union = "my_union"; - eprosima::fastcdr::optional member_ann_builtin_my_union; - ann_custom_SimpleUnionStruct.reset(); - CompleteMemberDetail detail_my_union = TypeObjectUtils::build_complete_member_detail(name_my_union, member_ann_builtin_my_union, ann_custom_SimpleUnionStruct); - CompleteStructMember member_my_union = TypeObjectUtils::build_complete_struct_member(common_my_union, detail_my_union); - TypeObjectUtils::add_complete_struct_member(member_seq_SimpleUnionStruct, member_my_union); - } - CompleteStructType struct_type_SimpleUnionStruct = TypeObjectUtils::build_complete_struct_type(struct_flags_SimpleUnionStruct, header_SimpleUnionStruct, member_seq_SimpleUnionStruct); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_SimpleUnionStruct, type_name_SimpleUnionStruct.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "SimpleUnionStruct already registered in TypeObjectRegistry for a different type."); - } - return_code_SimpleUnionStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "SimpleUnionStruct", type_ids_SimpleUnionStruct); - if (return_code_SimpleUnionStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "SimpleUnionStruct: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } -} -void register_SimpleUnionStructEqual_type_identifier() -{ - { - StructTypeFlag struct_flags_SimpleUnionStructEqual = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_SimpleUnionStructEqual; - TypeIdentifierPair type_ids_SimpleUnionStructEqual; - QualifiedTypeName type_name_SimpleUnionStructEqual = "SimpleUnionStructEqual"; - eprosima::fastcdr::optional type_ann_builtin_SimpleUnionStructEqual; - eprosima::fastcdr::optional ann_custom_SimpleUnionStructEqual; - CompleteTypeDetail detail_SimpleUnionStructEqual = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_SimpleUnionStructEqual, ann_custom_SimpleUnionStructEqual, type_name_SimpleUnionStructEqual.to_string()); - CompleteStructHeader header_SimpleUnionStructEqual; - header_SimpleUnionStructEqual = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_SimpleUnionStructEqual); - CompleteStructMemberSeq member_seq_SimpleUnionStructEqual; - { - return_code_SimpleUnionStructEqual = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "SimpleUnion", type_ids_SimpleUnionStructEqual); - - if (return_code_SimpleUnionStructEqual != eprosima::fastdds::dds::RETCODE_OK) - { - { - ReturnCode_t return_code_SimpleUnion; - TypeIdentifierPair type_ids_SimpleUnion; - UnionTypeFlag union_flags_SimpleUnion = TypeObjectUtils::build_union_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - QualifiedTypeName type_name_SimpleUnion = "SimpleUnion"; - eprosima::fastcdr::optional type_ann_builtin_SimpleUnion; - eprosima::fastcdr::optional ann_custom_SimpleUnion; - CompleteTypeDetail detail_SimpleUnion = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_SimpleUnion, ann_custom_SimpleUnion, type_name_SimpleUnion.to_string()); - CompleteUnionHeader header_SimpleUnion = TypeObjectUtils::build_complete_union_header(detail_SimpleUnion); - UnionDiscriminatorFlag member_flags_SimpleUnion = TypeObjectUtils::build_union_discriminator_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false); - return_code_SimpleUnion = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_SimpleUnion); - - if (return_code_SimpleUnion != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Union discriminator TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - CommonDiscriminatorMember common_SimpleUnion; - if (EK_COMPLETE == type_ids_SimpleUnion.type_identifier1()._d() || TK_NONE == type_ids_SimpleUnion.type_identifier2()._d()) - { - common_SimpleUnion = TypeObjectUtils::build_common_discriminator_member(member_flags_SimpleUnion, type_ids_SimpleUnion.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_SimpleUnion.type_identifier2()._d()) - { - common_SimpleUnion = TypeObjectUtils::build_common_discriminator_member(member_flags_SimpleUnion, type_ids_SimpleUnion.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "SimpleUnion discriminator TypeIdentifier inconsistent."); - return; - } - type_ann_builtin_SimpleUnion.reset(); - ann_custom_SimpleUnion.reset(); - CompleteDiscriminatorMember discriminator_SimpleUnion = TypeObjectUtils::build_complete_discriminator_member(common_SimpleUnion, - type_ann_builtin_SimpleUnion, ann_custom_SimpleUnion); - CompleteUnionMemberSeq member_seq_SimpleUnion; - { - return_code_SimpleUnion = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_SimpleUnion); - - if (return_code_SimpleUnion != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "first Union member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - UnionMemberFlag member_flags_first = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false); - UnionCaseLabelSeq label_seq_first; - TypeObjectUtils::add_union_case_label(label_seq_first, static_cast(0)); - CommonUnionMember common_first; - MemberId member_id_first = 0x00000001; - if (EK_COMPLETE == type_ids_SimpleUnion.type_identifier1()._d() || TK_NONE == type_ids_SimpleUnion.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SimpleUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SimpleUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SimpleUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SimpleUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SimpleUnion.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SimpleUnion.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_first = TypeObjectUtils::build_common_union_member(member_id_first, member_flags_first, type_ids_SimpleUnion.type_identifier1(), - label_seq_first); - } - else if (EK_COMPLETE == type_ids_SimpleUnion.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SimpleUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SimpleUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SimpleUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SimpleUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SimpleUnion.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SimpleUnion.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_first = TypeObjectUtils::build_common_union_member(member_id_first, member_flags_first, type_ids_SimpleUnion.type_identifier2(), - label_seq_first); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Union first member TypeIdentifier inconsistent."); - return; - } - MemberName name_first = "first"; - eprosima::fastcdr::optional member_ann_builtin_first; - ann_custom_SimpleUnion.reset(); - CompleteMemberDetail detail_first = TypeObjectUtils::build_complete_member_detail(name_first, member_ann_builtin_first, ann_custom_SimpleUnion); - CompleteUnionMember member_first = TypeObjectUtils::build_complete_union_member(common_first, detail_first); - TypeObjectUtils::add_complete_union_member(member_seq_SimpleUnion, member_first); - } - { - return_code_SimpleUnion = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int64_t", type_ids_SimpleUnion); - - if (return_code_SimpleUnion != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "second Union member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - UnionMemberFlag member_flags_second = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false); - UnionCaseLabelSeq label_seq_second; - TypeObjectUtils::add_union_case_label(label_seq_second, static_cast(1)); - CommonUnionMember common_second; - MemberId member_id_second = 0x00000002; - if (EK_COMPLETE == type_ids_SimpleUnion.type_identifier1()._d() || TK_NONE == type_ids_SimpleUnion.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SimpleUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SimpleUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SimpleUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SimpleUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SimpleUnion.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SimpleUnion.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleUnion.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_second = TypeObjectUtils::build_common_union_member(member_id_second, member_flags_second, type_ids_SimpleUnion.type_identifier1(), - label_seq_second); - } - else if (EK_COMPLETE == type_ids_SimpleUnion.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SimpleUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SimpleUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SimpleUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SimpleUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SimpleUnion.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SimpleUnion.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleUnion.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_second = TypeObjectUtils::build_common_union_member(member_id_second, member_flags_second, type_ids_SimpleUnion.type_identifier2(), - label_seq_second); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Union second member TypeIdentifier inconsistent."); - return; - } - MemberName name_second = "second"; - eprosima::fastcdr::optional member_ann_builtin_second; - ann_custom_SimpleUnion.reset(); - CompleteMemberDetail detail_second = TypeObjectUtils::build_complete_member_detail(name_second, member_ann_builtin_second, ann_custom_SimpleUnion); - CompleteUnionMember member_second = TypeObjectUtils::build_complete_union_member(common_second, detail_second); - TypeObjectUtils::add_complete_union_member(member_seq_SimpleUnion, member_second); - } - CompleteUnionType union_type_SimpleUnion = TypeObjectUtils::build_complete_union_type(union_flags_SimpleUnion, header_SimpleUnion, discriminator_SimpleUnion, - member_seq_SimpleUnion); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_union_type_object(union_type_SimpleUnion, type_name_SimpleUnion.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "SimpleUnion already registered in TypeObjectRegistry for a different type."); - } - return_code_SimpleUnion = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "SimpleUnion", type_ids_SimpleUnion); - if (return_code_SimpleUnion != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "SimpleUnion: Given Union TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - } - StructMemberFlag member_flags_my_union_equal = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_union_equal; - MemberId member_id_my_union_equal = 0x00000000; - if (EK_COMPLETE == type_ids_SimpleUnionStructEqual.type_identifier1()._d() || TK_NONE == type_ids_SimpleUnionStructEqual.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SimpleUnionStructEqual.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleUnionStructEqual.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SimpleUnionStructEqual.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleUnionStructEqual.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SimpleUnionStructEqual.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleUnionStructEqual.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SimpleUnionStructEqual.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleUnionStructEqual.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SimpleUnionStructEqual.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SimpleUnionStructEqual.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleUnionStructEqual.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SimpleUnionStructEqual.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SimpleUnionStructEqual.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleUnionStructEqual.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_union_equal = TypeObjectUtils::build_common_struct_member(member_id_my_union_equal, member_flags_my_union_equal, type_ids_SimpleUnionStructEqual.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_SimpleUnionStructEqual.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SimpleUnionStructEqual.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleUnionStructEqual.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SimpleUnionStructEqual.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleUnionStructEqual.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SimpleUnionStructEqual.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleUnionStructEqual.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SimpleUnionStructEqual.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleUnionStructEqual.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SimpleUnionStructEqual.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SimpleUnionStructEqual.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleUnionStructEqual.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SimpleUnionStructEqual.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SimpleUnionStructEqual.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleUnionStructEqual.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_union_equal = TypeObjectUtils::build_common_struct_member(member_id_my_union_equal, member_flags_my_union_equal, type_ids_SimpleUnionStructEqual.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_union_equal member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_union_equal = "my_union_equal"; - eprosima::fastcdr::optional member_ann_builtin_my_union_equal; - ann_custom_SimpleUnionStructEqual.reset(); - CompleteMemberDetail detail_my_union_equal = TypeObjectUtils::build_complete_member_detail(name_my_union_equal, member_ann_builtin_my_union_equal, ann_custom_SimpleUnionStructEqual); - CompleteStructMember member_my_union_equal = TypeObjectUtils::build_complete_struct_member(common_my_union_equal, detail_my_union_equal); - TypeObjectUtils::add_complete_struct_member(member_seq_SimpleUnionStructEqual, member_my_union_equal); - } - CompleteStructType struct_type_SimpleUnionStructEqual = TypeObjectUtils::build_complete_struct_type(struct_flags_SimpleUnionStructEqual, header_SimpleUnionStructEqual, member_seq_SimpleUnionStructEqual); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_SimpleUnionStructEqual, type_name_SimpleUnionStructEqual.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "SimpleUnionStructEqual already registered in TypeObjectRegistry for a different type."); - } - return_code_SimpleUnionStructEqual = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "SimpleUnionStructEqual", type_ids_SimpleUnionStructEqual); - if (return_code_SimpleUnionStructEqual != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "SimpleUnionStructEqual: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } -} -void register_SimpleUnionNamesStruct_type_identifier() -{ - { - StructTypeFlag struct_flags_SimpleUnionNamesStruct = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_SimpleUnionNamesStruct; - TypeIdentifierPair type_ids_SimpleUnionNamesStruct; - QualifiedTypeName type_name_SimpleUnionNamesStruct = "SimpleUnionNamesStruct"; - eprosima::fastcdr::optional type_ann_builtin_SimpleUnionNamesStruct; - eprosima::fastcdr::optional ann_custom_SimpleUnionNamesStruct; - CompleteTypeDetail detail_SimpleUnionNamesStruct = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_SimpleUnionNamesStruct, ann_custom_SimpleUnionNamesStruct, type_name_SimpleUnionNamesStruct.to_string()); - CompleteStructHeader header_SimpleUnionNamesStruct; - header_SimpleUnionNamesStruct = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_SimpleUnionNamesStruct); - CompleteStructMemberSeq member_seq_SimpleUnionNamesStruct; - { - return_code_SimpleUnionNamesStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "SimpleUnionNames", type_ids_SimpleUnionNamesStruct); - - if (return_code_SimpleUnionNamesStruct != eprosima::fastdds::dds::RETCODE_OK) - { - { - ReturnCode_t return_code_SimpleUnionNames; - TypeIdentifierPair type_ids_SimpleUnionNames; - UnionTypeFlag union_flags_SimpleUnionNames = TypeObjectUtils::build_union_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - QualifiedTypeName type_name_SimpleUnionNames = "SimpleUnionNames"; - eprosima::fastcdr::optional type_ann_builtin_SimpleUnionNames; - eprosima::fastcdr::optional ann_custom_SimpleUnionNames; - CompleteTypeDetail detail_SimpleUnionNames = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_SimpleUnionNames, ann_custom_SimpleUnionNames, type_name_SimpleUnionNames.to_string()); - CompleteUnionHeader header_SimpleUnionNames = TypeObjectUtils::build_complete_union_header(detail_SimpleUnionNames); - UnionDiscriminatorFlag member_flags_SimpleUnionNames = TypeObjectUtils::build_union_discriminator_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false); - return_code_SimpleUnionNames = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_SimpleUnionNames); - - if (return_code_SimpleUnionNames != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Union discriminator TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - CommonDiscriminatorMember common_SimpleUnionNames; - if (EK_COMPLETE == type_ids_SimpleUnionNames.type_identifier1()._d() || TK_NONE == type_ids_SimpleUnionNames.type_identifier2()._d()) - { - common_SimpleUnionNames = TypeObjectUtils::build_common_discriminator_member(member_flags_SimpleUnionNames, type_ids_SimpleUnionNames.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_SimpleUnionNames.type_identifier2()._d()) - { - common_SimpleUnionNames = TypeObjectUtils::build_common_discriminator_member(member_flags_SimpleUnionNames, type_ids_SimpleUnionNames.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "SimpleUnionNames discriminator TypeIdentifier inconsistent."); - return; - } - type_ann_builtin_SimpleUnionNames.reset(); - ann_custom_SimpleUnionNames.reset(); - CompleteDiscriminatorMember discriminator_SimpleUnionNames = TypeObjectUtils::build_complete_discriminator_member(common_SimpleUnionNames, - type_ann_builtin_SimpleUnionNames, ann_custom_SimpleUnionNames); - CompleteUnionMemberSeq member_seq_SimpleUnionNames; - { - return_code_SimpleUnionNames = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_SimpleUnionNames); - - if (return_code_SimpleUnionNames != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "first_case Union member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - UnionMemberFlag member_flags_first_case = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false); - UnionCaseLabelSeq label_seq_first_case; - TypeObjectUtils::add_union_case_label(label_seq_first_case, static_cast(0)); - CommonUnionMember common_first_case; - MemberId member_id_first_case = 0x00000001; - if (EK_COMPLETE == type_ids_SimpleUnionNames.type_identifier1()._d() || TK_NONE == type_ids_SimpleUnionNames.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SimpleUnionNames.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleUnionNames.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SimpleUnionNames.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleUnionNames.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SimpleUnionNames.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleUnionNames.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SimpleUnionNames.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleUnionNames.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SimpleUnionNames.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SimpleUnionNames.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleUnionNames.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SimpleUnionNames.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SimpleUnionNames.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleUnionNames.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_first_case = TypeObjectUtils::build_common_union_member(member_id_first_case, member_flags_first_case, type_ids_SimpleUnionNames.type_identifier1(), - label_seq_first_case); - } - else if (EK_COMPLETE == type_ids_SimpleUnionNames.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SimpleUnionNames.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleUnionNames.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SimpleUnionNames.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleUnionNames.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SimpleUnionNames.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleUnionNames.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SimpleUnionNames.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleUnionNames.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SimpleUnionNames.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SimpleUnionNames.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleUnionNames.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SimpleUnionNames.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SimpleUnionNames.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleUnionNames.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_first_case = TypeObjectUtils::build_common_union_member(member_id_first_case, member_flags_first_case, type_ids_SimpleUnionNames.type_identifier2(), - label_seq_first_case); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Union first_case member TypeIdentifier inconsistent."); - return; - } - MemberName name_first_case = "first_case"; - eprosima::fastcdr::optional member_ann_builtin_first_case; - ann_custom_SimpleUnionNames.reset(); - CompleteMemberDetail detail_first_case = TypeObjectUtils::build_complete_member_detail(name_first_case, member_ann_builtin_first_case, ann_custom_SimpleUnionNames); - CompleteUnionMember member_first_case = TypeObjectUtils::build_complete_union_member(common_first_case, detail_first_case); - TypeObjectUtils::add_complete_union_member(member_seq_SimpleUnionNames, member_first_case); - } - { - return_code_SimpleUnionNames = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int64_t", type_ids_SimpleUnionNames); - - if (return_code_SimpleUnionNames != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "second_case Union member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - UnionMemberFlag member_flags_second_case = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false); - UnionCaseLabelSeq label_seq_second_case; - TypeObjectUtils::add_union_case_label(label_seq_second_case, static_cast(1)); - CommonUnionMember common_second_case; - MemberId member_id_second_case = 0x00000002; - if (EK_COMPLETE == type_ids_SimpleUnionNames.type_identifier1()._d() || TK_NONE == type_ids_SimpleUnionNames.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SimpleUnionNames.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleUnionNames.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SimpleUnionNames.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleUnionNames.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SimpleUnionNames.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleUnionNames.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SimpleUnionNames.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleUnionNames.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SimpleUnionNames.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SimpleUnionNames.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleUnionNames.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SimpleUnionNames.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SimpleUnionNames.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleUnionNames.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_second_case = TypeObjectUtils::build_common_union_member(member_id_second_case, member_flags_second_case, type_ids_SimpleUnionNames.type_identifier1(), - label_seq_second_case); - } - else if (EK_COMPLETE == type_ids_SimpleUnionNames.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SimpleUnionNames.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleUnionNames.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SimpleUnionNames.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleUnionNames.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SimpleUnionNames.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleUnionNames.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SimpleUnionNames.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleUnionNames.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SimpleUnionNames.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SimpleUnionNames.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleUnionNames.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SimpleUnionNames.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SimpleUnionNames.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleUnionNames.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_second_case = TypeObjectUtils::build_common_union_member(member_id_second_case, member_flags_second_case, type_ids_SimpleUnionNames.type_identifier2(), - label_seq_second_case); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Union second_case member TypeIdentifier inconsistent."); - return; - } - MemberName name_second_case = "second_case"; - eprosima::fastcdr::optional member_ann_builtin_second_case; - ann_custom_SimpleUnionNames.reset(); - CompleteMemberDetail detail_second_case = TypeObjectUtils::build_complete_member_detail(name_second_case, member_ann_builtin_second_case, ann_custom_SimpleUnionNames); - CompleteUnionMember member_second_case = TypeObjectUtils::build_complete_union_member(common_second_case, detail_second_case); - TypeObjectUtils::add_complete_union_member(member_seq_SimpleUnionNames, member_second_case); - } - CompleteUnionType union_type_SimpleUnionNames = TypeObjectUtils::build_complete_union_type(union_flags_SimpleUnionNames, header_SimpleUnionNames, discriminator_SimpleUnionNames, - member_seq_SimpleUnionNames); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_union_type_object(union_type_SimpleUnionNames, type_name_SimpleUnionNames.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "SimpleUnionNames already registered in TypeObjectRegistry for a different type."); - } - return_code_SimpleUnionNames = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "SimpleUnionNames", type_ids_SimpleUnionNames); - if (return_code_SimpleUnionNames != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "SimpleUnionNames: Given Union TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - } - StructMemberFlag member_flags_my_union = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_union; - MemberId member_id_my_union = 0x00000000; - if (EK_COMPLETE == type_ids_SimpleUnionNamesStruct.type_identifier1()._d() || TK_NONE == type_ids_SimpleUnionNamesStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SimpleUnionNamesStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleUnionNamesStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SimpleUnionNamesStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleUnionNamesStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SimpleUnionNamesStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleUnionNamesStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SimpleUnionNamesStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleUnionNamesStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SimpleUnionNamesStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SimpleUnionNamesStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleUnionNamesStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SimpleUnionNamesStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SimpleUnionNamesStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleUnionNamesStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_union = TypeObjectUtils::build_common_struct_member(member_id_my_union, member_flags_my_union, type_ids_SimpleUnionNamesStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_SimpleUnionNamesStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SimpleUnionNamesStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleUnionNamesStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SimpleUnionNamesStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleUnionNamesStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SimpleUnionNamesStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleUnionNamesStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SimpleUnionNamesStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleUnionNamesStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SimpleUnionNamesStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SimpleUnionNamesStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleUnionNamesStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SimpleUnionNamesStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SimpleUnionNamesStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleUnionNamesStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_union = TypeObjectUtils::build_common_struct_member(member_id_my_union, member_flags_my_union, type_ids_SimpleUnionNamesStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_union member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_union = "my_union"; - eprosima::fastcdr::optional member_ann_builtin_my_union; - ann_custom_SimpleUnionNamesStruct.reset(); - CompleteMemberDetail detail_my_union = TypeObjectUtils::build_complete_member_detail(name_my_union, member_ann_builtin_my_union, ann_custom_SimpleUnionNamesStruct); - CompleteStructMember member_my_union = TypeObjectUtils::build_complete_struct_member(common_my_union, detail_my_union); - TypeObjectUtils::add_complete_struct_member(member_seq_SimpleUnionNamesStruct, member_my_union); - } - CompleteStructType struct_type_SimpleUnionNamesStruct = TypeObjectUtils::build_complete_struct_type(struct_flags_SimpleUnionNamesStruct, header_SimpleUnionNamesStruct, member_seq_SimpleUnionNamesStruct); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_SimpleUnionNamesStruct, type_name_SimpleUnionNamesStruct.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "SimpleUnionNamesStruct already registered in TypeObjectRegistry for a different type."); - } - return_code_SimpleUnionNamesStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "SimpleUnionNamesStruct", type_ids_SimpleUnionNamesStruct); - if (return_code_SimpleUnionNamesStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "SimpleUnionNamesStruct: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } -} -void register_SimpleTypeUnionStruct_type_identifier() -{ - { - StructTypeFlag struct_flags_SimpleTypeUnionStruct = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_SimpleTypeUnionStruct; - TypeIdentifierPair type_ids_SimpleTypeUnionStruct; - QualifiedTypeName type_name_SimpleTypeUnionStruct = "SimpleTypeUnionStruct"; - eprosima::fastcdr::optional type_ann_builtin_SimpleTypeUnionStruct; - eprosima::fastcdr::optional ann_custom_SimpleTypeUnionStruct; - CompleteTypeDetail detail_SimpleTypeUnionStruct = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_SimpleTypeUnionStruct, ann_custom_SimpleTypeUnionStruct, type_name_SimpleTypeUnionStruct.to_string()); - CompleteStructHeader header_SimpleTypeUnionStruct; - header_SimpleTypeUnionStruct = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_SimpleTypeUnionStruct); - CompleteStructMemberSeq member_seq_SimpleTypeUnionStruct; - { - return_code_SimpleTypeUnionStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "SimpleTypeUnion", type_ids_SimpleTypeUnionStruct); - - if (return_code_SimpleTypeUnionStruct != eprosima::fastdds::dds::RETCODE_OK) - { - { - ReturnCode_t return_code_SimpleTypeUnion; - TypeIdentifierPair type_ids_SimpleTypeUnion; - UnionTypeFlag union_flags_SimpleTypeUnion = TypeObjectUtils::build_union_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - QualifiedTypeName type_name_SimpleTypeUnion = "SimpleTypeUnion"; - eprosima::fastcdr::optional type_ann_builtin_SimpleTypeUnion; - eprosima::fastcdr::optional ann_custom_SimpleTypeUnion; - CompleteTypeDetail detail_SimpleTypeUnion = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_SimpleTypeUnion, ann_custom_SimpleTypeUnion, type_name_SimpleTypeUnion.to_string()); - CompleteUnionHeader header_SimpleTypeUnion = TypeObjectUtils::build_complete_union_header(detail_SimpleTypeUnion); - UnionDiscriminatorFlag member_flags_SimpleTypeUnion = TypeObjectUtils::build_union_discriminator_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false); - return_code_SimpleTypeUnion = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_SimpleTypeUnion); - - if (return_code_SimpleTypeUnion != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Union discriminator TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - CommonDiscriminatorMember common_SimpleTypeUnion; - if (EK_COMPLETE == type_ids_SimpleTypeUnion.type_identifier1()._d() || TK_NONE == type_ids_SimpleTypeUnion.type_identifier2()._d()) - { - common_SimpleTypeUnion = TypeObjectUtils::build_common_discriminator_member(member_flags_SimpleTypeUnion, type_ids_SimpleTypeUnion.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_SimpleTypeUnion.type_identifier2()._d()) - { - common_SimpleTypeUnion = TypeObjectUtils::build_common_discriminator_member(member_flags_SimpleTypeUnion, type_ids_SimpleTypeUnion.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "SimpleTypeUnion discriminator TypeIdentifier inconsistent."); - return; - } - type_ann_builtin_SimpleTypeUnion.reset(); - ann_custom_SimpleTypeUnion.reset(); - CompleteDiscriminatorMember discriminator_SimpleTypeUnion = TypeObjectUtils::build_complete_discriminator_member(common_SimpleTypeUnion, - type_ann_builtin_SimpleTypeUnion, ann_custom_SimpleTypeUnion); - CompleteUnionMemberSeq member_seq_SimpleTypeUnion; - { - return_code_SimpleTypeUnion = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_byte", type_ids_SimpleTypeUnion); - - if (return_code_SimpleTypeUnion != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "first Union member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - UnionMemberFlag member_flags_first = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false); - UnionCaseLabelSeq label_seq_first; - TypeObjectUtils::add_union_case_label(label_seq_first, static_cast(0)); - CommonUnionMember common_first; - MemberId member_id_first = 0x00000001; - if (EK_COMPLETE == type_ids_SimpleTypeUnion.type_identifier1()._d() || TK_NONE == type_ids_SimpleTypeUnion.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SimpleTypeUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleTypeUnion.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SimpleTypeUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleTypeUnion.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SimpleTypeUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleTypeUnion.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SimpleTypeUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleTypeUnion.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SimpleTypeUnion.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SimpleTypeUnion.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleTypeUnion.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SimpleTypeUnion.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SimpleTypeUnion.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleTypeUnion.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_first = TypeObjectUtils::build_common_union_member(member_id_first, member_flags_first, type_ids_SimpleTypeUnion.type_identifier1(), - label_seq_first); - } - else if (EK_COMPLETE == type_ids_SimpleTypeUnion.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SimpleTypeUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleTypeUnion.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SimpleTypeUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleTypeUnion.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SimpleTypeUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleTypeUnion.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SimpleTypeUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleTypeUnion.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SimpleTypeUnion.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SimpleTypeUnion.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleTypeUnion.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SimpleTypeUnion.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SimpleTypeUnion.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleTypeUnion.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_first = TypeObjectUtils::build_common_union_member(member_id_first, member_flags_first, type_ids_SimpleTypeUnion.type_identifier2(), - label_seq_first); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Union first member TypeIdentifier inconsistent."); - return; - } - MemberName name_first = "first"; - eprosima::fastcdr::optional member_ann_builtin_first; - ann_custom_SimpleTypeUnion.reset(); - CompleteMemberDetail detail_first = TypeObjectUtils::build_complete_member_detail(name_first, member_ann_builtin_first, ann_custom_SimpleTypeUnion); - CompleteUnionMember member_first = TypeObjectUtils::build_complete_union_member(common_first, detail_first); - TypeObjectUtils::add_complete_union_member(member_seq_SimpleTypeUnion, member_first); - } - { - return_code_SimpleTypeUnion = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int64_t", type_ids_SimpleTypeUnion); - - if (return_code_SimpleTypeUnion != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "second Union member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - UnionMemberFlag member_flags_second = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false); - UnionCaseLabelSeq label_seq_second; - TypeObjectUtils::add_union_case_label(label_seq_second, static_cast(1)); - CommonUnionMember common_second; - MemberId member_id_second = 0x00000002; - if (EK_COMPLETE == type_ids_SimpleTypeUnion.type_identifier1()._d() || TK_NONE == type_ids_SimpleTypeUnion.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SimpleTypeUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleTypeUnion.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SimpleTypeUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleTypeUnion.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SimpleTypeUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleTypeUnion.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SimpleTypeUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleTypeUnion.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SimpleTypeUnion.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SimpleTypeUnion.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleTypeUnion.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SimpleTypeUnion.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SimpleTypeUnion.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleTypeUnion.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_second = TypeObjectUtils::build_common_union_member(member_id_second, member_flags_second, type_ids_SimpleTypeUnion.type_identifier1(), - label_seq_second); - } - else if (EK_COMPLETE == type_ids_SimpleTypeUnion.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SimpleTypeUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleTypeUnion.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SimpleTypeUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleTypeUnion.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SimpleTypeUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleTypeUnion.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SimpleTypeUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleTypeUnion.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SimpleTypeUnion.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SimpleTypeUnion.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleTypeUnion.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SimpleTypeUnion.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SimpleTypeUnion.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleTypeUnion.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_second = TypeObjectUtils::build_common_union_member(member_id_second, member_flags_second, type_ids_SimpleTypeUnion.type_identifier2(), - label_seq_second); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Union second member TypeIdentifier inconsistent."); - return; - } - MemberName name_second = "second"; - eprosima::fastcdr::optional member_ann_builtin_second; - ann_custom_SimpleTypeUnion.reset(); - CompleteMemberDetail detail_second = TypeObjectUtils::build_complete_member_detail(name_second, member_ann_builtin_second, ann_custom_SimpleTypeUnion); - CompleteUnionMember member_second = TypeObjectUtils::build_complete_union_member(common_second, detail_second); - TypeObjectUtils::add_complete_union_member(member_seq_SimpleTypeUnion, member_second); - } - CompleteUnionType union_type_SimpleTypeUnion = TypeObjectUtils::build_complete_union_type(union_flags_SimpleTypeUnion, header_SimpleTypeUnion, discriminator_SimpleTypeUnion, - member_seq_SimpleTypeUnion); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_union_type_object(union_type_SimpleTypeUnion, type_name_SimpleTypeUnion.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "SimpleTypeUnion already registered in TypeObjectRegistry for a different type."); - } - return_code_SimpleTypeUnion = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "SimpleTypeUnion", type_ids_SimpleTypeUnion); - if (return_code_SimpleTypeUnion != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "SimpleTypeUnion: Given Union TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - } - StructMemberFlag member_flags_my_union = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_union; - MemberId member_id_my_union = 0x00000000; - if (EK_COMPLETE == type_ids_SimpleTypeUnionStruct.type_identifier1()._d() || TK_NONE == type_ids_SimpleTypeUnionStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SimpleTypeUnionStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleTypeUnionStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SimpleTypeUnionStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleTypeUnionStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SimpleTypeUnionStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleTypeUnionStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SimpleTypeUnionStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleTypeUnionStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SimpleTypeUnionStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SimpleTypeUnionStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleTypeUnionStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SimpleTypeUnionStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SimpleTypeUnionStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleTypeUnionStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_union = TypeObjectUtils::build_common_struct_member(member_id_my_union, member_flags_my_union, type_ids_SimpleTypeUnionStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_SimpleTypeUnionStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SimpleTypeUnionStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleTypeUnionStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SimpleTypeUnionStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleTypeUnionStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SimpleTypeUnionStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleTypeUnionStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SimpleTypeUnionStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleTypeUnionStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SimpleTypeUnionStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SimpleTypeUnionStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleTypeUnionStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SimpleTypeUnionStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SimpleTypeUnionStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleTypeUnionStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_union = TypeObjectUtils::build_common_struct_member(member_id_my_union, member_flags_my_union, type_ids_SimpleTypeUnionStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_union member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_union = "my_union"; - eprosima::fastcdr::optional member_ann_builtin_my_union; - ann_custom_SimpleTypeUnionStruct.reset(); - CompleteMemberDetail detail_my_union = TypeObjectUtils::build_complete_member_detail(name_my_union, member_ann_builtin_my_union, ann_custom_SimpleTypeUnionStruct); - CompleteStructMember member_my_union = TypeObjectUtils::build_complete_struct_member(common_my_union, detail_my_union); - TypeObjectUtils::add_complete_struct_member(member_seq_SimpleTypeUnionStruct, member_my_union); - } - CompleteStructType struct_type_SimpleTypeUnionStruct = TypeObjectUtils::build_complete_struct_type(struct_flags_SimpleTypeUnionStruct, header_SimpleTypeUnionStruct, member_seq_SimpleTypeUnionStruct); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_SimpleTypeUnionStruct, type_name_SimpleTypeUnionStruct.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "SimpleTypeUnionStruct already registered in TypeObjectRegistry for a different type."); - } - return_code_SimpleTypeUnionStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "SimpleTypeUnionStruct", type_ids_SimpleTypeUnionStruct); - if (return_code_SimpleTypeUnionStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "SimpleTypeUnionStruct: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } -} -void register_SimpleBadUnionStruct_type_identifier() -{ - { - StructTypeFlag struct_flags_SimpleBadUnionStruct = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_SimpleBadUnionStruct; - TypeIdentifierPair type_ids_SimpleBadUnionStruct; - QualifiedTypeName type_name_SimpleBadUnionStruct = "SimpleBadUnionStruct"; - eprosima::fastcdr::optional type_ann_builtin_SimpleBadUnionStruct; - eprosima::fastcdr::optional ann_custom_SimpleBadUnionStruct; - CompleteTypeDetail detail_SimpleBadUnionStruct = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_SimpleBadUnionStruct, ann_custom_SimpleBadUnionStruct, type_name_SimpleBadUnionStruct.to_string()); - CompleteStructHeader header_SimpleBadUnionStruct; - header_SimpleBadUnionStruct = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_SimpleBadUnionStruct); - CompleteStructMemberSeq member_seq_SimpleBadUnionStruct; - { - return_code_SimpleBadUnionStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "SimpleBadUnion", type_ids_SimpleBadUnionStruct); - - if (return_code_SimpleBadUnionStruct != eprosima::fastdds::dds::RETCODE_OK) - { - { - ReturnCode_t return_code_SimpleBadUnion; - TypeIdentifierPair type_ids_SimpleBadUnion; - UnionTypeFlag union_flags_SimpleBadUnion = TypeObjectUtils::build_union_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - QualifiedTypeName type_name_SimpleBadUnion = "SimpleBadUnion"; - eprosima::fastcdr::optional type_ann_builtin_SimpleBadUnion; - eprosima::fastcdr::optional ann_custom_SimpleBadUnion; - CompleteTypeDetail detail_SimpleBadUnion = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_SimpleBadUnion, ann_custom_SimpleBadUnion, type_name_SimpleBadUnion.to_string()); - CompleteUnionHeader header_SimpleBadUnion = TypeObjectUtils::build_complete_union_header(detail_SimpleBadUnion); - UnionDiscriminatorFlag member_flags_SimpleBadUnion = TypeObjectUtils::build_union_discriminator_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false); - return_code_SimpleBadUnion = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_SimpleBadUnion); - - if (return_code_SimpleBadUnion != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Union discriminator TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - CommonDiscriminatorMember common_SimpleBadUnion; - if (EK_COMPLETE == type_ids_SimpleBadUnion.type_identifier1()._d() || TK_NONE == type_ids_SimpleBadUnion.type_identifier2()._d()) - { - common_SimpleBadUnion = TypeObjectUtils::build_common_discriminator_member(member_flags_SimpleBadUnion, type_ids_SimpleBadUnion.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_SimpleBadUnion.type_identifier2()._d()) - { - common_SimpleBadUnion = TypeObjectUtils::build_common_discriminator_member(member_flags_SimpleBadUnion, type_ids_SimpleBadUnion.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "SimpleBadUnion discriminator TypeIdentifier inconsistent."); - return; - } - type_ann_builtin_SimpleBadUnion.reset(); - ann_custom_SimpleBadUnion.reset(); - CompleteDiscriminatorMember discriminator_SimpleBadUnion = TypeObjectUtils::build_complete_discriminator_member(common_SimpleBadUnion, - type_ann_builtin_SimpleBadUnion, ann_custom_SimpleBadUnion); - CompleteUnionMemberSeq member_seq_SimpleBadUnion; - { - return_code_SimpleBadUnion = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_SimpleBadUnion); - - if (return_code_SimpleBadUnion != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "first Union member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - UnionMemberFlag member_flags_first = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false); - UnionCaseLabelSeq label_seq_first; - TypeObjectUtils::add_union_case_label(label_seq_first, static_cast(0)); - CommonUnionMember common_first; - MemberId member_id_first = 0x00000001; - if (EK_COMPLETE == type_ids_SimpleBadUnion.type_identifier1()._d() || TK_NONE == type_ids_SimpleBadUnion.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SimpleBadUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleBadUnion.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SimpleBadUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleBadUnion.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SimpleBadUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleBadUnion.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SimpleBadUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleBadUnion.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SimpleBadUnion.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SimpleBadUnion.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleBadUnion.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SimpleBadUnion.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SimpleBadUnion.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleBadUnion.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_first = TypeObjectUtils::build_common_union_member(member_id_first, member_flags_first, type_ids_SimpleBadUnion.type_identifier1(), - label_seq_first); - } - else if (EK_COMPLETE == type_ids_SimpleBadUnion.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SimpleBadUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleBadUnion.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SimpleBadUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleBadUnion.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SimpleBadUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleBadUnion.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SimpleBadUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleBadUnion.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SimpleBadUnion.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SimpleBadUnion.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleBadUnion.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SimpleBadUnion.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SimpleBadUnion.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleBadUnion.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_first = TypeObjectUtils::build_common_union_member(member_id_first, member_flags_first, type_ids_SimpleBadUnion.type_identifier2(), - label_seq_first); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Union first member TypeIdentifier inconsistent."); - return; - } - MemberName name_first = "first"; - eprosima::fastcdr::optional member_ann_builtin_first; - ann_custom_SimpleBadUnion.reset(); - CompleteMemberDetail detail_first = TypeObjectUtils::build_complete_member_detail(name_first, member_ann_builtin_first, ann_custom_SimpleBadUnion); - CompleteUnionMember member_first = TypeObjectUtils::build_complete_union_member(common_first, detail_first); - TypeObjectUtils::add_complete_union_member(member_seq_SimpleBadUnion, member_first); - } - { - return_code_SimpleBadUnion = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int64_t", type_ids_SimpleBadUnion); - - if (return_code_SimpleBadUnion != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "second Union member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - UnionMemberFlag member_flags_second = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false); - UnionCaseLabelSeq label_seq_second; - TypeObjectUtils::add_union_case_label(label_seq_second, static_cast(2)); - CommonUnionMember common_second; - MemberId member_id_second = 0x00000002; - if (EK_COMPLETE == type_ids_SimpleBadUnion.type_identifier1()._d() || TK_NONE == type_ids_SimpleBadUnion.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SimpleBadUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleBadUnion.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SimpleBadUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleBadUnion.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SimpleBadUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleBadUnion.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SimpleBadUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleBadUnion.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SimpleBadUnion.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SimpleBadUnion.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleBadUnion.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SimpleBadUnion.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SimpleBadUnion.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleBadUnion.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_second = TypeObjectUtils::build_common_union_member(member_id_second, member_flags_second, type_ids_SimpleBadUnion.type_identifier1(), - label_seq_second); - } - else if (EK_COMPLETE == type_ids_SimpleBadUnion.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SimpleBadUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleBadUnion.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SimpleBadUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleBadUnion.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SimpleBadUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleBadUnion.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SimpleBadUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleBadUnion.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SimpleBadUnion.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SimpleBadUnion.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleBadUnion.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SimpleBadUnion.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SimpleBadUnion.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleBadUnion.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_second = TypeObjectUtils::build_common_union_member(member_id_second, member_flags_second, type_ids_SimpleBadUnion.type_identifier2(), - label_seq_second); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Union second member TypeIdentifier inconsistent."); - return; - } - MemberName name_second = "second"; - eprosima::fastcdr::optional member_ann_builtin_second; - ann_custom_SimpleBadUnion.reset(); - CompleteMemberDetail detail_second = TypeObjectUtils::build_complete_member_detail(name_second, member_ann_builtin_second, ann_custom_SimpleBadUnion); - CompleteUnionMember member_second = TypeObjectUtils::build_complete_union_member(common_second, detail_second); - TypeObjectUtils::add_complete_union_member(member_seq_SimpleBadUnion, member_second); - } - CompleteUnionType union_type_SimpleBadUnion = TypeObjectUtils::build_complete_union_type(union_flags_SimpleBadUnion, header_SimpleBadUnion, discriminator_SimpleBadUnion, - member_seq_SimpleBadUnion); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_union_type_object(union_type_SimpleBadUnion, type_name_SimpleBadUnion.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "SimpleBadUnion already registered in TypeObjectRegistry for a different type."); - } - return_code_SimpleBadUnion = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "SimpleBadUnion", type_ids_SimpleBadUnion); - if (return_code_SimpleBadUnion != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "SimpleBadUnion: Given Union TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - } - StructMemberFlag member_flags_my_union = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_union; - MemberId member_id_my_union = 0x00000000; - if (EK_COMPLETE == type_ids_SimpleBadUnionStruct.type_identifier1()._d() || TK_NONE == type_ids_SimpleBadUnionStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SimpleBadUnionStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleBadUnionStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SimpleBadUnionStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleBadUnionStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SimpleBadUnionStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleBadUnionStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SimpleBadUnionStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleBadUnionStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SimpleBadUnionStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SimpleBadUnionStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleBadUnionStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SimpleBadUnionStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SimpleBadUnionStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleBadUnionStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_union = TypeObjectUtils::build_common_struct_member(member_id_my_union, member_flags_my_union, type_ids_SimpleBadUnionStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_SimpleBadUnionStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SimpleBadUnionStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleBadUnionStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SimpleBadUnionStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleBadUnionStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SimpleBadUnionStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleBadUnionStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SimpleBadUnionStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleBadUnionStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SimpleBadUnionStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SimpleBadUnionStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleBadUnionStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SimpleBadUnionStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SimpleBadUnionStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleBadUnionStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_union = TypeObjectUtils::build_common_struct_member(member_id_my_union, member_flags_my_union, type_ids_SimpleBadUnionStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_union member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_union = "my_union"; - eprosima::fastcdr::optional member_ann_builtin_my_union; - ann_custom_SimpleBadUnionStruct.reset(); - CompleteMemberDetail detail_my_union = TypeObjectUtils::build_complete_member_detail(name_my_union, member_ann_builtin_my_union, ann_custom_SimpleBadUnionStruct); - CompleteStructMember member_my_union = TypeObjectUtils::build_complete_struct_member(common_my_union, detail_my_union); - TypeObjectUtils::add_complete_struct_member(member_seq_SimpleBadUnionStruct, member_my_union); - } - CompleteStructType struct_type_SimpleBadUnionStruct = TypeObjectUtils::build_complete_struct_type(struct_flags_SimpleBadUnionStruct, header_SimpleBadUnionStruct, member_seq_SimpleBadUnionStruct); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_SimpleBadUnionStruct, type_name_SimpleBadUnionStruct.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "SimpleBadUnionStruct already registered in TypeObjectRegistry for a different type."); - } - return_code_SimpleBadUnionStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "SimpleBadUnionStruct", type_ids_SimpleBadUnionStruct); - if (return_code_SimpleBadUnionStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "SimpleBadUnionStruct: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } -} -void register_SimplBadDiscUnionStruct_type_identifier() -{ - { - StructTypeFlag struct_flags_SimplBadDiscUnionStruct = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_SimplBadDiscUnionStruct; - TypeIdentifierPair type_ids_SimplBadDiscUnionStruct; - QualifiedTypeName type_name_SimplBadDiscUnionStruct = "SimplBadDiscUnionStruct"; - eprosima::fastcdr::optional type_ann_builtin_SimplBadDiscUnionStruct; - eprosima::fastcdr::optional ann_custom_SimplBadDiscUnionStruct; - CompleteTypeDetail detail_SimplBadDiscUnionStruct = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_SimplBadDiscUnionStruct, ann_custom_SimplBadDiscUnionStruct, type_name_SimplBadDiscUnionStruct.to_string()); - CompleteStructHeader header_SimplBadDiscUnionStruct; - header_SimplBadDiscUnionStruct = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_SimplBadDiscUnionStruct); - CompleteStructMemberSeq member_seq_SimplBadDiscUnionStruct; - { - return_code_SimplBadDiscUnionStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "SimpleBadDiscUnion", type_ids_SimplBadDiscUnionStruct); - - if (return_code_SimplBadDiscUnionStruct != eprosima::fastdds::dds::RETCODE_OK) - { - { - ReturnCode_t return_code_SimpleBadDiscUnion; - TypeIdentifierPair type_ids_SimpleBadDiscUnion; - UnionTypeFlag union_flags_SimpleBadDiscUnion = TypeObjectUtils::build_union_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - QualifiedTypeName type_name_SimpleBadDiscUnion = "SimpleBadDiscUnion"; - eprosima::fastcdr::optional type_ann_builtin_SimpleBadDiscUnion; - eprosima::fastcdr::optional ann_custom_SimpleBadDiscUnion; - CompleteTypeDetail detail_SimpleBadDiscUnion = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_SimpleBadDiscUnion, ann_custom_SimpleBadDiscUnion, type_name_SimpleBadDiscUnion.to_string()); - CompleteUnionHeader header_SimpleBadDiscUnion = TypeObjectUtils::build_complete_union_header(detail_SimpleBadDiscUnion); - UnionDiscriminatorFlag member_flags_SimpleBadDiscUnion = TypeObjectUtils::build_union_discriminator_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false); - return_code_SimpleBadDiscUnion = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_byte", type_ids_SimpleBadDiscUnion); - - if (return_code_SimpleBadDiscUnion != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Union discriminator TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - CommonDiscriminatorMember common_SimpleBadDiscUnion; - if (EK_COMPLETE == type_ids_SimpleBadDiscUnion.type_identifier1()._d() || TK_NONE == type_ids_SimpleBadDiscUnion.type_identifier2()._d()) - { - common_SimpleBadDiscUnion = TypeObjectUtils::build_common_discriminator_member(member_flags_SimpleBadDiscUnion, type_ids_SimpleBadDiscUnion.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_SimpleBadDiscUnion.type_identifier2()._d()) - { - common_SimpleBadDiscUnion = TypeObjectUtils::build_common_discriminator_member(member_flags_SimpleBadDiscUnion, type_ids_SimpleBadDiscUnion.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "SimpleBadDiscUnion discriminator TypeIdentifier inconsistent."); - return; - } - type_ann_builtin_SimpleBadDiscUnion.reset(); - ann_custom_SimpleBadDiscUnion.reset(); - CompleteDiscriminatorMember discriminator_SimpleBadDiscUnion = TypeObjectUtils::build_complete_discriminator_member(common_SimpleBadDiscUnion, - type_ann_builtin_SimpleBadDiscUnion, ann_custom_SimpleBadDiscUnion); - CompleteUnionMemberSeq member_seq_SimpleBadDiscUnion; - { - return_code_SimpleBadDiscUnion = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_SimpleBadDiscUnion); - - if (return_code_SimpleBadDiscUnion != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "first Union member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - UnionMemberFlag member_flags_first = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false); - UnionCaseLabelSeq label_seq_first; - TypeObjectUtils::add_union_case_label(label_seq_first, static_cast(0)); - CommonUnionMember common_first; - MemberId member_id_first = 0x00000001; - if (EK_COMPLETE == type_ids_SimpleBadDiscUnion.type_identifier1()._d() || TK_NONE == type_ids_SimpleBadDiscUnion.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SimpleBadDiscUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleBadDiscUnion.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SimpleBadDiscUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleBadDiscUnion.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SimpleBadDiscUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleBadDiscUnion.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SimpleBadDiscUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleBadDiscUnion.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SimpleBadDiscUnion.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SimpleBadDiscUnion.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleBadDiscUnion.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SimpleBadDiscUnion.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SimpleBadDiscUnion.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleBadDiscUnion.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_first = TypeObjectUtils::build_common_union_member(member_id_first, member_flags_first, type_ids_SimpleBadDiscUnion.type_identifier1(), - label_seq_first); - } - else if (EK_COMPLETE == type_ids_SimpleBadDiscUnion.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SimpleBadDiscUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleBadDiscUnion.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SimpleBadDiscUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleBadDiscUnion.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SimpleBadDiscUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleBadDiscUnion.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SimpleBadDiscUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleBadDiscUnion.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SimpleBadDiscUnion.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SimpleBadDiscUnion.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleBadDiscUnion.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SimpleBadDiscUnion.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SimpleBadDiscUnion.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleBadDiscUnion.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_first = TypeObjectUtils::build_common_union_member(member_id_first, member_flags_first, type_ids_SimpleBadDiscUnion.type_identifier2(), - label_seq_first); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Union first member TypeIdentifier inconsistent."); - return; - } - MemberName name_first = "first"; - eprosima::fastcdr::optional member_ann_builtin_first; - ann_custom_SimpleBadDiscUnion.reset(); - CompleteMemberDetail detail_first = TypeObjectUtils::build_complete_member_detail(name_first, member_ann_builtin_first, ann_custom_SimpleBadDiscUnion); - CompleteUnionMember member_first = TypeObjectUtils::build_complete_union_member(common_first, detail_first); - TypeObjectUtils::add_complete_union_member(member_seq_SimpleBadDiscUnion, member_first); - } - { - return_code_SimpleBadDiscUnion = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int64_t", type_ids_SimpleBadDiscUnion); - - if (return_code_SimpleBadDiscUnion != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "second Union member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - UnionMemberFlag member_flags_second = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false); - UnionCaseLabelSeq label_seq_second; - TypeObjectUtils::add_union_case_label(label_seq_second, static_cast(1)); - CommonUnionMember common_second; - MemberId member_id_second = 0x00000002; - if (EK_COMPLETE == type_ids_SimpleBadDiscUnion.type_identifier1()._d() || TK_NONE == type_ids_SimpleBadDiscUnion.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SimpleBadDiscUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleBadDiscUnion.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SimpleBadDiscUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleBadDiscUnion.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SimpleBadDiscUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleBadDiscUnion.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SimpleBadDiscUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleBadDiscUnion.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SimpleBadDiscUnion.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SimpleBadDiscUnion.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleBadDiscUnion.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SimpleBadDiscUnion.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SimpleBadDiscUnion.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleBadDiscUnion.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_second = TypeObjectUtils::build_common_union_member(member_id_second, member_flags_second, type_ids_SimpleBadDiscUnion.type_identifier1(), - label_seq_second); - } - else if (EK_COMPLETE == type_ids_SimpleBadDiscUnion.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SimpleBadDiscUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleBadDiscUnion.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SimpleBadDiscUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleBadDiscUnion.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SimpleBadDiscUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleBadDiscUnion.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SimpleBadDiscUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleBadDiscUnion.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SimpleBadDiscUnion.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SimpleBadDiscUnion.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleBadDiscUnion.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SimpleBadDiscUnion.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SimpleBadDiscUnion.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleBadDiscUnion.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_second = TypeObjectUtils::build_common_union_member(member_id_second, member_flags_second, type_ids_SimpleBadDiscUnion.type_identifier2(), - label_seq_second); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Union second member TypeIdentifier inconsistent."); - return; - } - MemberName name_second = "second"; - eprosima::fastcdr::optional member_ann_builtin_second; - ann_custom_SimpleBadDiscUnion.reset(); - CompleteMemberDetail detail_second = TypeObjectUtils::build_complete_member_detail(name_second, member_ann_builtin_second, ann_custom_SimpleBadDiscUnion); - CompleteUnionMember member_second = TypeObjectUtils::build_complete_union_member(common_second, detail_second); - TypeObjectUtils::add_complete_union_member(member_seq_SimpleBadDiscUnion, member_second); - } - CompleteUnionType union_type_SimpleBadDiscUnion = TypeObjectUtils::build_complete_union_type(union_flags_SimpleBadDiscUnion, header_SimpleBadDiscUnion, discriminator_SimpleBadDiscUnion, - member_seq_SimpleBadDiscUnion); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_union_type_object(union_type_SimpleBadDiscUnion, type_name_SimpleBadDiscUnion.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "SimpleBadDiscUnion already registered in TypeObjectRegistry for a different type."); - } - return_code_SimpleBadDiscUnion = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "SimpleBadDiscUnion", type_ids_SimpleBadDiscUnion); - if (return_code_SimpleBadDiscUnion != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "SimpleBadDiscUnion: Given Union TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - } - StructMemberFlag member_flags_my_union = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_union; - MemberId member_id_my_union = 0x00000000; - if (EK_COMPLETE == type_ids_SimplBadDiscUnionStruct.type_identifier1()._d() || TK_NONE == type_ids_SimplBadDiscUnionStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SimplBadDiscUnionStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimplBadDiscUnionStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SimplBadDiscUnionStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimplBadDiscUnionStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SimplBadDiscUnionStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimplBadDiscUnionStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SimplBadDiscUnionStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimplBadDiscUnionStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SimplBadDiscUnionStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SimplBadDiscUnionStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimplBadDiscUnionStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SimplBadDiscUnionStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SimplBadDiscUnionStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimplBadDiscUnionStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_union = TypeObjectUtils::build_common_struct_member(member_id_my_union, member_flags_my_union, type_ids_SimplBadDiscUnionStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_SimplBadDiscUnionStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SimplBadDiscUnionStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimplBadDiscUnionStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SimplBadDiscUnionStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimplBadDiscUnionStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SimplBadDiscUnionStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimplBadDiscUnionStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SimplBadDiscUnionStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimplBadDiscUnionStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SimplBadDiscUnionStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SimplBadDiscUnionStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimplBadDiscUnionStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SimplBadDiscUnionStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SimplBadDiscUnionStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimplBadDiscUnionStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_union = TypeObjectUtils::build_common_struct_member(member_id_my_union, member_flags_my_union, type_ids_SimplBadDiscUnionStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_union member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_union = "my_union"; - eprosima::fastcdr::optional member_ann_builtin_my_union; - ann_custom_SimplBadDiscUnionStruct.reset(); - CompleteMemberDetail detail_my_union = TypeObjectUtils::build_complete_member_detail(name_my_union, member_ann_builtin_my_union, ann_custom_SimplBadDiscUnionStruct); - CompleteStructMember member_my_union = TypeObjectUtils::build_complete_struct_member(common_my_union, detail_my_union); - TypeObjectUtils::add_complete_struct_member(member_seq_SimplBadDiscUnionStruct, member_my_union); - } - CompleteStructType struct_type_SimplBadDiscUnionStruct = TypeObjectUtils::build_complete_struct_type(struct_flags_SimplBadDiscUnionStruct, header_SimplBadDiscUnionStruct, member_seq_SimplBadDiscUnionStruct); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_SimplBadDiscUnionStruct, type_name_SimplBadDiscUnionStruct.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "SimplBadDiscUnionStruct already registered in TypeObjectRegistry for a different type."); - } - return_code_SimplBadDiscUnionStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "SimplBadDiscUnionStruct", type_ids_SimplBadDiscUnionStruct); - if (return_code_SimplBadDiscUnionStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "SimplBadDiscUnionStruct: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } -} - diff --git a/test/unittest/xtypes/idl/TypesTypeObjectSupport.hpp b/test/unittest/xtypes/idl/TypesTypeObjectSupport.hpp deleted file mode 100644 index a5fadb6926f..00000000000 --- a/test/unittest/xtypes/idl/TypesTypeObjectSupport.hpp +++ /dev/null @@ -1,334 +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 TypesTypeObjectSupport.hpp - * Header file containing the API required to register the TypeObject representation of the described types in the IDL file - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_TYPES_TYPE_OBJECT_SUPPORT_HPP_ -#define _FAST_DDS_GENERATED_TYPES_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_Types_type_objects(); - -#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC - -/** - * @brief Register MyEnumStruct 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_MyEnumStruct_type_identifier(); -/** - * @brief Register MyBadEnumStruct 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_MyBadEnumStruct_type_identifier(); -/** - * @brief Register MyAliasEnumStruct 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_MyAliasEnumStruct_type_identifier(); -/** - * @brief Register BasicStruct 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_BasicStruct_type_identifier(); -/** - * @brief Register BasicNamesStruct 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_BasicNamesStruct_type_identifier(); -/** - * @brief Register BasicBadStruct 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_BasicBadStruct_type_identifier(); -/** - * @brief Register BasicWideStruct 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_BasicWideStruct_type_identifier(); -/** - * @brief Register BadBasicWideStruct 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_BadBasicWideStruct_type_identifier(); -/** - * @brief Register StringStruct 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_StringStruct_type_identifier(); -/** - * @brief Register LargeStringStruct 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_LargeStringStruct_type_identifier(); -/** - * @brief Register WStringStruct 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_WStringStruct_type_identifier(); -/** - * @brief Register LargeWStringStruct 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_LargeWStringStruct_type_identifier(); -/** - * @brief Register ArrayStruct 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_ArrayStruct_type_identifier(); -/** - * @brief Register ArrayStructEqual 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_ArrayStructEqual_type_identifier(); -/** - * @brief Register ArrayBadStruct 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_ArrayBadStruct_type_identifier(); -/** - * @brief Register ArrayDimensionsStruct 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_ArrayDimensionsStruct_type_identifier(); -/** - * @brief Register ArraySizeStruct 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_ArraySizeStruct_type_identifier(); -/** - * @brief Register SequenceStruct 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_SequenceStruct_type_identifier(); -/** - * @brief Register SequenceStructEqual 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_SequenceStructEqual_type_identifier(); -/** - * @brief Register SequenceBadStruct 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_SequenceBadStruct_type_identifier(); -/** - * @brief Register SequenceBoundsStruct 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_SequenceBoundsStruct_type_identifier(); -/** - * @brief Register SequenceSequenceStruct 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_SequenceSequenceStruct_type_identifier(); -/** - * @brief Register SequenceSequenceBoundsStruct 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_SequenceSequenceBoundsStruct_type_identifier(); -/** - * @brief Register MapStruct 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_MapStruct_type_identifier(); -/** - * @brief Register MapStructEqual 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_MapStructEqual_type_identifier(); -/** - * @brief Register MapBadKeyStruct 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_MapBadKeyStruct_type_identifier(); -/** - * @brief Register MapBadElemStruct 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_MapBadElemStruct_type_identifier(); -/** - * @brief Register MapBoundsStruct 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_MapBoundsStruct_type_identifier(); -/** - * @brief Register MapMapStruct 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_MapMapStruct_type_identifier(); -/** - * @brief Register MapMapBoundsStruct 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_MapMapBoundsStruct_type_identifier(); -/** - * @brief Register SimpleUnion 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_SimpleUnion_type_identifier(); -/** - * @brief Register SimpleUnionNames 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_SimpleUnionNames_type_identifier(); -/** - * @brief Register SimpleTypeUnion 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_SimpleTypeUnion_type_identifier(); -/** - * @brief Register SimpleBadUnion 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_SimpleBadUnion_type_identifier(); -/** - * @brief Register SimpleBadDiscUnion 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_SimpleBadDiscUnion_type_identifier(); -/** - * @brief Register SimpleUnionStruct 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_SimpleUnionStruct_type_identifier(); -/** - * @brief Register SimpleUnionStructEqual 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_SimpleUnionStructEqual_type_identifier(); -/** - * @brief Register SimpleUnionNamesStruct 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_SimpleUnionNamesStruct_type_identifier(); -/** - * @brief Register SimpleTypeUnionStruct 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_SimpleTypeUnionStruct_type_identifier(); -/** - * @brief Register SimpleBadUnionStruct 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_SimpleBadUnionStruct_type_identifier(); -/** - * @brief Register SimplBadDiscUnionStruct 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_SimplBadDiscUnionStruct_type_identifier(); - - -#endif // DOXYGEN_SHOULD_SKIP_THIS_PUBLIC - -#endif // _FAST_DDS_GENERATED_TYPES_TYPE_OBJECT_SUPPORT_HPP_ diff --git a/test/unittest/xtypes/idl/WideEnum.hpp b/test/unittest/xtypes/idl/WideEnum.hpp deleted file mode 100644 index 92649041f03..00000000000 --- a/test/unittest/xtypes/idl/WideEnum.hpp +++ /dev/null @@ -1,796 +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.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_WIDEENUM_HPP_ -#define _FAST_DDS_GENERATED_WIDEENUM_HPP_ - -#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 - -/*! - * @brief This class represents the enumeration MyEnumWide defined by the user in the IDL file. - * @ingroup WideEnum - */ -enum class 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) - { - m_my_enum_wide = x.m_my_enum_wide; - - } - - /*! - * @brief Move constructor. - * @param x Reference to the object MyEnumWideStruct that will be copied. - */ - eProsima_user_DllExport MyEnumWideStruct( - MyEnumWideStruct&& x) noexcept - { - m_my_enum_wide = x.m_my_enum_wide; - } - - /*! - * @brief Copy assignment. - * @param x Reference to the object MyEnumWideStruct that will be copied. - */ - eProsima_user_DllExport MyEnumWideStruct& operator =( - const MyEnumWideStruct& x) - { - - m_my_enum_wide = x.m_my_enum_wide; - - return *this; - } - - /*! - * @brief Move assignment. - * @param x Reference to the object MyEnumWideStruct that will be copied. - */ - eProsima_user_DllExport MyEnumWideStruct& operator =( - MyEnumWideStruct&& x) noexcept - { - - m_my_enum_wide = x.m_my_enum_wide; - return *this; - } - - /*! - * @brief Comparison operator. - * @param x MyEnumWideStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MyEnumWideStruct& x) const - { - return (m_my_enum_wide == x.m_my_enum_wide); - } - - /*! - * @brief Comparison operator. - * @param x MyEnumWideStruct object to compare. - */ - eProsima_user_DllExport bool 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport MyEnumWide 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 - */ - eProsima_user_DllExport MyEnumWide& my_enum_wide() - { - return m_my_enum_wide; - } - - - -private: - - MyEnumWide m_my_enum_wide{MyEnumWide::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() - { - m__d = MyEnumWide::A; - } - - /*! - * @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) - { - m__d = x.m__d; - - switch (m__d) - { - case MyEnumWide::A: - m_first = x.m_first; - break; - - - case MyEnumWide::B: - m_second = x.m_second; - break; - - - case MyEnumWide::D: - m_third = x.m_third; - break; - - default: - break; - } - } - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleWideUnion that will be copied. - */ - eProsima_user_DllExport SimpleWideUnion( - SimpleWideUnion&& x) noexcept - { - m__d = x.m__d; - - switch (m__d) - { - case MyEnumWide::A: - m_first = x.m_first; - break; - - - case MyEnumWide::B: - m_second = x.m_second; - break; - - - case MyEnumWide::D: - m_third = x.m_third; - break; - - default: - break; - } - } - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleWideUnion that will be copied. - */ - eProsima_user_DllExport SimpleWideUnion& operator =( - const SimpleWideUnion& x) - { - m__d = x.m__d; - - switch (m__d) - { - case MyEnumWide::A: - m_first = x.m_first; - break; - - - case MyEnumWide::B: - m_second = x.m_second; - break; - - - case MyEnumWide::D: - m_third = x.m_third; - break; - - default: - break; - } - - return *this; - } - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleWideUnion that will be copied. - */ - eProsima_user_DllExport SimpleWideUnion& operator =( - SimpleWideUnion&& x) noexcept - { - m__d = x.m__d; - - switch (m__d) - { - case MyEnumWide::A: - m_first = x.m_first; - break; - - - case MyEnumWide::B: - m_second = x.m_second; - break; - - - case MyEnumWide::D: - m_third = x.m_third; - break; - - default: - break; - } - - return *this; - } - - /*! - * @brief Comparison operator. - * @param x SimpleWideUnion object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleWideUnion& x) const - { - if (m__d != x.m__d) - { - return false; - } - - switch (m__d) - { - case MyEnumWide::A: - return (m_first == x.m_first); - break; - - - case MyEnumWide::B: - return (m_second == x.m_second); - break; - - - case MyEnumWide::D: - return (m_third == x.m_third); - break; - - default: - break; - } - return false; - } - - /*! - * @brief Comparison operator. - * @param x SimpleWideUnion object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimpleWideUnion& 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( - MyEnumWide __d) - { - bool b = false; - - switch (m__d) - { - case MyEnumWide::A: - switch (__d) - { - case MyEnumWide::A: - b = true; - break; - default: - break; - } - break; - - - case MyEnumWide::B: - switch (__d) - { - case MyEnumWide::B: - b = true; - break; - default: - break; - } - break; - - - case MyEnumWide::D: - switch (__d) - { - case MyEnumWide::D: - b = true; - break; - default: - break; - } - break; - - default: - break; - } - - if (!b) - { - 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 MyEnumWide _d() const - { - return m__d; - } - - /*! - * @brief This function returns a reference to the discriminator. - * @return Reference to the discriminator. - */ - eProsima_user_DllExport MyEnumWide& _d() - { - return m__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) - { - m_first = _first; - m__d = MyEnumWide::A; - - } - - /*! - * @brief This function returns the value of member first - * @return Value of member first - * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t first() const - { - bool b = false; - - switch (m__d) - { - case MyEnumWide::A: - b = true; - break; - default: - break; - } - - if (!b) - { - throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); - } - - return m_first; - } - - /*! - * @brief This function returns a reference to member first - * @return Reference to member first - * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t& first() - { - bool b = false; - - switch (m__d) - { - case MyEnumWide::A: - b = true; - break; - default: - break; - } - - if (!b) - { - throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); - } - - return m_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) - { - m_second = _second; - m__d = MyEnumWide::B; - - } - - /*! - * @brief This function returns the value of member second - * @return Value of member second - * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t second() const - { - bool b = false; - - switch (m__d) - { - case MyEnumWide::B: - b = true; - break; - default: - break; - } - - if (!b) - { - throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); - } - - return m_second; - } - - /*! - * @brief This function returns a reference to member second - * @return Reference to member second - * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t& second() - { - bool b = false; - - switch (m__d) - { - case MyEnumWide::B: - b = true; - break; - default: - break; - } - - if (!b) - { - throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); - } - - return m_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) - { - m_third = _third; - m__d = MyEnumWide::D; - - } - - /*! - * @brief This function returns the value of member third - * @return Value of member third - * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport uint8_t third() const - { - bool b = false; - - switch (m__d) - { - case MyEnumWide::D: - b = true; - break; - default: - break; - } - - if (!b) - { - throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); - } - - return m_third; - } - - /*! - * @brief This function returns a reference to member third - * @return Reference to member third - * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport uint8_t& third() - { - bool b = false; - - switch (m__d) - { - case MyEnumWide::D: - b = true; - break; - default: - break; - } - - if (!b) - { - throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); - } - - return m_third; - } - - - -private: - - MyEnumWide 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) - { - m_my_union = x.m_my_union; - - } - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleWideUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleWideUnionStruct( - SimpleWideUnionStruct&& x) noexcept - { - m_my_union = std::move(x.m_my_union); - } - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleWideUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleWideUnionStruct& operator =( - const SimpleWideUnionStruct& x) - { - - m_my_union = x.m_my_union; - - return *this; - } - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleWideUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleWideUnionStruct& operator =( - SimpleWideUnionStruct&& x) noexcept - { - - m_my_union = std::move(x.m_my_union); - return *this; - } - - /*! - * @brief Comparison operator. - * @param x SimpleWideUnionStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleWideUnionStruct& x) const - { - return (m_my_union == x.m_my_union); - } - - /*! - * @brief Comparison operator. - * @param x SimpleWideUnionStruct object to compare. - */ - eProsima_user_DllExport bool 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport void 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 - */ - eProsima_user_DllExport const SimpleWideUnion& my_union() const - { - return m_my_union; - } - - /*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ - eProsima_user_DllExport SimpleWideUnion& my_union() - { - return m_my_union; - } - - - -private: - - SimpleWideUnion m_my_union; - -}; - -#endif // _FAST_DDS_GENERATED_WIDEENUM_HPP_ - - diff --git a/test/unittest/xtypes/idl/WideEnum.idl b/test/unittest/xtypes/idl/WideEnum.idl deleted file mode 100644 index 1542b9662fb..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 (MyEnumWide) -{ - case A: - long first; - case B: - long long second; - case D: - octet third; -}; - -struct SimpleWideUnionStruct -{ - SimpleWideUnion my_union; -}; diff --git a/test/unittest/xtypes/idl/WideEnumCdrAux.hpp b/test/unittest/xtypes/idl/WideEnumCdrAux.hpp deleted file mode 100644 index 60c1fcd16a3..00000000000 --- a/test/unittest/xtypes/idl/WideEnumCdrAux.hpp +++ /dev/null @@ -1,56 +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.hpp" - -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 072b5644681..00000000000 --- a/test/unittest/xtypes/idl/WideEnumCdrAux.ipp +++ /dev/null @@ -1,314 +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 MyEnumWide::A: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.first(), current_alignment); - break; - - case MyEnumWide::B: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), - data.second(), current_alignment); - break; - - case MyEnumWide::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 MyEnumWide::A: - scdr << eprosima::fastcdr::MemberId(1) << data.first(); - break; - - case MyEnumWide::B: - scdr << eprosima::fastcdr::MemberId(2) << data.second(); - break; - - case MyEnumWide::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 MyEnumWide::A: - dcdr >> data.first(); - break; - - case MyEnumWide::B: - dcdr >> data.second(); - break; - - case MyEnumWide::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 b3a4af7f4a8..00000000000 --- a/test/unittest/xtypes/idl/WideEnumPubSubTypes.cxx +++ /dev/null @@ -1,423 +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 "WideEnumPubSubTypes.h" - -#include -#include - -#include "WideEnumCdrAux.hpp" -#include "WideEnumTypeObjectSupport.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; -} - -void MyEnumWideStructPubSubType::register_type_object_representation() const -{ - register_WideEnum_type_objects(); -} - - -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; -} - -void SimpleWideUnionStructPubSubType::register_type_object_representation() const -{ - register_WideEnum_type_objects(); -} - - -// Include auxiliary functions like for serializing/deserializing. -#include "WideEnumCdrAux.ipp" diff --git a/test/unittest/xtypes/idl/WideEnumPubSubTypes.h b/test/unittest/xtypes/idl/WideEnumPubSubTypes.h deleted file mode 100644 index 09d58b47cb3..00000000000 --- a/test/unittest/xtypes/idl/WideEnumPubSubTypes.h +++ /dev/null @@ -1,225 +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.hpp" - - -#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; - - //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 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; - - //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; - -}; - -#endif // _FAST_DDS_GENERATED_WIDEENUM_PUBSUBTYPES_H_ - diff --git a/test/unittest/xtypes/idl/WideEnumTypeObjectSupport.cxx b/test/unittest/xtypes/idl/WideEnumTypeObjectSupport.cxx deleted file mode 100644 index 1e816341fa3..00000000000 --- a/test/unittest/xtypes/idl/WideEnumTypeObjectSupport.cxx +++ /dev/null @@ -1,964 +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 WideEnumTypeObjectSupport.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 "WideEnumTypeObjectSupport.hpp" - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "WideEnum.hpp" - - -using namespace eprosima::fastdds::dds::xtypes; - -void register_WideEnum_type_objects() -{ - static std::once_flag once_flag; - std::call_once(once_flag, []() - { - register_MyEnumWideStruct_type_identifier(); - - register_SimpleWideUnion_type_identifier(); - - register_SimpleWideUnionStruct_type_identifier(); - - }); -} - -void register_MyEnumWideStruct_type_identifier() -{ - { - StructTypeFlag struct_flags_MyEnumWideStruct = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_MyEnumWideStruct; - TypeIdentifierPair type_ids_MyEnumWideStruct; - QualifiedTypeName type_name_MyEnumWideStruct = "MyEnumWideStruct"; - eprosima::fastcdr::optional type_ann_builtin_MyEnumWideStruct; - eprosima::fastcdr::optional ann_custom_MyEnumWideStruct; - CompleteTypeDetail detail_MyEnumWideStruct = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_MyEnumWideStruct, ann_custom_MyEnumWideStruct, type_name_MyEnumWideStruct.to_string()); - CompleteStructHeader header_MyEnumWideStruct; - header_MyEnumWideStruct = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_MyEnumWideStruct); - CompleteStructMemberSeq member_seq_MyEnumWideStruct; - { - return_code_MyEnumWideStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyEnumWide", type_ids_MyEnumWideStruct); - - if (return_code_MyEnumWideStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EnumTypeFlag enum_flags_MyEnumWide = 0; - BitBound bit_bound_MyEnumWide = 32; - CommonEnumeratedHeader common_MyEnumWide = TypeObjectUtils::build_common_enumerated_header(bit_bound_MyEnumWide); - QualifiedTypeName type_name_MyEnumWide = "MyEnumWide"; - eprosima::fastcdr::optional type_ann_builtin_MyEnumWide; - eprosima::fastcdr::optional ann_custom_MyEnumWide; - CompleteTypeDetail detail_MyEnumWide = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_MyEnumWide, ann_custom_MyEnumWide, type_name_MyEnumWide.to_string()); - CompleteEnumeratedHeader header_MyEnumWide = TypeObjectUtils::build_complete_enumerated_header(common_MyEnumWide, detail_MyEnumWide); - CompleteEnumeratedLiteralSeq literal_seq_MyEnumWide; - { - EnumeratedLiteralFlag flags_A = TypeObjectUtils::build_enumerated_literal_flag(false); - CommonEnumeratedLiteral common_A = TypeObjectUtils::build_common_enumerated_literal(0, flags_A); - eprosima::fastcdr::optional member_ann_builtin_A; - ann_custom_MyEnumWide.reset(); - MemberName name_A = "A"; - CompleteMemberDetail detail_A = TypeObjectUtils::build_complete_member_detail(name_A, member_ann_builtin_A, ann_custom_MyEnumWide); - CompleteEnumeratedLiteral literal_A = TypeObjectUtils::build_complete_enumerated_literal(common_A, detail_A); - TypeObjectUtils::add_complete_enumerated_literal(literal_seq_MyEnumWide, literal_A); - } - { - EnumeratedLiteralFlag flags_B = TypeObjectUtils::build_enumerated_literal_flag(false); - CommonEnumeratedLiteral common_B = TypeObjectUtils::build_common_enumerated_literal(1, flags_B); - eprosima::fastcdr::optional member_ann_builtin_B; - ann_custom_MyEnumWide.reset(); - MemberName name_B = "B"; - CompleteMemberDetail detail_B = TypeObjectUtils::build_complete_member_detail(name_B, member_ann_builtin_B, ann_custom_MyEnumWide); - CompleteEnumeratedLiteral literal_B = TypeObjectUtils::build_complete_enumerated_literal(common_B, detail_B); - TypeObjectUtils::add_complete_enumerated_literal(literal_seq_MyEnumWide, literal_B); - } - { - EnumeratedLiteralFlag flags_C = TypeObjectUtils::build_enumerated_literal_flag(false); - CommonEnumeratedLiteral common_C = TypeObjectUtils::build_common_enumerated_literal(2, flags_C); - eprosima::fastcdr::optional member_ann_builtin_C; - ann_custom_MyEnumWide.reset(); - MemberName name_C = "C"; - CompleteMemberDetail detail_C = TypeObjectUtils::build_complete_member_detail(name_C, member_ann_builtin_C, ann_custom_MyEnumWide); - CompleteEnumeratedLiteral literal_C = TypeObjectUtils::build_complete_enumerated_literal(common_C, detail_C); - TypeObjectUtils::add_complete_enumerated_literal(literal_seq_MyEnumWide, literal_C); - } - { - EnumeratedLiteralFlag flags_D = TypeObjectUtils::build_enumerated_literal_flag(false); - CommonEnumeratedLiteral common_D = TypeObjectUtils::build_common_enumerated_literal(3, flags_D); - eprosima::fastcdr::optional member_ann_builtin_D; - ann_custom_MyEnumWide.reset(); - MemberName name_D = "D"; - CompleteMemberDetail detail_D = TypeObjectUtils::build_complete_member_detail(name_D, member_ann_builtin_D, ann_custom_MyEnumWide); - CompleteEnumeratedLiteral literal_D = TypeObjectUtils::build_complete_enumerated_literal(common_D, detail_D); - TypeObjectUtils::add_complete_enumerated_literal(literal_seq_MyEnumWide, literal_D); - } - CompleteEnumeratedType enumerated_type_MyEnumWide = TypeObjectUtils::build_complete_enumerated_type(enum_flags_MyEnumWide, header_MyEnumWide, - literal_seq_MyEnumWide); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_enumerated_type_object(enumerated_type_MyEnumWide, type_name_MyEnumWide.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyEnumWide already registered in TypeObjectRegistry for a different type."); - } - return_code_MyEnumWideStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyEnumWide", type_ids_MyEnumWideStruct); - if (return_code_MyEnumWideStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyEnumWide: Given Enum TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - StructMemberFlag member_flags_my_enum_wide = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_enum_wide; - MemberId member_id_my_enum_wide = 0x00000000; - if (EK_COMPLETE == type_ids_MyEnumWideStruct.type_identifier1()._d() || TK_NONE == type_ids_MyEnumWideStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_MyEnumWideStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MyEnumWideStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_MyEnumWideStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MyEnumWideStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_MyEnumWideStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MyEnumWideStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_MyEnumWideStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_MyEnumWideStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_MyEnumWideStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_MyEnumWideStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MyEnumWideStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_MyEnumWideStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_MyEnumWideStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MyEnumWideStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_enum_wide = TypeObjectUtils::build_common_struct_member(member_id_my_enum_wide, member_flags_my_enum_wide, type_ids_MyEnumWideStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_MyEnumWideStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_MyEnumWideStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MyEnumWideStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_MyEnumWideStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MyEnumWideStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_MyEnumWideStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MyEnumWideStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_MyEnumWideStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_MyEnumWideStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_MyEnumWideStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_MyEnumWideStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MyEnumWideStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_MyEnumWideStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_MyEnumWideStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_MyEnumWideStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_enum_wide = TypeObjectUtils::build_common_struct_member(member_id_my_enum_wide, member_flags_my_enum_wide, type_ids_MyEnumWideStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_enum_wide member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_enum_wide = "my_enum_wide"; - eprosima::fastcdr::optional member_ann_builtin_my_enum_wide; - ann_custom_MyEnumWideStruct.reset(); - CompleteMemberDetail detail_my_enum_wide = TypeObjectUtils::build_complete_member_detail(name_my_enum_wide, member_ann_builtin_my_enum_wide, ann_custom_MyEnumWideStruct); - CompleteStructMember member_my_enum_wide = TypeObjectUtils::build_complete_struct_member(common_my_enum_wide, detail_my_enum_wide); - TypeObjectUtils::add_complete_struct_member(member_seq_MyEnumWideStruct, member_my_enum_wide); - } - CompleteStructType struct_type_MyEnumWideStruct = TypeObjectUtils::build_complete_struct_type(struct_flags_MyEnumWideStruct, header_MyEnumWideStruct, member_seq_MyEnumWideStruct); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_MyEnumWideStruct, type_name_MyEnumWideStruct.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyEnumWideStruct already registered in TypeObjectRegistry for a different type."); - } - return_code_MyEnumWideStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyEnumWideStruct", type_ids_MyEnumWideStruct); - if (return_code_MyEnumWideStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyEnumWideStruct: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } -} -void register_SimpleWideUnion_type_identifier() -{ - { - ReturnCode_t return_code_SimpleWideUnion; - TypeIdentifierPair type_ids_SimpleWideUnion; - UnionTypeFlag union_flags_SimpleWideUnion = TypeObjectUtils::build_union_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - QualifiedTypeName type_name_SimpleWideUnion = "SimpleWideUnion"; - eprosima::fastcdr::optional type_ann_builtin_SimpleWideUnion; - eprosima::fastcdr::optional ann_custom_SimpleWideUnion; - CompleteTypeDetail detail_SimpleWideUnion = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_SimpleWideUnion, ann_custom_SimpleWideUnion, type_name_SimpleWideUnion.to_string()); - CompleteUnionHeader header_SimpleWideUnion = TypeObjectUtils::build_complete_union_header(detail_SimpleWideUnion); - UnionDiscriminatorFlag member_flags_SimpleWideUnion = TypeObjectUtils::build_union_discriminator_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false); - return_code_SimpleWideUnion = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyEnumWide", type_ids_SimpleWideUnion); - - if (return_code_SimpleWideUnion != eprosima::fastdds::dds::RETCODE_OK) - { - EnumTypeFlag enum_flags_MyEnumWide = 0; - BitBound bit_bound_MyEnumWide = 32; - CommonEnumeratedHeader common_MyEnumWide = TypeObjectUtils::build_common_enumerated_header(bit_bound_MyEnumWide); - QualifiedTypeName type_name_MyEnumWide = "MyEnumWide"; - eprosima::fastcdr::optional type_ann_builtin_MyEnumWide; - eprosima::fastcdr::optional ann_custom_MyEnumWide; - CompleteTypeDetail detail_MyEnumWide = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_MyEnumWide, ann_custom_MyEnumWide, type_name_MyEnumWide.to_string()); - CompleteEnumeratedHeader header_MyEnumWide = TypeObjectUtils::build_complete_enumerated_header(common_MyEnumWide, detail_MyEnumWide); - CompleteEnumeratedLiteralSeq literal_seq_MyEnumWide; - { - EnumeratedLiteralFlag flags_A = TypeObjectUtils::build_enumerated_literal_flag(false); - CommonEnumeratedLiteral common_A = TypeObjectUtils::build_common_enumerated_literal(0, flags_A); - eprosima::fastcdr::optional member_ann_builtin_A; - ann_custom_MyEnumWide.reset(); - MemberName name_A = "A"; - CompleteMemberDetail detail_A = TypeObjectUtils::build_complete_member_detail(name_A, member_ann_builtin_A, ann_custom_MyEnumWide); - CompleteEnumeratedLiteral literal_A = TypeObjectUtils::build_complete_enumerated_literal(common_A, detail_A); - TypeObjectUtils::add_complete_enumerated_literal(literal_seq_MyEnumWide, literal_A); - } - { - EnumeratedLiteralFlag flags_B = TypeObjectUtils::build_enumerated_literal_flag(false); - CommonEnumeratedLiteral common_B = TypeObjectUtils::build_common_enumerated_literal(1, flags_B); - eprosima::fastcdr::optional member_ann_builtin_B; - ann_custom_MyEnumWide.reset(); - MemberName name_B = "B"; - CompleteMemberDetail detail_B = TypeObjectUtils::build_complete_member_detail(name_B, member_ann_builtin_B, ann_custom_MyEnumWide); - CompleteEnumeratedLiteral literal_B = TypeObjectUtils::build_complete_enumerated_literal(common_B, detail_B); - TypeObjectUtils::add_complete_enumerated_literal(literal_seq_MyEnumWide, literal_B); - } - { - EnumeratedLiteralFlag flags_C = TypeObjectUtils::build_enumerated_literal_flag(false); - CommonEnumeratedLiteral common_C = TypeObjectUtils::build_common_enumerated_literal(2, flags_C); - eprosima::fastcdr::optional member_ann_builtin_C; - ann_custom_MyEnumWide.reset(); - MemberName name_C = "C"; - CompleteMemberDetail detail_C = TypeObjectUtils::build_complete_member_detail(name_C, member_ann_builtin_C, ann_custom_MyEnumWide); - CompleteEnumeratedLiteral literal_C = TypeObjectUtils::build_complete_enumerated_literal(common_C, detail_C); - TypeObjectUtils::add_complete_enumerated_literal(literal_seq_MyEnumWide, literal_C); - } - { - EnumeratedLiteralFlag flags_D = TypeObjectUtils::build_enumerated_literal_flag(false); - CommonEnumeratedLiteral common_D = TypeObjectUtils::build_common_enumerated_literal(3, flags_D); - eprosima::fastcdr::optional member_ann_builtin_D; - ann_custom_MyEnumWide.reset(); - MemberName name_D = "D"; - CompleteMemberDetail detail_D = TypeObjectUtils::build_complete_member_detail(name_D, member_ann_builtin_D, ann_custom_MyEnumWide); - CompleteEnumeratedLiteral literal_D = TypeObjectUtils::build_complete_enumerated_literal(common_D, detail_D); - TypeObjectUtils::add_complete_enumerated_literal(literal_seq_MyEnumWide, literal_D); - } - CompleteEnumeratedType enumerated_type_MyEnumWide = TypeObjectUtils::build_complete_enumerated_type(enum_flags_MyEnumWide, header_MyEnumWide, - literal_seq_MyEnumWide); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_enumerated_type_object(enumerated_type_MyEnumWide, type_name_MyEnumWide.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyEnumWide already registered in TypeObjectRegistry for a different type."); - } - return_code_SimpleWideUnion = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyEnumWide", type_ids_SimpleWideUnion); - if (return_code_SimpleWideUnion != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyEnumWide: Given Enum TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - CommonDiscriminatorMember common_SimpleWideUnion; - if (EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier1()._d() || TK_NONE == type_ids_SimpleWideUnion.type_identifier2()._d()) - { - common_SimpleWideUnion = TypeObjectUtils::build_common_discriminator_member(member_flags_SimpleWideUnion, type_ids_SimpleWideUnion.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier2()._d()) - { - common_SimpleWideUnion = TypeObjectUtils::build_common_discriminator_member(member_flags_SimpleWideUnion, type_ids_SimpleWideUnion.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "SimpleWideUnion discriminator TypeIdentifier inconsistent."); - return; - } - type_ann_builtin_SimpleWideUnion.reset(); - ann_custom_SimpleWideUnion.reset(); - CompleteDiscriminatorMember discriminator_SimpleWideUnion = TypeObjectUtils::build_complete_discriminator_member(common_SimpleWideUnion, - type_ann_builtin_SimpleWideUnion, ann_custom_SimpleWideUnion); - CompleteUnionMemberSeq member_seq_SimpleWideUnion; - { - return_code_SimpleWideUnion = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_SimpleWideUnion); - - if (return_code_SimpleWideUnion != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "first Union member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - UnionMemberFlag member_flags_first = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false); - UnionCaseLabelSeq label_seq_first; - TypeObjectUtils::add_union_case_label(label_seq_first, static_cast(MyEnumWide::A)); - CommonUnionMember common_first; - MemberId member_id_first = 0x00000001; - if (EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier1()._d() || TK_NONE == type_ids_SimpleWideUnion.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SimpleWideUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SimpleWideUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SimpleWideUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SimpleWideUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SimpleWideUnion.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SimpleWideUnion.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_first = TypeObjectUtils::build_common_union_member(member_id_first, member_flags_first, type_ids_SimpleWideUnion.type_identifier1(), - label_seq_first); - } - else if (EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SimpleWideUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SimpleWideUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SimpleWideUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SimpleWideUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SimpleWideUnion.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SimpleWideUnion.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_first = TypeObjectUtils::build_common_union_member(member_id_first, member_flags_first, type_ids_SimpleWideUnion.type_identifier2(), - label_seq_first); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Union first member TypeIdentifier inconsistent."); - return; - } - MemberName name_first = "first"; - eprosima::fastcdr::optional member_ann_builtin_first; - ann_custom_SimpleWideUnion.reset(); - CompleteMemberDetail detail_first = TypeObjectUtils::build_complete_member_detail(name_first, member_ann_builtin_first, ann_custom_SimpleWideUnion); - CompleteUnionMember member_first = TypeObjectUtils::build_complete_union_member(common_first, detail_first); - TypeObjectUtils::add_complete_union_member(member_seq_SimpleWideUnion, member_first); - } - { - return_code_SimpleWideUnion = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int64_t", type_ids_SimpleWideUnion); - - if (return_code_SimpleWideUnion != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "second Union member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - UnionMemberFlag member_flags_second = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false); - UnionCaseLabelSeq label_seq_second; - TypeObjectUtils::add_union_case_label(label_seq_second, static_cast(MyEnumWide::B)); - CommonUnionMember common_second; - MemberId member_id_second = 0x00000002; - if (EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier1()._d() || TK_NONE == type_ids_SimpleWideUnion.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SimpleWideUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SimpleWideUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SimpleWideUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SimpleWideUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SimpleWideUnion.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SimpleWideUnion.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_second = TypeObjectUtils::build_common_union_member(member_id_second, member_flags_second, type_ids_SimpleWideUnion.type_identifier1(), - label_seq_second); - } - else if (EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SimpleWideUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SimpleWideUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SimpleWideUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SimpleWideUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SimpleWideUnion.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SimpleWideUnion.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_second = TypeObjectUtils::build_common_union_member(member_id_second, member_flags_second, type_ids_SimpleWideUnion.type_identifier2(), - label_seq_second); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Union second member TypeIdentifier inconsistent."); - return; - } - MemberName name_second = "second"; - eprosima::fastcdr::optional member_ann_builtin_second; - ann_custom_SimpleWideUnion.reset(); - CompleteMemberDetail detail_second = TypeObjectUtils::build_complete_member_detail(name_second, member_ann_builtin_second, ann_custom_SimpleWideUnion); - CompleteUnionMember member_second = TypeObjectUtils::build_complete_union_member(common_second, detail_second); - TypeObjectUtils::add_complete_union_member(member_seq_SimpleWideUnion, member_second); - } - { - return_code_SimpleWideUnion = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_byte", type_ids_SimpleWideUnion); - - if (return_code_SimpleWideUnion != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "third Union member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - UnionMemberFlag member_flags_third = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false); - UnionCaseLabelSeq label_seq_third; - TypeObjectUtils::add_union_case_label(label_seq_third, static_cast(MyEnumWide::D)); - CommonUnionMember common_third; - MemberId member_id_third = 0x00000003; - if (EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier1()._d() || TK_NONE == type_ids_SimpleWideUnion.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SimpleWideUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SimpleWideUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SimpleWideUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SimpleWideUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SimpleWideUnion.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SimpleWideUnion.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_third = TypeObjectUtils::build_common_union_member(member_id_third, member_flags_third, type_ids_SimpleWideUnion.type_identifier1(), - label_seq_third); - } - else if (EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SimpleWideUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SimpleWideUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SimpleWideUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SimpleWideUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SimpleWideUnion.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SimpleWideUnion.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_third = TypeObjectUtils::build_common_union_member(member_id_third, member_flags_third, type_ids_SimpleWideUnion.type_identifier2(), - label_seq_third); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Union third member TypeIdentifier inconsistent."); - return; - } - MemberName name_third = "third"; - eprosima::fastcdr::optional member_ann_builtin_third; - ann_custom_SimpleWideUnion.reset(); - CompleteMemberDetail detail_third = TypeObjectUtils::build_complete_member_detail(name_third, member_ann_builtin_third, ann_custom_SimpleWideUnion); - CompleteUnionMember member_third = TypeObjectUtils::build_complete_union_member(common_third, detail_third); - TypeObjectUtils::add_complete_union_member(member_seq_SimpleWideUnion, member_third); - } - CompleteUnionType union_type_SimpleWideUnion = TypeObjectUtils::build_complete_union_type(union_flags_SimpleWideUnion, header_SimpleWideUnion, discriminator_SimpleWideUnion, - member_seq_SimpleWideUnion); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_union_type_object(union_type_SimpleWideUnion, type_name_SimpleWideUnion.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "SimpleWideUnion already registered in TypeObjectRegistry for a different type."); - } - return_code_SimpleWideUnion = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "SimpleWideUnion", type_ids_SimpleWideUnion); - if (return_code_SimpleWideUnion != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "SimpleWideUnion: Given Union TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } -} -void register_SimpleWideUnionStruct_type_identifier() -{ - { - StructTypeFlag struct_flags_SimpleWideUnionStruct = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - ReturnCode_t return_code_SimpleWideUnionStruct; - TypeIdentifierPair type_ids_SimpleWideUnionStruct; - QualifiedTypeName type_name_SimpleWideUnionStruct = "SimpleWideUnionStruct"; - eprosima::fastcdr::optional type_ann_builtin_SimpleWideUnionStruct; - eprosima::fastcdr::optional ann_custom_SimpleWideUnionStruct; - CompleteTypeDetail detail_SimpleWideUnionStruct = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_SimpleWideUnionStruct, ann_custom_SimpleWideUnionStruct, type_name_SimpleWideUnionStruct.to_string()); - CompleteStructHeader header_SimpleWideUnionStruct; - header_SimpleWideUnionStruct = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_SimpleWideUnionStruct); - CompleteStructMemberSeq member_seq_SimpleWideUnionStruct; - { - return_code_SimpleWideUnionStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "SimpleWideUnion", type_ids_SimpleWideUnionStruct); - - if (return_code_SimpleWideUnionStruct != eprosima::fastdds::dds::RETCODE_OK) - { - { - ReturnCode_t return_code_SimpleWideUnion; - TypeIdentifierPair type_ids_SimpleWideUnion; - UnionTypeFlag union_flags_SimpleWideUnion = TypeObjectUtils::build_union_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, - false, false); - QualifiedTypeName type_name_SimpleWideUnion = "SimpleWideUnion"; - eprosima::fastcdr::optional type_ann_builtin_SimpleWideUnion; - eprosima::fastcdr::optional ann_custom_SimpleWideUnion; - CompleteTypeDetail detail_SimpleWideUnion = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_SimpleWideUnion, ann_custom_SimpleWideUnion, type_name_SimpleWideUnion.to_string()); - CompleteUnionHeader header_SimpleWideUnion = TypeObjectUtils::build_complete_union_header(detail_SimpleWideUnion); - UnionDiscriminatorFlag member_flags_SimpleWideUnion = TypeObjectUtils::build_union_discriminator_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false); - return_code_SimpleWideUnion = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyEnumWide", type_ids_SimpleWideUnion); - - if (return_code_SimpleWideUnion != eprosima::fastdds::dds::RETCODE_OK) - { - EnumTypeFlag enum_flags_MyEnumWide = 0; - BitBound bit_bound_MyEnumWide = 32; - CommonEnumeratedHeader common_MyEnumWide = TypeObjectUtils::build_common_enumerated_header(bit_bound_MyEnumWide); - QualifiedTypeName type_name_MyEnumWide = "MyEnumWide"; - eprosima::fastcdr::optional type_ann_builtin_MyEnumWide; - eprosima::fastcdr::optional ann_custom_MyEnumWide; - CompleteTypeDetail detail_MyEnumWide = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_MyEnumWide, ann_custom_MyEnumWide, type_name_MyEnumWide.to_string()); - CompleteEnumeratedHeader header_MyEnumWide = TypeObjectUtils::build_complete_enumerated_header(common_MyEnumWide, detail_MyEnumWide); - CompleteEnumeratedLiteralSeq literal_seq_MyEnumWide; - { - EnumeratedLiteralFlag flags_A = TypeObjectUtils::build_enumerated_literal_flag(false); - CommonEnumeratedLiteral common_A = TypeObjectUtils::build_common_enumerated_literal(0, flags_A); - eprosima::fastcdr::optional member_ann_builtin_A; - ann_custom_MyEnumWide.reset(); - MemberName name_A = "A"; - CompleteMemberDetail detail_A = TypeObjectUtils::build_complete_member_detail(name_A, member_ann_builtin_A, ann_custom_MyEnumWide); - CompleteEnumeratedLiteral literal_A = TypeObjectUtils::build_complete_enumerated_literal(common_A, detail_A); - TypeObjectUtils::add_complete_enumerated_literal(literal_seq_MyEnumWide, literal_A); - } - { - EnumeratedLiteralFlag flags_B = TypeObjectUtils::build_enumerated_literal_flag(false); - CommonEnumeratedLiteral common_B = TypeObjectUtils::build_common_enumerated_literal(1, flags_B); - eprosima::fastcdr::optional member_ann_builtin_B; - ann_custom_MyEnumWide.reset(); - MemberName name_B = "B"; - CompleteMemberDetail detail_B = TypeObjectUtils::build_complete_member_detail(name_B, member_ann_builtin_B, ann_custom_MyEnumWide); - CompleteEnumeratedLiteral literal_B = TypeObjectUtils::build_complete_enumerated_literal(common_B, detail_B); - TypeObjectUtils::add_complete_enumerated_literal(literal_seq_MyEnumWide, literal_B); - } - { - EnumeratedLiteralFlag flags_C = TypeObjectUtils::build_enumerated_literal_flag(false); - CommonEnumeratedLiteral common_C = TypeObjectUtils::build_common_enumerated_literal(2, flags_C); - eprosima::fastcdr::optional member_ann_builtin_C; - ann_custom_MyEnumWide.reset(); - MemberName name_C = "C"; - CompleteMemberDetail detail_C = TypeObjectUtils::build_complete_member_detail(name_C, member_ann_builtin_C, ann_custom_MyEnumWide); - CompleteEnumeratedLiteral literal_C = TypeObjectUtils::build_complete_enumerated_literal(common_C, detail_C); - TypeObjectUtils::add_complete_enumerated_literal(literal_seq_MyEnumWide, literal_C); - } - { - EnumeratedLiteralFlag flags_D = TypeObjectUtils::build_enumerated_literal_flag(false); - CommonEnumeratedLiteral common_D = TypeObjectUtils::build_common_enumerated_literal(3, flags_D); - eprosima::fastcdr::optional member_ann_builtin_D; - ann_custom_MyEnumWide.reset(); - MemberName name_D = "D"; - CompleteMemberDetail detail_D = TypeObjectUtils::build_complete_member_detail(name_D, member_ann_builtin_D, ann_custom_MyEnumWide); - CompleteEnumeratedLiteral literal_D = TypeObjectUtils::build_complete_enumerated_literal(common_D, detail_D); - TypeObjectUtils::add_complete_enumerated_literal(literal_seq_MyEnumWide, literal_D); - } - CompleteEnumeratedType enumerated_type_MyEnumWide = TypeObjectUtils::build_complete_enumerated_type(enum_flags_MyEnumWide, header_MyEnumWide, - literal_seq_MyEnumWide); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_enumerated_type_object(enumerated_type_MyEnumWide, type_name_MyEnumWide.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyEnumWide already registered in TypeObjectRegistry for a different type."); - } - return_code_SimpleWideUnion = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "MyEnumWide", type_ids_SimpleWideUnion); - if (return_code_SimpleWideUnion != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "MyEnumWide: Given Enum TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - CommonDiscriminatorMember common_SimpleWideUnion; - if (EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier1()._d() || TK_NONE == type_ids_SimpleWideUnion.type_identifier2()._d()) - { - common_SimpleWideUnion = TypeObjectUtils::build_common_discriminator_member(member_flags_SimpleWideUnion, type_ids_SimpleWideUnion.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier2()._d()) - { - common_SimpleWideUnion = TypeObjectUtils::build_common_discriminator_member(member_flags_SimpleWideUnion, type_ids_SimpleWideUnion.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "SimpleWideUnion discriminator TypeIdentifier inconsistent."); - return; - } - type_ann_builtin_SimpleWideUnion.reset(); - ann_custom_SimpleWideUnion.reset(); - CompleteDiscriminatorMember discriminator_SimpleWideUnion = TypeObjectUtils::build_complete_discriminator_member(common_SimpleWideUnion, - type_ann_builtin_SimpleWideUnion, ann_custom_SimpleWideUnion); - CompleteUnionMemberSeq member_seq_SimpleWideUnion; - { - return_code_SimpleWideUnion = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int32_t", type_ids_SimpleWideUnion); - - if (return_code_SimpleWideUnion != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "first Union member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - UnionMemberFlag member_flags_first = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false); - UnionCaseLabelSeq label_seq_first; - TypeObjectUtils::add_union_case_label(label_seq_first, static_cast(MyEnumWide::A)); - CommonUnionMember common_first; - MemberId member_id_first = 0x00000001; - if (EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier1()._d() || TK_NONE == type_ids_SimpleWideUnion.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SimpleWideUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SimpleWideUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SimpleWideUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SimpleWideUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SimpleWideUnion.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SimpleWideUnion.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_first = TypeObjectUtils::build_common_union_member(member_id_first, member_flags_first, type_ids_SimpleWideUnion.type_identifier1(), - label_seq_first); - } - else if (EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SimpleWideUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SimpleWideUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SimpleWideUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SimpleWideUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SimpleWideUnion.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SimpleWideUnion.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_first = TypeObjectUtils::build_common_union_member(member_id_first, member_flags_first, type_ids_SimpleWideUnion.type_identifier2(), - label_seq_first); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Union first member TypeIdentifier inconsistent."); - return; - } - MemberName name_first = "first"; - eprosima::fastcdr::optional member_ann_builtin_first; - ann_custom_SimpleWideUnion.reset(); - CompleteMemberDetail detail_first = TypeObjectUtils::build_complete_member_detail(name_first, member_ann_builtin_first, ann_custom_SimpleWideUnion); - CompleteUnionMember member_first = TypeObjectUtils::build_complete_union_member(common_first, detail_first); - TypeObjectUtils::add_complete_union_member(member_seq_SimpleWideUnion, member_first); - } - { - return_code_SimpleWideUnion = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_int64_t", type_ids_SimpleWideUnion); - - if (return_code_SimpleWideUnion != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "second Union member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - UnionMemberFlag member_flags_second = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false); - UnionCaseLabelSeq label_seq_second; - TypeObjectUtils::add_union_case_label(label_seq_second, static_cast(MyEnumWide::B)); - CommonUnionMember common_second; - MemberId member_id_second = 0x00000002; - if (EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier1()._d() || TK_NONE == type_ids_SimpleWideUnion.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SimpleWideUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SimpleWideUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SimpleWideUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SimpleWideUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SimpleWideUnion.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SimpleWideUnion.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_second = TypeObjectUtils::build_common_union_member(member_id_second, member_flags_second, type_ids_SimpleWideUnion.type_identifier1(), - label_seq_second); - } - else if (EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SimpleWideUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SimpleWideUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SimpleWideUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SimpleWideUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SimpleWideUnion.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SimpleWideUnion.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_second = TypeObjectUtils::build_common_union_member(member_id_second, member_flags_second, type_ids_SimpleWideUnion.type_identifier2(), - label_seq_second); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Union second member TypeIdentifier inconsistent."); - return; - } - MemberName name_second = "second"; - eprosima::fastcdr::optional member_ann_builtin_second; - ann_custom_SimpleWideUnion.reset(); - CompleteMemberDetail detail_second = TypeObjectUtils::build_complete_member_detail(name_second, member_ann_builtin_second, ann_custom_SimpleWideUnion); - CompleteUnionMember member_second = TypeObjectUtils::build_complete_union_member(common_second, detail_second); - TypeObjectUtils::add_complete_union_member(member_seq_SimpleWideUnion, member_second); - } - { - return_code_SimpleWideUnion = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_byte", type_ids_SimpleWideUnion); - - if (return_code_SimpleWideUnion != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "third Union member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - UnionMemberFlag member_flags_third = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false); - UnionCaseLabelSeq label_seq_third; - TypeObjectUtils::add_union_case_label(label_seq_third, static_cast(MyEnumWide::D)); - CommonUnionMember common_third; - MemberId member_id_third = 0x00000003; - if (EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier1()._d() || TK_NONE == type_ids_SimpleWideUnion.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SimpleWideUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SimpleWideUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SimpleWideUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SimpleWideUnion.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SimpleWideUnion.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SimpleWideUnion.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_third = TypeObjectUtils::build_common_union_member(member_id_third, member_flags_third, type_ids_SimpleWideUnion.type_identifier1(), - label_seq_third); - } - else if (EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SimpleWideUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SimpleWideUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SimpleWideUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SimpleWideUnion.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SimpleWideUnion.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SimpleWideUnion.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleWideUnion.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_third = TypeObjectUtils::build_common_union_member(member_id_third, member_flags_third, type_ids_SimpleWideUnion.type_identifier2(), - label_seq_third); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Union third member TypeIdentifier inconsistent."); - return; - } - MemberName name_third = "third"; - eprosima::fastcdr::optional member_ann_builtin_third; - ann_custom_SimpleWideUnion.reset(); - CompleteMemberDetail detail_third = TypeObjectUtils::build_complete_member_detail(name_third, member_ann_builtin_third, ann_custom_SimpleWideUnion); - CompleteUnionMember member_third = TypeObjectUtils::build_complete_union_member(common_third, detail_third); - TypeObjectUtils::add_complete_union_member(member_seq_SimpleWideUnion, member_third); - } - CompleteUnionType union_type_SimpleWideUnion = TypeObjectUtils::build_complete_union_type(union_flags_SimpleWideUnion, header_SimpleWideUnion, discriminator_SimpleWideUnion, - member_seq_SimpleWideUnion); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_union_type_object(union_type_SimpleWideUnion, type_name_SimpleWideUnion.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "SimpleWideUnion already registered in TypeObjectRegistry for a different type."); - } - return_code_SimpleWideUnion = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "SimpleWideUnion", type_ids_SimpleWideUnion); - if (return_code_SimpleWideUnion != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "SimpleWideUnion: Given Union TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } - } - StructMemberFlag member_flags_my_union = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, - false, false, false, false); - CommonStructMember common_my_union; - MemberId member_id_my_union = 0x00000000; - if (EK_COMPLETE == type_ids_SimpleWideUnionStruct.type_identifier1()._d() || TK_NONE == type_ids_SimpleWideUnionStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SimpleWideUnionStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleWideUnionStruct.type_identifier1().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SimpleWideUnionStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleWideUnionStruct.type_identifier1().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SimpleWideUnionStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleWideUnionStruct.type_identifier1().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SimpleWideUnionStruct.type_identifier1()._d() && - EK_COMPLETE == type_ids_SimpleWideUnionStruct.type_identifier1().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SimpleWideUnionStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SimpleWideUnionStruct.type_identifier1().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleWideUnionStruct.type_identifier1().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SimpleWideUnionStruct.type_identifier1()._d() && - (EK_COMPLETE == type_ids_SimpleWideUnionStruct.type_identifier1().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleWideUnionStruct.type_identifier1().map_ldefn().key_identifier()->_d()))) - { - common_my_union = TypeObjectUtils::build_common_struct_member(member_id_my_union, member_flags_my_union, type_ids_SimpleWideUnionStruct.type_identifier1()); - } - else if (EK_COMPLETE == type_ids_SimpleWideUnionStruct.type_identifier2()._d() || - (TI_PLAIN_SEQUENCE_SMALL == type_ids_SimpleWideUnionStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleWideUnionStruct.type_identifier2().seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == type_ids_SimpleWideUnionStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleWideUnionStruct.type_identifier2().seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == type_ids_SimpleWideUnionStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleWideUnionStruct.type_identifier2().array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == type_ids_SimpleWideUnionStruct.type_identifier2()._d() && - EK_COMPLETE == type_ids_SimpleWideUnionStruct.type_identifier2().array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == type_ids_SimpleWideUnionStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SimpleWideUnionStruct.type_identifier2().map_sdefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleWideUnionStruct.type_identifier2().map_sdefn().key_identifier()->_d())) || - (TI_PLAIN_MAP_LARGE == type_ids_SimpleWideUnionStruct.type_identifier2()._d() && - (EK_COMPLETE == type_ids_SimpleWideUnionStruct.type_identifier2().map_ldefn().header().equiv_kind() || - EK_COMPLETE == type_ids_SimpleWideUnionStruct.type_identifier2().map_ldefn().key_identifier()->_d()))) - { - common_my_union = TypeObjectUtils::build_common_struct_member(member_id_my_union, member_flags_my_union, type_ids_SimpleWideUnionStruct.type_identifier2()); - } - else - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "Structure my_union member TypeIdentifier inconsistent."); - return; - } - MemberName name_my_union = "my_union"; - eprosima::fastcdr::optional member_ann_builtin_my_union; - ann_custom_SimpleWideUnionStruct.reset(); - CompleteMemberDetail detail_my_union = TypeObjectUtils::build_complete_member_detail(name_my_union, member_ann_builtin_my_union, ann_custom_SimpleWideUnionStruct); - CompleteStructMember member_my_union = TypeObjectUtils::build_complete_struct_member(common_my_union, detail_my_union); - TypeObjectUtils::add_complete_struct_member(member_seq_SimpleWideUnionStruct, member_my_union); - } - CompleteStructType struct_type_SimpleWideUnionStruct = TypeObjectUtils::build_complete_struct_type(struct_flags_SimpleWideUnionStruct, header_SimpleWideUnionStruct, member_seq_SimpleWideUnionStruct); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_SimpleWideUnionStruct, type_name_SimpleWideUnionStruct.to_string())) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "SimpleWideUnionStruct already registered in TypeObjectRegistry for a different type."); - } - return_code_SimpleWideUnionStruct = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "SimpleWideUnionStruct", type_ids_SimpleWideUnionStruct); - if (return_code_SimpleWideUnionStruct != eprosima::fastdds::dds::RETCODE_OK) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "SimpleWideUnionStruct: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - } -} - diff --git a/test/unittest/xtypes/idl/WideEnumTypeObjectSupport.hpp b/test/unittest/xtypes/idl/WideEnumTypeObjectSupport.hpp deleted file mode 100644 index f0097874a8f..00000000000 --- a/test/unittest/xtypes/idl/WideEnumTypeObjectSupport.hpp +++ /dev/null @@ -1,68 +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 WideEnumTypeObjectSupport.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_WIDEENUM_TYPE_OBJECT_SUPPORT_HPP_ -#define _FAST_DDS_GENERATED_WIDEENUM_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_WideEnum_type_objects(); - -#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC - -/** - * @brief Register MyEnumWideStruct 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_MyEnumWideStruct_type_identifier(); -/** - * @brief Register SimpleWideUnion 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_SimpleWideUnion_type_identifier(); -/** - * @brief Register SimpleWideUnionStruct 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_SimpleWideUnionStruct_type_identifier(); - - -#endif // DOXYGEN_SHOULD_SKIP_THIS_PUBLIC - -#endif // _FAST_DDS_GENERATED_WIDEENUM_TYPE_OBJECT_SUPPORT_HPP_ diff --git a/utils/scripts/update_generated_code_from_idl.sh b/utils/scripts/update_generated_code_from_idl.sh index 7aab8cca023..68c836ce41c 100755 --- a/utils/scripts/update_generated_code_from_idl.sh +++ b/utils/scripts/update_generated_code_from_idl.sh @@ -1,7 +1,6 @@ #!/usr/bin/env bash files_to_exclude=( - './include/fastrtps/types/*' ) files_not_needing_typeobject=( @@ -11,7 +10,6 @@ files_not_needing_typeobject=( ) files_needing_case_sensitive=( - './test/unittest/dynamic_types/idl/new_features_4_2.idl' ) files_needing_output_dir=(