testTypeObjectSupport.cxx 29.4 KB
Newer Older
嵇洲's avatar
嵇洲 committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439
// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima).
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES 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 <mutex>
#include <string>

#include <fastcdr/xcdr/external.hpp>
#include <fastcdr/xcdr/optional.hpp>
#include <fastdds/dds/domain/DomainParticipantFactory.hpp>
#include <fastdds/dds/log/Log.hpp>
#include <fastdds/dds/xtypes/common.hpp>
#include <fastdds/dds/xtypes/type_representation/ITypeObjectRegistry.hpp>
#include <fastdds/dds/xtypes/type_representation/TypeObject.hpp>
#include <fastdds/dds/xtypes/type_representation/TypeObjectUtils.hpp>

#include "test.hpp"


using namespace eprosima::fastdds::dds::xtypes;

// TypeIdentifier is returned by reference: dependent structures/unions are registered in this same method
void register_HelloSecurity_type_identifier(
        TypeIdentifierPair& type_ids_HelloSecurity)
{

    ReturnCode_t return_code_HelloSecurity {eprosima::fastdds::dds::RETCODE_OK};
    return_code_HelloSecurity =
        eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers(
        "HelloSecurity", type_ids_HelloSecurity);
    if (eprosima::fastdds::dds::RETCODE_OK != return_code_HelloSecurity)
    {
        StructTypeFlag struct_flags_HelloSecurity = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::APPENDABLE,
                false, false);
        QualifiedTypeName type_name_HelloSecurity = "HelloSecurity";
        eprosima::fastcdr::optional<AppliedBuiltinTypeAnnotations> type_ann_builtin_HelloSecurity;
        eprosima::fastcdr::optional<AppliedAnnotationSeq> ann_custom_HelloSecurity;
        CompleteTypeDetail detail_HelloSecurity = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_HelloSecurity, ann_custom_HelloSecurity, type_name_HelloSecurity.to_string());
        CompleteStructHeader header_HelloSecurity;
        header_HelloSecurity = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_HelloSecurity);
        CompleteStructMemberSeq member_seq_HelloSecurity;
        {
            TypeIdentifierPair type_ids_securityData;
            ReturnCode_t return_code_securityData {eprosima::fastdds::dds::RETCODE_OK};
            return_code_securityData =
                eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers(
                "anonymous_string_unbounded", type_ids_securityData);

            if (eprosima::fastdds::dds::RETCODE_OK != return_code_securityData)
            {
                {
                    SBound bound = 0;
                    StringSTypeDefn string_sdefn = TypeObjectUtils::build_string_s_type_defn(bound);
                    if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER ==
                            TypeObjectUtils::build_and_register_s_string_type_identifier(string_sdefn,
                            "anonymous_string_unbounded", type_ids_securityData))
                    {
                        EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION,
                            "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type.");
                    }
                }
            }
            StructMemberFlag member_flags_securityData = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD,
                    false, false, false, false);
            MemberId member_id_securityData = 0x00000000;
            bool common_securityData_ec {false};
            CommonStructMember common_securityData {TypeObjectUtils::build_common_struct_member(member_id_securityData, member_flags_securityData, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_securityData, common_securityData_ec))};
            if (!common_securityData_ec)
            {
                EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure securityData member TypeIdentifier inconsistent.");
                return;
            }
            MemberName name_securityData = "securityData";
            eprosima::fastcdr::optional<AppliedBuiltinMemberAnnotations> member_ann_builtin_securityData;
            ann_custom_HelloSecurity.reset();
            CompleteMemberDetail detail_securityData = TypeObjectUtils::build_complete_member_detail(name_securityData, member_ann_builtin_securityData, ann_custom_HelloSecurity);
            CompleteStructMember member_securityData = TypeObjectUtils::build_complete_struct_member(common_securityData, detail_securityData);
            TypeObjectUtils::add_complete_struct_member(member_seq_HelloSecurity, member_securityData);
        }
        CompleteStructType struct_type_HelloSecurity = TypeObjectUtils::build_complete_struct_type(struct_flags_HelloSecurity, header_HelloSecurity, member_seq_HelloSecurity);
        if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER ==
                TypeObjectUtils::build_and_register_struct_type_object(struct_type_HelloSecurity, type_name_HelloSecurity.to_string(), type_ids_HelloSecurity))
        {
            EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION,
                    "HelloSecurity already registered in TypeObjectRegistry for a different type.");
        }
    }
}
// TypeIdentifier is returned by reference: dependent structures/unions are registered in this same method
void register_OneMessage_type_identifier(
        TypeIdentifierPair& type_ids_OneMessage)
{

    ReturnCode_t return_code_OneMessage {eprosima::fastdds::dds::RETCODE_OK};
    return_code_OneMessage =
        eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers(
        "OneMessage", type_ids_OneMessage);
    if (eprosima::fastdds::dds::RETCODE_OK != return_code_OneMessage)
    {
        StructTypeFlag struct_flags_OneMessage = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::APPENDABLE,
                false, false);
        QualifiedTypeName type_name_OneMessage = "OneMessage";
        eprosima::fastcdr::optional<AppliedBuiltinTypeAnnotations> type_ann_builtin_OneMessage;
        eprosima::fastcdr::optional<AppliedAnnotationSeq> ann_custom_OneMessage;
        CompleteTypeDetail detail_OneMessage = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_OneMessage, ann_custom_OneMessage, type_name_OneMessage.to_string());
        CompleteStructHeader header_OneMessage;
        header_OneMessage = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_OneMessage);
        CompleteStructMemberSeq member_seq_OneMessage;
        {
            TypeIdentifierPair type_ids_a;
            ReturnCode_t return_code_a {eprosima::fastdds::dds::RETCODE_OK};
            return_code_a =
                eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers(
                "_int16_t", type_ids_a);

            if (eprosima::fastdds::dds::RETCODE_OK != return_code_a)
            {
                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::TryConstructFailAction::DISCARD,
                    false, false, false, false);
            MemberId member_id_a = 0x00000000;
            bool common_a_ec {false};
            CommonStructMember common_a {TypeObjectUtils::build_common_struct_member(member_id_a, member_flags_a, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_a, common_a_ec))};
            if (!common_a_ec)
            {
                EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure a member TypeIdentifier inconsistent.");
                return;
            }
            MemberName name_a = "a";
            eprosima::fastcdr::optional<AppliedBuiltinMemberAnnotations> member_ann_builtin_a;
            ann_custom_OneMessage.reset();
            CompleteMemberDetail detail_a = TypeObjectUtils::build_complete_member_detail(name_a, member_ann_builtin_a, ann_custom_OneMessage);
            CompleteStructMember member_a = TypeObjectUtils::build_complete_struct_member(common_a, detail_a);
            TypeObjectUtils::add_complete_struct_member(member_seq_OneMessage, member_a);
        }
        {
            TypeIdentifierPair type_ids_b;
            ReturnCode_t return_code_b {eprosima::fastdds::dds::RETCODE_OK};
            return_code_b =
                eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers(
                "_float", type_ids_b);

            if (eprosima::fastdds::dds::RETCODE_OK != return_code_b)
            {
                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::TryConstructFailAction::DISCARD,
                    false, false, false, false);
            MemberId member_id_b = 0x00000001;
            bool common_b_ec {false};
            CommonStructMember common_b {TypeObjectUtils::build_common_struct_member(member_id_b, member_flags_b, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_b, common_b_ec))};
            if (!common_b_ec)
            {
                EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure b member TypeIdentifier inconsistent.");
                return;
            }
            MemberName name_b = "b";
            eprosima::fastcdr::optional<AppliedBuiltinMemberAnnotations> member_ann_builtin_b;
            ann_custom_OneMessage.reset();
            CompleteMemberDetail detail_b = TypeObjectUtils::build_complete_member_detail(name_b, member_ann_builtin_b, ann_custom_OneMessage);
            CompleteStructMember member_b = TypeObjectUtils::build_complete_struct_member(common_b, detail_b);
            TypeObjectUtils::add_complete_struct_member(member_seq_OneMessage, member_b);
        }
        {
            TypeIdentifierPair type_ids_sequenceTest;
            ReturnCode_t return_code_sequenceTest {eprosima::fastdds::dds::RETCODE_OK};
            return_code_sequenceTest =
                eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers(
                "anonymous_sequence_int16_t_unbounded", type_ids_sequenceTest);

            if (eprosima::fastdds::dds::RETCODE_OK != return_code_sequenceTest)
            {
                return_code_sequenceTest =
                    eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers(
                    "_int16_t", type_ids_sequenceTest);

                if (eprosima::fastdds::dds::RETCODE_OK != return_code_sequenceTest)
                {
                    EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION,
                            "Sequence element TypeIdentifier unknown to TypeObjectRegistry.");
                    return;
                }
                bool element_identifier_anonymous_sequence_int16_t_unbounded_ec {false};
                TypeIdentifier* element_identifier_anonymous_sequence_int16_t_unbounded {new TypeIdentifier(TypeObjectUtils::retrieve_complete_type_identifier(type_ids_sequenceTest, element_identifier_anonymous_sequence_int16_t_unbounded_ec))};
                if (!element_identifier_anonymous_sequence_int16_t_unbounded_ec)
                {
                    EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Sequence element TypeIdentifier inconsistent.");
                    return;
                }
                EquivalenceKind equiv_kind_anonymous_sequence_int16_t_unbounded = EK_COMPLETE;
                if (TK_NONE == type_ids_sequenceTest.type_identifier2()._d())
                {
                    equiv_kind_anonymous_sequence_int16_t_unbounded = EK_BOTH;
                }
                CollectionElementFlag element_flags_anonymous_sequence_int16_t_unbounded = 0;
                PlainCollectionHeader header_anonymous_sequence_int16_t_unbounded = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_sequence_int16_t_unbounded, element_flags_anonymous_sequence_int16_t_unbounded);
                {
                    SBound bound = 0;
                    PlainSequenceSElemDefn seq_sdefn = TypeObjectUtils::build_plain_sequence_s_elem_defn(header_anonymous_sequence_int16_t_unbounded, bound,
                                eprosima::fastcdr::external<TypeIdentifier>(element_identifier_anonymous_sequence_int16_t_unbounded));
                    if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER ==
                            TypeObjectUtils::build_and_register_s_sequence_type_identifier(seq_sdefn, "anonymous_sequence_int16_t_unbounded", type_ids_sequenceTest))
                    {
                        EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION,
                            "anonymous_sequence_int16_t_unbounded already registered in TypeObjectRegistry for a different type.");
                    }
                }
            }
            StructMemberFlag member_flags_sequenceTest = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD,
                    false, false, false, false);
            MemberId member_id_sequenceTest = 0x00000002;
            bool common_sequenceTest_ec {false};
            CommonStructMember common_sequenceTest {TypeObjectUtils::build_common_struct_member(member_id_sequenceTest, member_flags_sequenceTest, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_sequenceTest, common_sequenceTest_ec))};
            if (!common_sequenceTest_ec)
            {
                EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure sequenceTest member TypeIdentifier inconsistent.");
                return;
            }
            MemberName name_sequenceTest = "sequenceTest";
            eprosima::fastcdr::optional<AppliedBuiltinMemberAnnotations> member_ann_builtin_sequenceTest;
            ann_custom_OneMessage.reset();
            CompleteMemberDetail detail_sequenceTest = TypeObjectUtils::build_complete_member_detail(name_sequenceTest, member_ann_builtin_sequenceTest, ann_custom_OneMessage);
            CompleteStructMember member_sequenceTest = TypeObjectUtils::build_complete_struct_member(common_sequenceTest, detail_sequenceTest);
            TypeObjectUtils::add_complete_struct_member(member_seq_OneMessage, member_sequenceTest);
        }
        CompleteStructType struct_type_OneMessage = TypeObjectUtils::build_complete_struct_type(struct_flags_OneMessage, header_OneMessage, member_seq_OneMessage);
        if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER ==
                TypeObjectUtils::build_and_register_struct_type_object(struct_type_OneMessage, type_name_OneMessage.to_string(), type_ids_OneMessage))
        {
            EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION,
                    "OneMessage already registered in TypeObjectRegistry for a different type.");
        }
    }
}
// TypeIdentifier is returned by reference: dependent structures/unions are registered in this same method
void register_TwoMessage_type_identifier(
        TypeIdentifierPair& type_ids_TwoMessage)
{

    ReturnCode_t return_code_TwoMessage {eprosima::fastdds::dds::RETCODE_OK};
    return_code_TwoMessage =
        eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers(
        "TwoMessage", type_ids_TwoMessage);
    if (eprosima::fastdds::dds::RETCODE_OK != return_code_TwoMessage)
    {
        StructTypeFlag struct_flags_TwoMessage = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::APPENDABLE,
                false, false);
        QualifiedTypeName type_name_TwoMessage = "TwoMessage";
        eprosima::fastcdr::optional<AppliedBuiltinTypeAnnotations> type_ann_builtin_TwoMessage;
        eprosima::fastcdr::optional<AppliedAnnotationSeq> ann_custom_TwoMessage;
        CompleteTypeDetail detail_TwoMessage = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_TwoMessage, ann_custom_TwoMessage, type_name_TwoMessage.to_string());
        CompleteStructHeader header_TwoMessage;
        header_TwoMessage = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_TwoMessage);
        CompleteStructMemberSeq member_seq_TwoMessage;
        {
            TypeIdentifierPair type_ids_sequenceTest;
            ReturnCode_t return_code_sequenceTest {eprosima::fastdds::dds::RETCODE_OK};
            return_code_sequenceTest =
                eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers(
                "anonymous_sequence_int16_t_unbounded", type_ids_sequenceTest);

            if (eprosima::fastdds::dds::RETCODE_OK != return_code_sequenceTest)
            {
                return_code_sequenceTest =
                    eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers(
                    "_int16_t", type_ids_sequenceTest);

                if (eprosima::fastdds::dds::RETCODE_OK != return_code_sequenceTest)
                {
                    EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION,
                            "Sequence element TypeIdentifier unknown to TypeObjectRegistry.");
                    return;
                }
                bool element_identifier_anonymous_sequence_int16_t_unbounded_ec {false};
                TypeIdentifier* element_identifier_anonymous_sequence_int16_t_unbounded {new TypeIdentifier(TypeObjectUtils::retrieve_complete_type_identifier(type_ids_sequenceTest, element_identifier_anonymous_sequence_int16_t_unbounded_ec))};
                if (!element_identifier_anonymous_sequence_int16_t_unbounded_ec)
                {
                    EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Sequence element TypeIdentifier inconsistent.");
                    return;
                }
                EquivalenceKind equiv_kind_anonymous_sequence_int16_t_unbounded = EK_COMPLETE;
                if (TK_NONE == type_ids_sequenceTest.type_identifier2()._d())
                {
                    equiv_kind_anonymous_sequence_int16_t_unbounded = EK_BOTH;
                }
                CollectionElementFlag element_flags_anonymous_sequence_int16_t_unbounded = 0;
                PlainCollectionHeader header_anonymous_sequence_int16_t_unbounded = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_sequence_int16_t_unbounded, element_flags_anonymous_sequence_int16_t_unbounded);
                {
                    SBound bound = 0;
                    PlainSequenceSElemDefn seq_sdefn = TypeObjectUtils::build_plain_sequence_s_elem_defn(header_anonymous_sequence_int16_t_unbounded, bound,
                                eprosima::fastcdr::external<TypeIdentifier>(element_identifier_anonymous_sequence_int16_t_unbounded));
                    if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER ==
                            TypeObjectUtils::build_and_register_s_sequence_type_identifier(seq_sdefn, "anonymous_sequence_int16_t_unbounded", type_ids_sequenceTest))
                    {
                        EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION,
                            "anonymous_sequence_int16_t_unbounded already registered in TypeObjectRegistry for a different type.");
                    }
                }
            }
            StructMemberFlag member_flags_sequenceTest = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD,
                    false, false, false, false);
            MemberId member_id_sequenceTest = 0x00000000;
            bool common_sequenceTest_ec {false};
            CommonStructMember common_sequenceTest {TypeObjectUtils::build_common_struct_member(member_id_sequenceTest, member_flags_sequenceTest, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_sequenceTest, common_sequenceTest_ec))};
            if (!common_sequenceTest_ec)
            {
                EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure sequenceTest member TypeIdentifier inconsistent.");
                return;
            }
            MemberName name_sequenceTest = "sequenceTest";
            eprosima::fastcdr::optional<AppliedBuiltinMemberAnnotations> member_ann_builtin_sequenceTest;
            ann_custom_TwoMessage.reset();
            CompleteMemberDetail detail_sequenceTest = TypeObjectUtils::build_complete_member_detail(name_sequenceTest, member_ann_builtin_sequenceTest, ann_custom_TwoMessage);
            CompleteStructMember member_sequenceTest = TypeObjectUtils::build_complete_struct_member(common_sequenceTest, detail_sequenceTest);
            TypeObjectUtils::add_complete_struct_member(member_seq_TwoMessage, member_sequenceTest);
        }
        {
            TypeIdentifierPair type_ids_mapTest;
            ReturnCode_t return_code_mapTest {eprosima::fastdds::dds::RETCODE_OK};
            return_code_mapTest =
                eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers(
                "anonymous_map_char_uint64_t_unbounded", type_ids_mapTest);

            if (eprosima::fastdds::dds::RETCODE_OK != return_code_mapTest)
            {
                return_code_mapTest =
                    eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers(
                    "_uint64_t", type_ids_mapTest);

                if (eprosima::fastdds::dds::RETCODE_OK != return_code_mapTest)
                {
                    EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION,
                            "Map element TypeIdentifier unknown to TypeObjectRegistry.");
                    return;
                }
                bool element_identifier_anonymous_map_char_uint64_t_unbounded_ec {false};
                TypeIdentifier* element_identifier_anonymous_map_char_uint64_t_unbounded {new TypeIdentifier(TypeObjectUtils::retrieve_complete_type_identifier(type_ids_mapTest, element_identifier_anonymous_map_char_uint64_t_unbounded_ec))};
                if (!element_identifier_anonymous_map_char_uint64_t_unbounded_ec)
                {
                    EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION,
                        "anonymous_map_char_uint64_t_unbounded inconsistent element TypeIdentifier.");
                    return;
                }
                return_code_mapTest =
                    eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers(
                    "_char", type_ids_mapTest);

                if (eprosima::fastdds::dds::RETCODE_OK != return_code_mapTest)
                {
                    EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION,
                            "Map key TypeIdentifier unknown to TypeObjectRegistry.");
                    return;
                }
                bool key_identifier_anonymous_map_char_uint64_t_unbounded_ec {false};
                TypeIdentifier* key_identifier_anonymous_map_char_uint64_t_unbounded {new TypeIdentifier(TypeObjectUtils::retrieve_complete_type_identifier(type_ids_mapTest, key_identifier_anonymous_map_char_uint64_t_unbounded_ec))};
                if (!key_identifier_anonymous_map_char_uint64_t_unbounded_ec)
                {
                    EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION,
                        "anonymous_map_char_uint64_t_unbounded inconsistent key TypeIdentifier.");
                    return;
                }
                EquivalenceKind equiv_kind_anonymous_map_char_uint64_t_unbounded = EK_BOTH;
                if ((EK_COMPLETE == key_identifier_anonymous_map_char_uint64_t_unbounded->_d() || EK_COMPLETE == element_identifier_anonymous_map_char_uint64_t_unbounded->_d()) ||
                        (TI_PLAIN_SEQUENCE_SMALL == element_identifier_anonymous_map_char_uint64_t_unbounded->_d() && EK_COMPLETE == element_identifier_anonymous_map_char_uint64_t_unbounded->seq_sdefn().header().equiv_kind()) ||
                        (TI_PLAIN_SEQUENCE_LARGE == element_identifier_anonymous_map_char_uint64_t_unbounded->_d() && EK_COMPLETE == element_identifier_anonymous_map_char_uint64_t_unbounded->seq_ldefn().header().equiv_kind()) ||
                        (TI_PLAIN_ARRAY_SMALL == element_identifier_anonymous_map_char_uint64_t_unbounded->_d() && EK_COMPLETE == element_identifier_anonymous_map_char_uint64_t_unbounded->array_sdefn().header().equiv_kind()) ||
                        (TI_PLAIN_ARRAY_LARGE == element_identifier_anonymous_map_char_uint64_t_unbounded->_d() && EK_COMPLETE == element_identifier_anonymous_map_char_uint64_t_unbounded->array_ldefn().header().equiv_kind()) ||
                        (TI_PLAIN_MAP_SMALL == element_identifier_anonymous_map_char_uint64_t_unbounded->_d() && (EK_COMPLETE == element_identifier_anonymous_map_char_uint64_t_unbounded->map_sdefn().key_identifier()->_d() || EK_COMPLETE == element_identifier_anonymous_map_char_uint64_t_unbounded->map_sdefn().header().equiv_kind())) ||
                        (TI_PLAIN_MAP_LARGE == element_identifier_anonymous_map_char_uint64_t_unbounded->_d() && (EK_COMPLETE == element_identifier_anonymous_map_char_uint64_t_unbounded->map_ldefn().key_identifier()->_d() || EK_COMPLETE == element_identifier_anonymous_map_char_uint64_t_unbounded->map_ldefn().header().equiv_kind())))
                {
                    equiv_kind_anonymous_map_char_uint64_t_unbounded = EK_COMPLETE;
                }
                CollectionElementFlag element_flags_anonymous_map_char_uint64_t_unbounded = 0;
                CollectionElementFlag key_flags_anonymous_map_char_uint64_t_unbounded = 0;
                PlainCollectionHeader header_anonymous_map_char_uint64_t_unbounded = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_map_char_uint64_t_unbounded, element_flags_anonymous_map_char_uint64_t_unbounded);
                {
                    SBound bound = 0;
                    PlainMapSTypeDefn map_sdefn = TypeObjectUtils::build_plain_map_s_type_defn(header_anonymous_map_char_uint64_t_unbounded, bound,
                                eprosima::fastcdr::external<TypeIdentifier>(element_identifier_anonymous_map_char_uint64_t_unbounded), key_flags_anonymous_map_char_uint64_t_unbounded,
                                eprosima::fastcdr::external<TypeIdentifier>(key_identifier_anonymous_map_char_uint64_t_unbounded));
                    if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER ==
                            TypeObjectUtils::build_and_register_s_map_type_identifier(map_sdefn, "anonymous_map_char_uint64_t_unbounded", type_ids_mapTest))
                    {
                        EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION,
                            "anonymous_map_char_uint64_t_unbounded already registered in TypeObjectRegistry for a different type.");
                    }
                }
            }
            StructMemberFlag member_flags_mapTest = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD,
                    false, false, false, false);
            MemberId member_id_mapTest = 0x00000001;
            bool common_mapTest_ec {false};
            CommonStructMember common_mapTest {TypeObjectUtils::build_common_struct_member(member_id_mapTest, member_flags_mapTest, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_mapTest, common_mapTest_ec))};
            if (!common_mapTest_ec)
            {
                EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure mapTest member TypeIdentifier inconsistent.");
                return;
            }
            MemberName name_mapTest = "mapTest";
            eprosima::fastcdr::optional<AppliedBuiltinMemberAnnotations> member_ann_builtin_mapTest;
            ann_custom_TwoMessage.reset();
            CompleteMemberDetail detail_mapTest = TypeObjectUtils::build_complete_member_detail(name_mapTest, member_ann_builtin_mapTest, ann_custom_TwoMessage);
            CompleteStructMember member_mapTest = TypeObjectUtils::build_complete_struct_member(common_mapTest, detail_mapTest);
            TypeObjectUtils::add_complete_struct_member(member_seq_TwoMessage, member_mapTest);
        }
        CompleteStructType struct_type_TwoMessage = TypeObjectUtils::build_complete_struct_type(struct_flags_TwoMessage, header_TwoMessage, member_seq_TwoMessage);
        if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER ==
                TypeObjectUtils::build_and_register_struct_type_object(struct_type_TwoMessage, type_name_TwoMessage.to_string(), type_ids_TwoMessage))
        {
            EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION,
                    "TwoMessage already registered in TypeObjectRegistry for a different type.");
        }
    }
}