// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima).
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

/*!
 * @file alias_structTypeObjectSupport.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 (version: 4.1.0).
 */

#include "alias_structTypeObjectSupport.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 "alias_struct.hpp"


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

void register_MyLong_type_identifier(
        TypeIdentifierPair& type_ids_MyLong)
{
    ReturnCode_t return_code_MyLong {eprosima::fastdds::dds::RETCODE_OK};
    return_code_MyLong =
        eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers(
        "MyLong", type_ids_MyLong);
    if (eprosima::fastdds::dds::RETCODE_OK != return_code_MyLong)
    {
        AliasTypeFlag alias_flags_MyLong = 0;
        QualifiedTypeName type_name_MyLong = "MyLong";
        eprosima::fastcdr::optional<AppliedBuiltinTypeAnnotations> type_ann_builtin_MyLong;
        eprosima::fastcdr::optional<AppliedAnnotationSeq> ann_custom_MyLong;
        CompleteTypeDetail detail_MyLong = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_MyLong, ann_custom_MyLong, type_name_MyLong.to_string());
        CompleteAliasHeader header_MyLong = TypeObjectUtils::build_complete_alias_header(detail_MyLong);
        AliasMemberFlag related_flags_MyLong = 0;
        return_code_MyLong =
            eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers(
            "_uint32_t", type_ids_MyLong);

        if (eprosima::fastdds::dds::RETCODE_OK != return_code_MyLong)
        {
            EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION,
                    "MyLong related TypeIdentifier unknown to TypeObjectRegistry.");
            return;
        }
        bool common_MyLong_ec {false};
        CommonAliasBody common_MyLong {TypeObjectUtils::build_common_alias_body(related_flags_MyLong,
                TypeObjectUtils::retrieve_complete_type_identifier(type_ids_MyLong, common_MyLong_ec))};
        if (!common_MyLong_ec)
        {
            EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "MyLong related TypeIdentifier inconsistent.");
            return;
        }
        eprosima::fastcdr::optional<AppliedBuiltinMemberAnnotations> member_ann_builtin_MyLong;
        ann_custom_MyLong.reset();
        CompleteAliasBody body_MyLong = TypeObjectUtils::build_complete_alias_body(common_MyLong,
                member_ann_builtin_MyLong, ann_custom_MyLong);
        CompleteAliasType alias_type_MyLong = TypeObjectUtils::build_complete_alias_type(alias_flags_MyLong,
                header_MyLong, body_MyLong);
        if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER ==
                TypeObjectUtils::build_and_register_alias_type_object(alias_type_MyLong,
                    type_name_MyLong.to_string(), type_ids_MyLong))
        {
            EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION,
                "MyLong already registered in TypeObjectRegistry for a different type.");
        }
    }
}

void register_MyShort_type_identifier(
        TypeIdentifierPair& type_ids_MyShort)
{
    ReturnCode_t return_code_MyShort {eprosima::fastdds::dds::RETCODE_OK};
    return_code_MyShort =
        eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers(
        "MyShort", type_ids_MyShort);
    if (eprosima::fastdds::dds::RETCODE_OK != return_code_MyShort)
    {
        AliasTypeFlag alias_flags_MyShort = 0;
        QualifiedTypeName type_name_MyShort = "MyShort";
        eprosima::fastcdr::optional<AppliedBuiltinTypeAnnotations> type_ann_builtin_MyShort;
        eprosima::fastcdr::optional<AppliedAnnotationSeq> ann_custom_MyShort;
        CompleteTypeDetail detail_MyShort = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_MyShort, ann_custom_MyShort, type_name_MyShort.to_string());
        CompleteAliasHeader header_MyShort = TypeObjectUtils::build_complete_alias_header(detail_MyShort);
        AliasMemberFlag related_flags_MyShort = 0;
        return_code_MyShort =
            eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers(
            "_int16_t", type_ids_MyShort);

        if (eprosima::fastdds::dds::RETCODE_OK != return_code_MyShort)
        {
            EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION,
                    "MyShort related TypeIdentifier unknown to TypeObjectRegistry.");
            return;
        }
        bool common_MyShort_ec {false};
        CommonAliasBody common_MyShort {TypeObjectUtils::build_common_alias_body(related_flags_MyShort,
                TypeObjectUtils::retrieve_complete_type_identifier(type_ids_MyShort, common_MyShort_ec))};
        if (!common_MyShort_ec)
        {
            EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "MyShort related TypeIdentifier inconsistent.");
            return;
        }
        eprosima::fastcdr::optional<AppliedBuiltinMemberAnnotations> member_ann_builtin_MyShort;
        ann_custom_MyShort.reset();
        CompleteAliasBody body_MyShort = TypeObjectUtils::build_complete_alias_body(common_MyShort,
                member_ann_builtin_MyShort, ann_custom_MyShort);
        CompleteAliasType alias_type_MyShort = TypeObjectUtils::build_complete_alias_type(alias_flags_MyShort,
                header_MyShort, body_MyShort);
        if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER ==
                TypeObjectUtils::build_and_register_alias_type_object(alias_type_MyShort,
                    type_name_MyShort.to_string(), type_ids_MyShort))
        {
            EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION,
                "MyShort already registered in TypeObjectRegistry for a different type.");
        }
    }
}

void register_MyRecursiveShort_type_identifier(
        TypeIdentifierPair& type_ids_MyRecursiveShort)
{
    ReturnCode_t return_code_MyRecursiveShort {eprosima::fastdds::dds::RETCODE_OK};
    return_code_MyRecursiveShort =
        eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers(
        "MyRecursiveShort", type_ids_MyRecursiveShort);
    if (eprosima::fastdds::dds::RETCODE_OK != return_code_MyRecursiveShort)
    {
        AliasTypeFlag alias_flags_MyRecursiveShort = 0;
        QualifiedTypeName type_name_MyRecursiveShort = "MyRecursiveShort";
        eprosima::fastcdr::optional<AppliedBuiltinTypeAnnotations> type_ann_builtin_MyRecursiveShort;
        eprosima::fastcdr::optional<AppliedAnnotationSeq> ann_custom_MyRecursiveShort;
        CompleteTypeDetail detail_MyRecursiveShort = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_MyRecursiveShort, ann_custom_MyRecursiveShort, type_name_MyRecursiveShort.to_string());
        CompleteAliasHeader header_MyRecursiveShort = TypeObjectUtils::build_complete_alias_header(detail_MyRecursiveShort);
        AliasMemberFlag related_flags_MyRecursiveShort = 0;
        return_code_MyRecursiveShort =
            eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers(
            "MyShort", type_ids_MyRecursiveShort);

        if (eprosima::fastdds::dds::RETCODE_OK != return_code_MyRecursiveShort)
        {
        ::register_MyShort_type_identifier(type_ids_MyRecursiveShort);
        }
        bool common_MyRecursiveShort_ec {false};
        CommonAliasBody common_MyRecursiveShort {TypeObjectUtils::build_common_alias_body(related_flags_MyRecursiveShort,
                TypeObjectUtils::retrieve_complete_type_identifier(type_ids_MyRecursiveShort, common_MyRecursiveShort_ec))};
        if (!common_MyRecursiveShort_ec)
        {
            EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "MyRecursiveShort related TypeIdentifier inconsistent.");
            return;
        }
        eprosima::fastcdr::optional<AppliedBuiltinMemberAnnotations> member_ann_builtin_MyRecursiveShort;
        ann_custom_MyRecursiveShort.reset();
        CompleteAliasBody body_MyRecursiveShort = TypeObjectUtils::build_complete_alias_body(common_MyRecursiveShort,
                member_ann_builtin_MyRecursiveShort, ann_custom_MyRecursiveShort);
        CompleteAliasType alias_type_MyRecursiveShort = TypeObjectUtils::build_complete_alias_type(alias_flags_MyRecursiveShort,
                header_MyRecursiveShort, body_MyRecursiveShort);
        if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER ==
                TypeObjectUtils::build_and_register_alias_type_object(alias_type_MyRecursiveShort,
                    type_name_MyRecursiveShort.to_string(), type_ids_MyRecursiveShort))
        {
            EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION,
                "MyRecursiveShort already registered in TypeObjectRegistry for a different type.");
        }
    }
}

void register_MyBoolean_type_identifier(
        TypeIdentifierPair& type_ids_MyBoolean)
{
    ReturnCode_t return_code_MyBoolean {eprosima::fastdds::dds::RETCODE_OK};
    return_code_MyBoolean =
        eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers(
        "MyBoolean", type_ids_MyBoolean);
    if (eprosima::fastdds::dds::RETCODE_OK != return_code_MyBoolean)
    {
        AliasTypeFlag alias_flags_MyBoolean = 0;
        QualifiedTypeName type_name_MyBoolean = "MyBoolean";
        eprosima::fastcdr::optional<AppliedBuiltinTypeAnnotations> type_ann_builtin_MyBoolean;
        eprosima::fastcdr::optional<AppliedAnnotationSeq> ann_custom_MyBoolean;
        CompleteTypeDetail detail_MyBoolean = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_MyBoolean, ann_custom_MyBoolean, type_name_MyBoolean.to_string());
        CompleteAliasHeader header_MyBoolean = TypeObjectUtils::build_complete_alias_header(detail_MyBoolean);
        AliasMemberFlag related_flags_MyBoolean = 0;
        return_code_MyBoolean =
            eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers(
            "_bool", type_ids_MyBoolean);

        if (eprosima::fastdds::dds::RETCODE_OK != return_code_MyBoolean)
        {
            EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION,
                    "MyBoolean related TypeIdentifier unknown to TypeObjectRegistry.");
            return;
        }
        bool common_MyBoolean_ec {false};
        CommonAliasBody common_MyBoolean {TypeObjectUtils::build_common_alias_body(related_flags_MyBoolean,
                TypeObjectUtils::retrieve_complete_type_identifier(type_ids_MyBoolean, common_MyBoolean_ec))};
        if (!common_MyBoolean_ec)
        {
            EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "MyBoolean related TypeIdentifier inconsistent.");
            return;
        }
        eprosima::fastcdr::optional<AppliedBuiltinMemberAnnotations> member_ann_builtin_MyBoolean;
        ann_custom_MyBoolean.reset();
        CompleteAliasBody body_MyBoolean = TypeObjectUtils::build_complete_alias_body(common_MyBoolean,
                member_ann_builtin_MyBoolean, ann_custom_MyBoolean);
        CompleteAliasType alias_type_MyBoolean = TypeObjectUtils::build_complete_alias_type(alias_flags_MyBoolean,
                header_MyBoolean, body_MyBoolean);
        if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER ==
                TypeObjectUtils::build_and_register_alias_type_object(alias_type_MyBoolean,
                    type_name_MyBoolean.to_string(), type_ids_MyBoolean))
        {
            EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION,
                "MyBoolean already registered in TypeObjectRegistry for a different type.");
        }
    }
}

void register_MyRecursiveBoolean_type_identifier(
        TypeIdentifierPair& type_ids_MyRecursiveBoolean)
{
    ReturnCode_t return_code_MyRecursiveBoolean {eprosima::fastdds::dds::RETCODE_OK};
    return_code_MyRecursiveBoolean =
        eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers(
        "MyRecursiveBoolean", type_ids_MyRecursiveBoolean);
    if (eprosima::fastdds::dds::RETCODE_OK != return_code_MyRecursiveBoolean)
    {
        AliasTypeFlag alias_flags_MyRecursiveBoolean = 0;
        QualifiedTypeName type_name_MyRecursiveBoolean = "MyRecursiveBoolean";
        eprosima::fastcdr::optional<AppliedBuiltinTypeAnnotations> type_ann_builtin_MyRecursiveBoolean;
        eprosima::fastcdr::optional<AppliedAnnotationSeq> ann_custom_MyRecursiveBoolean;
        CompleteTypeDetail detail_MyRecursiveBoolean = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_MyRecursiveBoolean, ann_custom_MyRecursiveBoolean, type_name_MyRecursiveBoolean.to_string());
        CompleteAliasHeader header_MyRecursiveBoolean = TypeObjectUtils::build_complete_alias_header(detail_MyRecursiveBoolean);
        AliasMemberFlag related_flags_MyRecursiveBoolean = 0;
        return_code_MyRecursiveBoolean =
            eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers(
            "MyBoolean", type_ids_MyRecursiveBoolean);

        if (eprosima::fastdds::dds::RETCODE_OK != return_code_MyRecursiveBoolean)
        {
        ::register_MyBoolean_type_identifier(type_ids_MyRecursiveBoolean);
        }
        bool common_MyRecursiveBoolean_ec {false};
        CommonAliasBody common_MyRecursiveBoolean {TypeObjectUtils::build_common_alias_body(related_flags_MyRecursiveBoolean,
                TypeObjectUtils::retrieve_complete_type_identifier(type_ids_MyRecursiveBoolean, common_MyRecursiveBoolean_ec))};
        if (!common_MyRecursiveBoolean_ec)
        {
            EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "MyRecursiveBoolean related TypeIdentifier inconsistent.");
            return;
        }
        eprosima::fastcdr::optional<AppliedBuiltinMemberAnnotations> member_ann_builtin_MyRecursiveBoolean;
        ann_custom_MyRecursiveBoolean.reset();
        CompleteAliasBody body_MyRecursiveBoolean = TypeObjectUtils::build_complete_alias_body(common_MyRecursiveBoolean,
                member_ann_builtin_MyRecursiveBoolean, ann_custom_MyRecursiveBoolean);
        CompleteAliasType alias_type_MyRecursiveBoolean = TypeObjectUtils::build_complete_alias_type(alias_flags_MyRecursiveBoolean,
                header_MyRecursiveBoolean, body_MyRecursiveBoolean);
        if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER ==
                TypeObjectUtils::build_and_register_alias_type_object(alias_type_MyRecursiveBoolean,
                    type_name_MyRecursiveBoolean.to_string(), type_ids_MyRecursiveBoolean))
        {
            EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION,
                "MyRecursiveBoolean already registered in TypeObjectRegistry for a different type.");
        }
    }
}

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

    ReturnCode_t return_code_AliasStruct {eprosima::fastdds::dds::RETCODE_OK};
    return_code_AliasStruct =
        eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers(
        "AliasStruct", type_ids_AliasStruct);
    if (eprosima::fastdds::dds::RETCODE_OK != return_code_AliasStruct)
    {
        StructTypeFlag struct_flags_AliasStruct = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::APPENDABLE,
                false, false);
        QualifiedTypeName type_name_AliasStruct = "AliasStruct";
        eprosima::fastcdr::optional<AppliedBuiltinTypeAnnotations> type_ann_builtin_AliasStruct;
        eprosima::fastcdr::optional<AppliedAnnotationSeq> ann_custom_AliasStruct;
        AppliedAnnotationSeq tmp_ann_custom_AliasStruct;
        eprosima::fastcdr::optional<AppliedVerbatimAnnotation> verbatim_AliasStruct;
        if (!tmp_ann_custom_AliasStruct.empty())
        {
            ann_custom_AliasStruct = tmp_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;
        {
            TypeIdentifierPair type_ids_my_long;
            ReturnCode_t return_code_my_long {eprosima::fastdds::dds::RETCODE_OK};
            return_code_my_long =
                eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers(
                "MyLong", type_ids_my_long);

            if (eprosima::fastdds::dds::RETCODE_OK != return_code_my_long)
            {
            ::register_MyLong_type_identifier(type_ids_my_long);
            }
            StructMemberFlag member_flags_my_long = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD,
                    false, false, false, false);
            MemberId member_id_my_long = 0x00000000;
            bool common_my_long_ec {false};
            CommonStructMember common_my_long {TypeObjectUtils::build_common_struct_member(member_id_my_long, member_flags_my_long, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_my_long, common_my_long_ec))};
            if (!common_my_long_ec)
            {
                EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure my_long member TypeIdentifier inconsistent.");
                return;
            }
            MemberName name_my_long = "my_long";
            eprosima::fastcdr::optional<AppliedBuiltinMemberAnnotations> member_ann_builtin_my_long;
            ann_custom_AliasStruct.reset();
            CompleteMemberDetail detail_my_long = TypeObjectUtils::build_complete_member_detail(name_my_long, member_ann_builtin_my_long, ann_custom_AliasStruct);
            CompleteStructMember member_my_long = TypeObjectUtils::build_complete_struct_member(common_my_long, detail_my_long);
            TypeObjectUtils::add_complete_struct_member(member_seq_AliasStruct, member_my_long);
        }
        {
            TypeIdentifierPair type_ids_my_recursive_short;
            ReturnCode_t return_code_my_recursive_short {eprosima::fastdds::dds::RETCODE_OK};
            return_code_my_recursive_short =
                eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers(
                "MyRecursiveShort", type_ids_my_recursive_short);

            if (eprosima::fastdds::dds::RETCODE_OK != return_code_my_recursive_short)
            {
            ::register_MyRecursiveShort_type_identifier(type_ids_my_recursive_short);
            }
            StructMemberFlag member_flags_my_recursive_short = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD,
                    false, false, false, false);
            MemberId member_id_my_recursive_short = 0x00000001;
            bool common_my_recursive_short_ec {false};
            CommonStructMember common_my_recursive_short {TypeObjectUtils::build_common_struct_member(member_id_my_recursive_short, member_flags_my_recursive_short, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_my_recursive_short, common_my_recursive_short_ec))};
            if (!common_my_recursive_short_ec)
            {
                EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure my_recursive_short member TypeIdentifier inconsistent.");
                return;
            }
            MemberName name_my_recursive_short = "my_recursive_short";
            eprosima::fastcdr::optional<AppliedBuiltinMemberAnnotations> member_ann_builtin_my_recursive_short;
            ann_custom_AliasStruct.reset();
            CompleteMemberDetail detail_my_recursive_short = TypeObjectUtils::build_complete_member_detail(name_my_recursive_short, member_ann_builtin_my_recursive_short, ann_custom_AliasStruct);
            CompleteStructMember member_my_recursive_short = TypeObjectUtils::build_complete_struct_member(common_my_recursive_short, detail_my_recursive_short);
            TypeObjectUtils::add_complete_struct_member(member_seq_AliasStruct, member_my_recursive_short);
        }
        {
            TypeIdentifierPair type_ids_my_recursive_boolean;
            ReturnCode_t return_code_my_recursive_boolean {eprosima::fastdds::dds::RETCODE_OK};
            return_code_my_recursive_boolean =
                eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers(
                "MyRecursiveBoolean", type_ids_my_recursive_boolean);

            if (eprosima::fastdds::dds::RETCODE_OK != return_code_my_recursive_boolean)
            {
            ::register_MyRecursiveBoolean_type_identifier(type_ids_my_recursive_boolean);
            }
            StructMemberFlag member_flags_my_recursive_boolean = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD,
                    false, false, false, false);
            MemberId member_id_my_recursive_boolean = 0x00000002;
            bool common_my_recursive_boolean_ec {false};
            CommonStructMember common_my_recursive_boolean {TypeObjectUtils::build_common_struct_member(member_id_my_recursive_boolean, member_flags_my_recursive_boolean, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_my_recursive_boolean, common_my_recursive_boolean_ec))};
            if (!common_my_recursive_boolean_ec)
            {
                EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure my_recursive_boolean member TypeIdentifier inconsistent.");
                return;
            }
            MemberName name_my_recursive_boolean = "my_recursive_boolean";
            eprosima::fastcdr::optional<AppliedBuiltinMemberAnnotations> member_ann_builtin_my_recursive_boolean;
            ann_custom_AliasStruct.reset();
            CompleteMemberDetail detail_my_recursive_boolean = TypeObjectUtils::build_complete_member_detail(name_my_recursive_boolean, member_ann_builtin_my_recursive_boolean, ann_custom_AliasStruct);
            CompleteStructMember member_my_recursive_boolean = TypeObjectUtils::build_complete_struct_member(common_my_recursive_boolean, detail_my_recursive_boolean);
            TypeObjectUtils::add_complete_struct_member(member_seq_AliasStruct, member_my_recursive_boolean);
        }
        {
            TypeIdentifierPair type_ids_my_boolean;
            ReturnCode_t return_code_my_boolean {eprosima::fastdds::dds::RETCODE_OK};
            return_code_my_boolean =
                eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers(
                "MyBoolean", type_ids_my_boolean);

            if (eprosima::fastdds::dds::RETCODE_OK != return_code_my_boolean)
            {
            ::register_MyBoolean_type_identifier(type_ids_my_boolean);
            }
            StructMemberFlag member_flags_my_boolean = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD,
                    false, false, false, false);
            MemberId member_id_my_boolean = 0x00000003;
            bool common_my_boolean_ec {false};
            CommonStructMember common_my_boolean {TypeObjectUtils::build_common_struct_member(member_id_my_boolean, member_flags_my_boolean, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_my_boolean, common_my_boolean_ec))};
            if (!common_my_boolean_ec)
            {
                EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure my_boolean member TypeIdentifier inconsistent.");
                return;
            }
            MemberName name_my_boolean = "my_boolean";
            eprosima::fastcdr::optional<AppliedBuiltinMemberAnnotations> member_ann_builtin_my_boolean;
            ann_custom_AliasStruct.reset();
            CompleteMemberDetail detail_my_boolean = TypeObjectUtils::build_complete_member_detail(name_my_boolean, member_ann_builtin_my_boolean, ann_custom_AliasStruct);
            CompleteStructMember member_my_boolean = TypeObjectUtils::build_complete_struct_member(common_my_boolean, detail_my_boolean);
            TypeObjectUtils::add_complete_struct_member(member_seq_AliasStruct, member_my_boolean);
        }
        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(), type_ids_AliasStruct))
        {
            EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION,
                    "AliasStruct already registered in TypeObjectRegistry for a different type.");
        }
    }
}
