/* This file is autogenerated. DO NOT CHANGE. All changes will be lost */


#include "enummessages.qpb.h"

#include <QtProtobuf/qprotobufregistration.h>

#include <cmath>

namespace qtprotobufnamespace::tests {
static QtProtobuf::ProtoTypeRegistrar ProtoTypeRegistrarTestEnumGadget(TestEnumGadget::registerTypes);
void TestEnumGadget::registerTypes()
{
    qRegisterMetaType<TestEnum>();
    qRegisterMetaType<qtprotobufnamespace::tests::TestEnumGadget::TestEnum>();
    qRegisterProtobufEnumType<qtprotobufnamespace::tests::TestEnumGadget::TestEnum>();
}

static QtProtobuf::ProtoTypeRegistrar ProtoTypeRegistrarTestEnumSecondInFileGadget(TestEnumSecondInFileGadget::registerTypes);
void TestEnumSecondInFileGadget::registerTypes()
{
    qRegisterMetaType<TestEnumSecondInFile>();
    qRegisterMetaType<qtprotobufnamespace::tests::TestEnumSecondInFileGadget::TestEnumSecondInFile>();
    qRegisterProtobufEnumType<qtprotobufnamespace::tests::TestEnumSecondInFileGadget::TestEnumSecondInFile>();
}


class SimpleEnumMessage_QtProtobufData : public QSharedData
{
public:
    SimpleEnumMessage_QtProtobufData()
        : QSharedData(),
          m_localEnum(SimpleEnumMessage_QtProtobufNested::LocalEnum::LOCAL_ENUM_VALUE0)
    {
    }

    SimpleEnumMessage_QtProtobufData(const SimpleEnumMessage_QtProtobufData &other)
        : QSharedData(other),
          m_localEnum(other.m_localEnum)
    {
    }

    SimpleEnumMessage_QtProtobufNested::LocalEnum m_localEnum;
};

SimpleEnumMessage::~SimpleEnumMessage() = default;

static constexpr struct {
    QtProtobufPrivate::QProtobufPropertyOrdering::Data data;
    const std::array<uint, 5> qt_protobuf_SimpleEnumMessage_uint_data;
    const char qt_protobuf_SimpleEnumMessage_char_data[55];
} qt_protobuf_SimpleEnumMessage_metadata {
    // data
    {
        0, /* = version */
        1, /* = num fields */
        2, /* = field number offset */
        3, /* = property index offset */
        4, /* = field flags offset */
        43, /* = message full name length */
    },
    // uint_data
    {
        // JSON name offsets:
        44, /* = localEnum */
        54, /* = end-of-string-marker */
        // Field numbers:
        1, /* = localEnum */
        // Property indices:
        0, /* = localEnum */
        // Field flags:
        uint(QtProtobufPrivate::FieldFlag::Enum), /* = localEnum */
    },
    // char_data
    /* metadata char_data: */
    "qtprotobufnamespace.tests.SimpleEnumMessage\0" /* = full message name */
    /* field char_data: */
    "localEnum\0"
};

const QtProtobufPrivate::QProtobufPropertyOrdering SimpleEnumMessage::staticPropertyOrdering = {
    &qt_protobuf_SimpleEnumMessage_metadata.data
};

void SimpleEnumMessage::registerTypes()
{
    qRegisterMetaType<SimpleEnumMessage>();
    qRegisterMetaType<SimpleEnumMessageRepeated>();
    qRegisterProtobufEnumType<SimpleEnumMessage_QtProtobufNested::LocalEnum>();
    qRegisterMetaType<LocalEnum>();
    qRegisterMetaType<LocalEnumRepeated>();
}

SimpleEnumMessage::SimpleEnumMessage()
    : QProtobufMessage(&SimpleEnumMessage::staticMetaObject, &SimpleEnumMessage::staticPropertyOrdering),
      dptr(new SimpleEnumMessage_QtProtobufData)
{
}

SimpleEnumMessage::SimpleEnumMessage(const SimpleEnumMessage &other)
    = default;
SimpleEnumMessage &SimpleEnumMessage::operator =(const SimpleEnumMessage &other)
{
    SimpleEnumMessage temp(other);
    swap(temp);
    return *this;
}
SimpleEnumMessage::SimpleEnumMessage(SimpleEnumMessage &&other) noexcept
    = default;
bool comparesEqual(const SimpleEnumMessage &lhs, const SimpleEnumMessage &rhs) noexcept
{
    return operator ==(static_cast<const QProtobufMessage&>(lhs),
                       static_cast<const QProtobufMessage&>(rhs))
        && lhs.dptr->m_localEnum == rhs.dptr->m_localEnum;
}

SimpleEnumMessage_QtProtobufNested::LocalEnum SimpleEnumMessage::localEnum() const
{
    return dptr->m_localEnum;
}

void SimpleEnumMessage::setLocalEnum(SimpleEnumMessage_QtProtobufNested::LocalEnum localEnum)
{
    if (dptr->m_localEnum != localEnum) {
        dptr.detach();
        dptr->m_localEnum = localEnum;
    }
}


class RepeatedEnumMessage_QtProtobufData : public QSharedData
{
public:
    RepeatedEnumMessage_QtProtobufData()
        : QSharedData()
    {
    }

    RepeatedEnumMessage_QtProtobufData(const RepeatedEnumMessage_QtProtobufData &other)
        : QSharedData(other),
          m_localEnumList(other.m_localEnumList)
    {
    }

    RepeatedEnumMessage_QtProtobufNested::LocalEnumRepeated m_localEnumList;
};

RepeatedEnumMessage::~RepeatedEnumMessage() = default;

static constexpr struct {
    QtProtobufPrivate::QProtobufPropertyOrdering::Data data;
    const std::array<uint, 5> qt_protobuf_RepeatedEnumMessage_uint_data;
    const char qt_protobuf_RepeatedEnumMessage_char_data[61];
} qt_protobuf_RepeatedEnumMessage_metadata {
    // data
    {
        0, /* = version */
        1, /* = num fields */
        2, /* = field number offset */
        3, /* = property index offset */
        4, /* = field flags offset */
        45, /* = message full name length */
    },
    // uint_data
    {
        // JSON name offsets:
        46, /* = localEnumList */
        60, /* = end-of-string-marker */
        // Field numbers:
        1, /* = localEnumList */
        // Property indices:
        0, /* = localEnumList */
        // Field flags:
        uint(QtProtobufPrivate::FieldFlag::Repeated | QtProtobufPrivate::FieldFlag::Enum), /* = localEnumList */
    },
    // char_data
    /* metadata char_data: */
    "qtprotobufnamespace.tests.RepeatedEnumMessage\0" /* = full message name */
    /* field char_data: */
    "localEnumList\0"
};

const QtProtobufPrivate::QProtobufPropertyOrdering RepeatedEnumMessage::staticPropertyOrdering = {
    &qt_protobuf_RepeatedEnumMessage_metadata.data
};

void RepeatedEnumMessage::registerTypes()
{
    qRegisterMetaType<RepeatedEnumMessage>();
    qRegisterMetaType<RepeatedEnumMessageRepeated>();
    qRegisterProtobufEnumType<RepeatedEnumMessage_QtProtobufNested::LocalEnum>();
    qRegisterMetaType<LocalEnum>();
    qRegisterMetaType<LocalEnumRepeated>();
}

RepeatedEnumMessage::RepeatedEnumMessage()
    : QProtobufMessage(&RepeatedEnumMessage::staticMetaObject, &RepeatedEnumMessage::staticPropertyOrdering),
      dptr(new RepeatedEnumMessage_QtProtobufData)
{
}

RepeatedEnumMessage::RepeatedEnumMessage(const RepeatedEnumMessage &other)
    = default;
RepeatedEnumMessage &RepeatedEnumMessage::operator =(const RepeatedEnumMessage &other)
{
    RepeatedEnumMessage temp(other);
    swap(temp);
    return *this;
}
RepeatedEnumMessage::RepeatedEnumMessage(RepeatedEnumMessage &&other) noexcept
    = default;
bool comparesEqual(const RepeatedEnumMessage &lhs, const RepeatedEnumMessage &rhs) noexcept
{
    return operator ==(static_cast<const QProtobufMessage&>(lhs),
                       static_cast<const QProtobufMessage&>(rhs))
        && lhs.dptr->m_localEnumList == rhs.dptr->m_localEnumList;
}

const RepeatedEnumMessage_QtProtobufNested::LocalEnumRepeated &RepeatedEnumMessage::localEnumList() const &
{
    return dptr->m_localEnumList;
}

void RepeatedEnumMessage::setLocalEnumList(const RepeatedEnumMessage_QtProtobufNested::LocalEnumRepeated &localEnumList)
{
    if (dptr->m_localEnumList != localEnumList) {
        dptr.detach();
        dptr->m_localEnumList = localEnumList;
    }
}

void RepeatedEnumMessage::setLocalEnumList(RepeatedEnumMessage_QtProtobufNested::LocalEnumRepeated &&localEnumList)
{
    if (dptr->m_localEnumList != localEnumList) {
        dptr.detach();
        dptr->m_localEnumList = std::move(localEnumList);
    }
}

namespace MixedEnumUsageMessage_QtProtobufNested {

class NestedEnumHolder_QtProtobufData : public QSharedData
{
public:
    NestedEnumHolder_QtProtobufData()
        : QSharedData()
    {
    }

    NestedEnumHolder_QtProtobufData(const NestedEnumHolder_QtProtobufData &other)
        : QSharedData(other)
    {
    }

};

NestedEnumHolder::~NestedEnumHolder() = default;

static constexpr struct {
    QtProtobufPrivate::QProtobufPropertyOrdering::Data data;
    const std::array<uint, 1> qt_protobuf_NestedEnumHolder_uint_data;
    const char qt_protobuf_NestedEnumHolder_char_data[66];
} qt_protobuf_NestedEnumHolder_metadata {
    // data
    {
        0, /* = version */
        0, /* = num fields */
        1, /* = field number offset */
        1, /* = property index offset */
        1, /* = field flags offset */
        64, /* = message full name length */
    },
    // uint_data
    {
        // JSON name offsets:
        65, /* = end-of-string-marker */
        // Field numbers:
        // Property indices:
        // Field flags:
    },
    // char_data
    /* metadata char_data: */
    "qtprotobufnamespace.tests.MixedEnumUsageMessage.NestedEnumHolder\0" /* = full message name */
    /* field char_data: */
    ""
};

const QtProtobufPrivate::QProtobufPropertyOrdering NestedEnumHolder::staticPropertyOrdering = {
    &qt_protobuf_NestedEnumHolder_metadata.data
};

void NestedEnumHolder::registerTypes()
{
    qRegisterMetaType<NestedEnumHolder>();
    qRegisterMetaType<NestedEnumHolderRepeated>();
    qRegisterProtobufEnumType<NestedEnumHolder_QtProtobufNested::LocalEnum>();
    qRegisterMetaType<LocalEnum>();
    qRegisterMetaType<LocalEnumRepeated>();
}

NestedEnumHolder::NestedEnumHolder()
    : QProtobufMessage(&NestedEnumHolder::staticMetaObject, &NestedEnumHolder::staticPropertyOrdering),
      dptr(new NestedEnumHolder_QtProtobufData)
{
}

NestedEnumHolder::NestedEnumHolder(const NestedEnumHolder &other)
    = default;
NestedEnumHolder &NestedEnumHolder::operator =(const NestedEnumHolder &other)
{
    NestedEnumHolder temp(other);
    swap(temp);
    return *this;
}
NestedEnumHolder::NestedEnumHolder(NestedEnumHolder &&other) noexcept
    = default;
bool comparesEqual(const NestedEnumHolder &lhs, const NestedEnumHolder &rhs) noexcept
{
    return operator ==(static_cast<const QProtobufMessage&>(lhs),
                       static_cast<const QProtobufMessage&>(rhs));
}

namespace NestedEnumHolderLevel1_QtProtobufNested {

class NestedEnumHolderLevel2_QtProtobufData : public QSharedData
{
public:
    NestedEnumHolderLevel2_QtProtobufData()
        : QSharedData()
    {
    }

    NestedEnumHolderLevel2_QtProtobufData(const NestedEnumHolderLevel2_QtProtobufData &other)
        : QSharedData(other)
    {
    }

};

NestedEnumHolderLevel2::~NestedEnumHolderLevel2() = default;

static constexpr struct {
    QtProtobufPrivate::QProtobufPropertyOrdering::Data data;
    const std::array<uint, 1> qt_protobuf_NestedEnumHolderLevel2_uint_data;
    const char qt_protobuf_NestedEnumHolderLevel2_char_data[95];
} qt_protobuf_NestedEnumHolderLevel2_metadata {
    // data
    {
        0, /* = version */
        0, /* = num fields */
        1, /* = field number offset */
        1, /* = property index offset */
        1, /* = field flags offset */
        93, /* = message full name length */
    },
    // uint_data
    {
        // JSON name offsets:
        94, /* = end-of-string-marker */
        // Field numbers:
        // Property indices:
        // Field flags:
    },
    // char_data
    /* metadata char_data: */
    "qtprotobufnamespace.tests.MixedEnumUsageMessage.NestedEnumHolderLevel1.NestedEnumHolderLevel2\0" /* = full message name */
    /* field char_data: */
    ""
};

const QtProtobufPrivate::QProtobufPropertyOrdering NestedEnumHolderLevel2::staticPropertyOrdering = {
    &qt_protobuf_NestedEnumHolderLevel2_metadata.data
};

void NestedEnumHolderLevel2::registerTypes()
{
    qRegisterMetaType<NestedEnumHolderLevel2>();
    qRegisterMetaType<NestedEnumHolderLevel2Repeated>();
    qRegisterProtobufEnumType<NestedEnumHolderLevel2_QtProtobufNested::LocalEnum>();
    qRegisterMetaType<LocalEnum>();
    qRegisterMetaType<LocalEnumRepeated>();
}

NestedEnumHolderLevel2::NestedEnumHolderLevel2()
    : QProtobufMessage(&NestedEnumHolderLevel2::staticMetaObject, &NestedEnumHolderLevel2::staticPropertyOrdering),
      dptr(new NestedEnumHolderLevel2_QtProtobufData)
{
}

NestedEnumHolderLevel2::NestedEnumHolderLevel2(const NestedEnumHolderLevel2 &other)
    = default;
NestedEnumHolderLevel2 &NestedEnumHolderLevel2::operator =(const NestedEnumHolderLevel2 &other)
{
    NestedEnumHolderLevel2 temp(other);
    swap(temp);
    return *this;
}
NestedEnumHolderLevel2::NestedEnumHolderLevel2(NestedEnumHolderLevel2 &&other) noexcept
    = default;
bool comparesEqual(const NestedEnumHolderLevel2 &lhs, const NestedEnumHolderLevel2 &rhs) noexcept
{
    return operator ==(static_cast<const QProtobufMessage&>(lhs),
                       static_cast<const QProtobufMessage&>(rhs));
}

} // namespace NestedEnumHolderLevel1_QtProtobufNested

class NestedEnumHolderLevel1_QtProtobufData : public QSharedData
{
public:
    NestedEnumHolderLevel1_QtProtobufData()
        : QSharedData()
    {
    }

    NestedEnumHolderLevel1_QtProtobufData(const NestedEnumHolderLevel1_QtProtobufData &other)
        : QSharedData(other)
    {
    }

};

NestedEnumHolderLevel1::~NestedEnumHolderLevel1() = default;

static constexpr struct {
    QtProtobufPrivate::QProtobufPropertyOrdering::Data data;
    const std::array<uint, 1> qt_protobuf_NestedEnumHolderLevel1_uint_data;
    const char qt_protobuf_NestedEnumHolderLevel1_char_data[72];
} qt_protobuf_NestedEnumHolderLevel1_metadata {
    // data
    {
        0, /* = version */
        0, /* = num fields */
        1, /* = field number offset */
        1, /* = property index offset */
        1, /* = field flags offset */
        70, /* = message full name length */
    },
    // uint_data
    {
        // JSON name offsets:
        71, /* = end-of-string-marker */
        // Field numbers:
        // Property indices:
        // Field flags:
    },
    // char_data
    /* metadata char_data: */
    "qtprotobufnamespace.tests.MixedEnumUsageMessage.NestedEnumHolderLevel1\0" /* = full message name */
    /* field char_data: */
    ""
};

const QtProtobufPrivate::QProtobufPropertyOrdering NestedEnumHolderLevel1::staticPropertyOrdering = {
    &qt_protobuf_NestedEnumHolderLevel1_metadata.data
};

void NestedEnumHolderLevel1::registerTypes()
{
    qRegisterMetaType<NestedEnumHolderLevel1>();
    qRegisterMetaType<NestedEnumHolderLevel1Repeated>();
    qRegisterProtobufEnumType<NestedEnumHolderLevel1_QtProtobufNested::LocalEnum>();
    qRegisterMetaType<LocalEnum>();
    qRegisterMetaType<LocalEnumRepeated>();
}

NestedEnumHolderLevel1::NestedEnumHolderLevel1()
    : QProtobufMessage(&NestedEnumHolderLevel1::staticMetaObject, &NestedEnumHolderLevel1::staticPropertyOrdering),
      dptr(new NestedEnumHolderLevel1_QtProtobufData)
{
}

NestedEnumHolderLevel1::NestedEnumHolderLevel1(const NestedEnumHolderLevel1 &other)
    = default;
NestedEnumHolderLevel1 &NestedEnumHolderLevel1::operator =(const NestedEnumHolderLevel1 &other)
{
    NestedEnumHolderLevel1 temp(other);
    swap(temp);
    return *this;
}
NestedEnumHolderLevel1::NestedEnumHolderLevel1(NestedEnumHolderLevel1 &&other) noexcept
    = default;
bool comparesEqual(const NestedEnumHolderLevel1 &lhs, const NestedEnumHolderLevel1 &rhs) noexcept
{
    return operator ==(static_cast<const QProtobufMessage&>(lhs),
                       static_cast<const QProtobufMessage&>(rhs));
}


class NestedEnumMessage_QtProtobufData : public QSharedData
{
public:
    NestedEnumMessage_QtProtobufData()
        : QSharedData(),
          m_localEnumField(MixedEnumUsageMessage_QtProtobufNested::LocalEnum::LOCAL_ENUM_VALUE0),
          m_localEnumField2(RepeatedEnumMessage_QtProtobufNested::LocalEnum::LOCAL_ENUM_VALUE0),
          m_localEnumField3(MixedEnumUsageMessage_QtProtobufNested::NestedEnumHolder_QtProtobufNested::LocalEnum::NESTED_LOCAL_ENUM_VALUE0),
          m_localEnumField4(MixedEnumUsageMessage_QtProtobufNested::NestedEnumHolderLevel1_QtProtobufNested::LocalEnum::NESTED_LEVEL1_LOCAL_ENUM_VALUE0),
          m_localEnumField5(MixedEnumUsageMessage_QtProtobufNested::NestedEnumHolderLevel1_QtProtobufNested::NestedEnumHolderLevel2_QtProtobufNested::LocalEnum::NESTED_LEVEL2_LOCAL_ENUM_VALUE0)
    {
    }

    NestedEnumMessage_QtProtobufData(const NestedEnumMessage_QtProtobufData &other)
        : QSharedData(other),
          m_localEnumField(other.m_localEnumField),
          m_localEnumField2(other.m_localEnumField2),
          m_localEnumField3(other.m_localEnumField3),
          m_localEnumField4(other.m_localEnumField4),
          m_localEnumField5(other.m_localEnumField5)
    {
    }

    MixedEnumUsageMessage_QtProtobufNested::LocalEnum m_localEnumField;
    RepeatedEnumMessage_QtProtobufNested::LocalEnum m_localEnumField2;
    MixedEnumUsageMessage_QtProtobufNested::NestedEnumHolder_QtProtobufNested::LocalEnum m_localEnumField3;
    MixedEnumUsageMessage_QtProtobufNested::NestedEnumHolderLevel1_QtProtobufNested::LocalEnum m_localEnumField4;
    MixedEnumUsageMessage_QtProtobufNested::NestedEnumHolderLevel1_QtProtobufNested::NestedEnumHolderLevel2_QtProtobufNested::LocalEnum m_localEnumField5;
};

NestedEnumMessage::~NestedEnumMessage() = default;

static constexpr struct {
    QtProtobufPrivate::QProtobufPropertyOrdering::Data data;
    const std::array<uint, 21> qt_protobuf_NestedEnumMessage_uint_data;
    const char qt_protobuf_NestedEnumMessage_char_data[146];
} qt_protobuf_NestedEnumMessage_metadata {
    // data
    {
        0, /* = version */
        5, /* = num fields */
        6, /* = field number offset */
        11, /* = property index offset */
        16, /* = field flags offset */
        65, /* = message full name length */
    },
    // uint_data
    {
        // JSON name offsets:
        66, /* = localEnumField */
        81, /* = localEnumField2 */
        97, /* = localEnumField3 */
        113, /* = localEnumField4 */
        129, /* = localEnumField5 */
        145, /* = end-of-string-marker */
        // Field numbers:
        1, /* = localEnumField */
        2, /* = localEnumField2 */
        3, /* = localEnumField3 */
        4, /* = localEnumField4 */
        5, /* = localEnumField5 */
        // Property indices:
        0, /* = localEnumField */
        1, /* = localEnumField2 */
        2, /* = localEnumField3 */
        3, /* = localEnumField4 */
        4, /* = localEnumField5 */
        // Field flags:
        uint(QtProtobufPrivate::FieldFlag::Enum), /* = localEnumField */
        uint(QtProtobufPrivate::FieldFlag::Enum), /* = localEnumField2 */
        uint(QtProtobufPrivate::FieldFlag::Enum), /* = localEnumField3 */
        uint(QtProtobufPrivate::FieldFlag::Enum), /* = localEnumField4 */
        uint(QtProtobufPrivate::FieldFlag::Enum), /* = localEnumField5 */
    },
    // char_data
    /* metadata char_data: */
    "qtprotobufnamespace.tests.MixedEnumUsageMessage.NestedEnumMessage\0" /* = full message name */
    /* field char_data: */
    "localEnumField\0localEnumField2\0localEnumField3\0localEnumField4\0localEnumField5\0"
};

const QtProtobufPrivate::QProtobufPropertyOrdering NestedEnumMessage::staticPropertyOrdering = {
    &qt_protobuf_NestedEnumMessage_metadata.data
};

void NestedEnumMessage::registerTypes()
{
    qRegisterMetaType<NestedEnumMessage>();
    qRegisterMetaType<NestedEnumMessageRepeated>();
}

NestedEnumMessage::NestedEnumMessage()
    : QProtobufMessage(&NestedEnumMessage::staticMetaObject, &NestedEnumMessage::staticPropertyOrdering),
      dptr(new NestedEnumMessage_QtProtobufData)
{
}

NestedEnumMessage::NestedEnumMessage(const NestedEnumMessage &other)
    = default;
NestedEnumMessage &NestedEnumMessage::operator =(const NestedEnumMessage &other)
{
    NestedEnumMessage temp(other);
    swap(temp);
    return *this;
}
NestedEnumMessage::NestedEnumMessage(NestedEnumMessage &&other) noexcept
    = default;
bool comparesEqual(const NestedEnumMessage &lhs, const NestedEnumMessage &rhs) noexcept
{
    return operator ==(static_cast<const QProtobufMessage&>(lhs),
                       static_cast<const QProtobufMessage&>(rhs))
        && lhs.dptr->m_localEnumField == rhs.dptr->m_localEnumField
        && lhs.dptr->m_localEnumField2 == rhs.dptr->m_localEnumField2
        && lhs.dptr->m_localEnumField3 == rhs.dptr->m_localEnumField3
        && lhs.dptr->m_localEnumField4 == rhs.dptr->m_localEnumField4
        && lhs.dptr->m_localEnumField5 == rhs.dptr->m_localEnumField5;
}

MixedEnumUsageMessage_QtProtobufNested::LocalEnum NestedEnumMessage::localEnumField() const
{
    return dptr->m_localEnumField;
}

RepeatedEnumMessage_QtProtobufNested::LocalEnum NestedEnumMessage::localEnumField2() const
{
    return dptr->m_localEnumField2;
}

MixedEnumUsageMessage_QtProtobufNested::NestedEnumHolder_QtProtobufNested::LocalEnum NestedEnumMessage::localEnumField3() const
{
    return dptr->m_localEnumField3;
}

MixedEnumUsageMessage_QtProtobufNested::NestedEnumHolderLevel1_QtProtobufNested::LocalEnum NestedEnumMessage::localEnumField4() const
{
    return dptr->m_localEnumField4;
}

MixedEnumUsageMessage_QtProtobufNested::NestedEnumHolderLevel1_QtProtobufNested::NestedEnumHolderLevel2_QtProtobufNested::LocalEnum NestedEnumMessage::localEnumField5() const
{
    return dptr->m_localEnumField5;
}

void NestedEnumMessage::setLocalEnumField(MixedEnumUsageMessage_QtProtobufNested::LocalEnum localEnumField)
{
    if (dptr->m_localEnumField != localEnumField) {
        dptr.detach();
        dptr->m_localEnumField = localEnumField;
    }
}

void NestedEnumMessage::setLocalEnumField2(RepeatedEnumMessage_QtProtobufNested::LocalEnum localEnumField2)
{
    if (dptr->m_localEnumField2 != localEnumField2) {
        dptr.detach();
        dptr->m_localEnumField2 = localEnumField2;
    }
}

void NestedEnumMessage::setLocalEnumField3(MixedEnumUsageMessage_QtProtobufNested::NestedEnumHolder_QtProtobufNested::LocalEnum localEnumField3)
{
    if (dptr->m_localEnumField3 != localEnumField3) {
        dptr.detach();
        dptr->m_localEnumField3 = localEnumField3;
    }
}

void NestedEnumMessage::setLocalEnumField4(MixedEnumUsageMessage_QtProtobufNested::NestedEnumHolderLevel1_QtProtobufNested::LocalEnum localEnumField4)
{
    if (dptr->m_localEnumField4 != localEnumField4) {
        dptr.detach();
        dptr->m_localEnumField4 = localEnumField4;
    }
}

void NestedEnumMessage::setLocalEnumField5(MixedEnumUsageMessage_QtProtobufNested::NestedEnumHolderLevel1_QtProtobufNested::NestedEnumHolderLevel2_QtProtobufNested::LocalEnum localEnumField5)
{
    if (dptr->m_localEnumField5 != localEnumField5) {
        dptr.detach();
        dptr->m_localEnumField5 = localEnumField5;
    }
}

} // namespace MixedEnumUsageMessage_QtProtobufNested

class MixedEnumUsageMessage_QtProtobufData : public QSharedData
{
public:
    MixedEnumUsageMessage_QtProtobufData()
        : QSharedData(),
          m_localEnum(MixedEnumUsageMessage_QtProtobufNested::LocalEnum::LOCAL_ENUM_VALUE0)
    {
    }

    MixedEnumUsageMessage_QtProtobufData(const MixedEnumUsageMessage_QtProtobufData &other)
        : QSharedData(other),
          m_localEnum(other.m_localEnum),
          m_localEnumList(other.m_localEnumList),
          m_localEnumMap(other.m_localEnumMap),
          m_msgList(other.m_msgList)
    {
    }

    MixedEnumUsageMessage_QtProtobufNested::LocalEnum m_localEnum;
    MixedEnumUsageMessage_QtProtobufNested::LocalEnumRepeated m_localEnumList;
    MixedEnumUsageMessage::LocalEnumMapEntry m_localEnumMap;
    MixedEnumUsageMessage_QtProtobufNested::NestedEnumMessageRepeated m_msgList;
};

MixedEnumUsageMessage::~MixedEnumUsageMessage() = default;

static constexpr struct {
    QtProtobufPrivate::QProtobufPropertyOrdering::Data data;
    const std::array<uint, 17> qt_protobuf_MixedEnumUsageMessage_uint_data;
    const char qt_protobuf_MixedEnumUsageMessage_char_data[94];
} qt_protobuf_MixedEnumUsageMessage_metadata {
    // data
    {
        0, /* = version */
        4, /* = num fields */
        5, /* = field number offset */
        9, /* = property index offset */
        13, /* = field flags offset */
        47, /* = message full name length */
    },
    // uint_data
    {
        // JSON name offsets:
        48, /* = localEnum */
        58, /* = localEnumList */
        72, /* = localEnumMap */
        85, /* = msgList */
        93, /* = end-of-string-marker */
        // Field numbers:
        1, /* = localEnum */
        2, /* = localEnumList */
        3, /* = localEnumMap */
        4, /* = msgList */
        // Property indices:
        0, /* = localEnum */
        1, /* = localEnumList */
        2, /* = localEnumMap */
        3, /* = msgList */
        // Field flags:
        uint(QtProtobufPrivate::FieldFlag::Enum), /* = localEnum */
        uint(QtProtobufPrivate::FieldFlag::Repeated | QtProtobufPrivate::FieldFlag::Enum), /* = localEnumList */
        uint(QtProtobufPrivate::FieldFlag::Map | QtProtobufPrivate::FieldFlag::Message), /* = localEnumMap */
        uint(QtProtobufPrivate::FieldFlag::Repeated | QtProtobufPrivate::FieldFlag::Message), /* = msgList */
    },
    // char_data
    /* metadata char_data: */
    "qtprotobufnamespace.tests.MixedEnumUsageMessage\0" /* = full message name */
    /* field char_data: */
    "localEnum\0localEnumList\0localEnumMap\0msgList\0"
};

const QtProtobufPrivate::QProtobufPropertyOrdering MixedEnumUsageMessage::staticPropertyOrdering = {
    &qt_protobuf_MixedEnumUsageMessage_metadata.data
};

void MixedEnumUsageMessage::registerTypes()
{
    qRegisterMetaType<MixedEnumUsageMessage>();
    qRegisterMetaType<MixedEnumUsageMessageRepeated>();
    qRegisterMetaType<MixedEnumUsageMessage::LocalEnumMapEntry>();
    qRegisterProtobufMapType<QString, MixedEnumUsageMessage_QtProtobufNested::LocalEnum>();
    qRegisterProtobufEnumType<MixedEnumUsageMessage_QtProtobufNested::LocalEnum>();
    qRegisterMetaType<LocalEnum>();
    qRegisterMetaType<LocalEnumRepeated>();
}

MixedEnumUsageMessage::MixedEnumUsageMessage()
    : QProtobufMessage(&MixedEnumUsageMessage::staticMetaObject, &MixedEnumUsageMessage::staticPropertyOrdering),
      dptr(new MixedEnumUsageMessage_QtProtobufData)
{
}

MixedEnumUsageMessage::MixedEnumUsageMessage(const MixedEnumUsageMessage &other)
    = default;
MixedEnumUsageMessage &MixedEnumUsageMessage::operator =(const MixedEnumUsageMessage &other)
{
    MixedEnumUsageMessage temp(other);
    swap(temp);
    return *this;
}
MixedEnumUsageMessage::MixedEnumUsageMessage(MixedEnumUsageMessage &&other) noexcept
    = default;
bool comparesEqual(const MixedEnumUsageMessage &lhs, const MixedEnumUsageMessage &rhs) noexcept
{
    return operator ==(static_cast<const QProtobufMessage&>(lhs),
                       static_cast<const QProtobufMessage&>(rhs))
        && lhs.dptr->m_localEnum == rhs.dptr->m_localEnum
        && lhs.dptr->m_localEnumList == rhs.dptr->m_localEnumList
        && lhs.dptr->m_localEnumMap == rhs.dptr->m_localEnumMap
        && lhs.dptr->m_msgList == rhs.dptr->m_msgList;
}

MixedEnumUsageMessage_QtProtobufNested::LocalEnum MixedEnumUsageMessage::localEnum() const
{
    return dptr->m_localEnum;
}

const MixedEnumUsageMessage_QtProtobufNested::LocalEnumRepeated &MixedEnumUsageMessage::localEnumList() const &
{
    return dptr->m_localEnumList;
}

const MixedEnumUsageMessage::LocalEnumMapEntry &MixedEnumUsageMessage::localEnumMap() const &
{
    return dptr->m_localEnumMap;
}

const MixedEnumUsageMessage_QtProtobufNested::NestedEnumMessageRepeated &MixedEnumUsageMessage::msgList() const &
{
    return dptr->m_msgList;
}

void MixedEnumUsageMessage::setLocalEnum(MixedEnumUsageMessage_QtProtobufNested::LocalEnum localEnum)
{
    if (dptr->m_localEnum != localEnum) {
        dptr.detach();
        dptr->m_localEnum = localEnum;
    }
}

void MixedEnumUsageMessage::setLocalEnumList(const MixedEnumUsageMessage_QtProtobufNested::LocalEnumRepeated &localEnumList)
{
    if (dptr->m_localEnumList != localEnumList) {
        dptr.detach();
        dptr->m_localEnumList = localEnumList;
    }
}

void MixedEnumUsageMessage::setLocalEnumList(MixedEnumUsageMessage_QtProtobufNested::LocalEnumRepeated &&localEnumList)
{
    if (dptr->m_localEnumList != localEnumList) {
        dptr.detach();
        dptr->m_localEnumList = std::move(localEnumList);
    }
}

void MixedEnumUsageMessage::setLocalEnumMap(const MixedEnumUsageMessage::LocalEnumMapEntry &localEnumMap)
{
    if (dptr->m_localEnumMap != localEnumMap) {
        dptr.detach();
        dptr->m_localEnumMap = localEnumMap;
    }
}

void MixedEnumUsageMessage::setLocalEnumMap(MixedEnumUsageMessage::LocalEnumMapEntry &&localEnumMap)
{
    if (dptr->m_localEnumMap != localEnumMap) {
        dptr.detach();
        dptr->m_localEnumMap = std::move(localEnumMap);
    }
}

void MixedEnumUsageMessage::setMsgList(const MixedEnumUsageMessage_QtProtobufNested::NestedEnumMessageRepeated &msgList)
{
    if (dptr->m_msgList != msgList) {
        dptr.detach();
        dptr->m_msgList = msgList;
    }
}

void MixedEnumUsageMessage::setMsgList(MixedEnumUsageMessage_QtProtobufNested::NestedEnumMessageRepeated &&msgList)
{
    if (dptr->m_msgList != msgList) {
        dptr.detach();
        dptr->m_msgList = std::move(msgList);
    }
}


class SimpleFileEnumMessage_QtProtobufData : public QSharedData
{
public:
    SimpleFileEnumMessage_QtProtobufData()
        : QSharedData(),
          m_globalEnum(TestEnumGadget::TestEnum::TEST_ENUM_VALUE0)
    {
    }

    SimpleFileEnumMessage_QtProtobufData(const SimpleFileEnumMessage_QtProtobufData &other)
        : QSharedData(other),
          m_globalEnum(other.m_globalEnum),
          m_globalEnumList(other.m_globalEnumList)
    {
    }

    TestEnumGadget::TestEnum m_globalEnum;
    TestEnumGadget::TestEnumRepeated m_globalEnumList;
};

SimpleFileEnumMessage::~SimpleFileEnumMessage() = default;

static constexpr struct {
    QtProtobufPrivate::QProtobufPropertyOrdering::Data data;
    const std::array<uint, 9> qt_protobuf_SimpleFileEnumMessage_uint_data;
    const char qt_protobuf_SimpleFileEnumMessage_char_data[75];
} qt_protobuf_SimpleFileEnumMessage_metadata {
    // data
    {
        0, /* = version */
        2, /* = num fields */
        3, /* = field number offset */
        5, /* = property index offset */
        7, /* = field flags offset */
        47, /* = message full name length */
    },
    // uint_data
    {
        // JSON name offsets:
        48, /* = globalEnum */
        59, /* = globalEnumList */
        74, /* = end-of-string-marker */
        // Field numbers:
        1, /* = globalEnum */
        2, /* = globalEnumList */
        // Property indices:
        0, /* = globalEnum */
        1, /* = globalEnumList */
        // Field flags:
        uint(QtProtobufPrivate::FieldFlag::Enum), /* = globalEnum */
        uint(QtProtobufPrivate::FieldFlag::Repeated | QtProtobufPrivate::FieldFlag::Enum), /* = globalEnumList */
    },
    // char_data
    /* metadata char_data: */
    "qtprotobufnamespace.tests.SimpleFileEnumMessage\0" /* = full message name */
    /* field char_data: */
    "globalEnum\0globalEnumList\0"
};

const QtProtobufPrivate::QProtobufPropertyOrdering SimpleFileEnumMessage::staticPropertyOrdering = {
    &qt_protobuf_SimpleFileEnumMessage_metadata.data
};

void SimpleFileEnumMessage::registerTypes()
{
    qRegisterMetaType<SimpleFileEnumMessage>();
    qRegisterMetaType<SimpleFileEnumMessageRepeated>();
}

SimpleFileEnumMessage::SimpleFileEnumMessage()
    : QProtobufMessage(&SimpleFileEnumMessage::staticMetaObject, &SimpleFileEnumMessage::staticPropertyOrdering),
      dptr(new SimpleFileEnumMessage_QtProtobufData)
{
}

SimpleFileEnumMessage::SimpleFileEnumMessage(const SimpleFileEnumMessage &other)
    = default;
SimpleFileEnumMessage &SimpleFileEnumMessage::operator =(const SimpleFileEnumMessage &other)
{
    SimpleFileEnumMessage temp(other);
    swap(temp);
    return *this;
}
SimpleFileEnumMessage::SimpleFileEnumMessage(SimpleFileEnumMessage &&other) noexcept
    = default;
bool comparesEqual(const SimpleFileEnumMessage &lhs, const SimpleFileEnumMessage &rhs) noexcept
{
    return operator ==(static_cast<const QProtobufMessage&>(lhs),
                       static_cast<const QProtobufMessage&>(rhs))
        && lhs.dptr->m_globalEnum == rhs.dptr->m_globalEnum
        && lhs.dptr->m_globalEnumList == rhs.dptr->m_globalEnumList;
}

TestEnumGadget::TestEnum SimpleFileEnumMessage::globalEnum() const
{
    return dptr->m_globalEnum;
}

const TestEnumGadget::TestEnumRepeated &SimpleFileEnumMessage::globalEnumList() const &
{
    return dptr->m_globalEnumList;
}

void SimpleFileEnumMessage::setGlobalEnum(TestEnumGadget::TestEnum globalEnum)
{
    if (dptr->m_globalEnum != globalEnum) {
        dptr.detach();
        dptr->m_globalEnum = globalEnum;
    }
}

void SimpleFileEnumMessage::setGlobalEnumList(const TestEnumGadget::TestEnumRepeated &globalEnumList)
{
    if (dptr->m_globalEnumList != globalEnumList) {
        dptr.detach();
        dptr->m_globalEnumList = globalEnumList;
    }
}

void SimpleFileEnumMessage::setGlobalEnumList(TestEnumGadget::TestEnumRepeated &&globalEnumList)
{
    if (dptr->m_globalEnumList != globalEnumList) {
        dptr.detach();
        dptr->m_globalEnumList = std::move(globalEnumList);
    }
}


class StepChildEnumMessage_QtProtobufData : public QSharedData
{
public:
    StepChildEnumMessage_QtProtobufData()
        : QSharedData(),
          m_localStepChildEnum(SimpleEnumMessage_QtProtobufNested::LocalEnum::LOCAL_ENUM_VALUE0)
    {
    }

    StepChildEnumMessage_QtProtobufData(const StepChildEnumMessage_QtProtobufData &other)
        : QSharedData(other),
          m_localStepChildEnum(other.m_localStepChildEnum),
          m_localStepChildList(other.m_localStepChildList)
    {
    }

    SimpleEnumMessage_QtProtobufNested::LocalEnum m_localStepChildEnum;
    SimpleEnumMessage_QtProtobufNested::LocalEnumRepeated m_localStepChildList;
};

StepChildEnumMessage::~StepChildEnumMessage() = default;

static constexpr struct {
    QtProtobufPrivate::QProtobufPropertyOrdering::Data data;
    const std::array<uint, 9> qt_protobuf_StepChildEnumMessage_uint_data;
    const char qt_protobuf_StepChildEnumMessage_char_data[86];
} qt_protobuf_StepChildEnumMessage_metadata {
    // data
    {
        0, /* = version */
        2, /* = num fields */
        3, /* = field number offset */
        5, /* = property index offset */
        7, /* = field flags offset */
        46, /* = message full name length */
    },
    // uint_data
    {
        // JSON name offsets:
        47, /* = localStepChildEnum */
        66, /* = localStepChildList */
        85, /* = end-of-string-marker */
        // Field numbers:
        1, /* = localStepChildEnum */
        2, /* = localStepChildList */
        // Property indices:
        0, /* = localStepChildEnum */
        1, /* = localStepChildList */
        // Field flags:
        uint(QtProtobufPrivate::FieldFlag::Enum), /* = localStepChildEnum */
        uint(QtProtobufPrivate::FieldFlag::Repeated | QtProtobufPrivate::FieldFlag::Enum), /* = localStepChildList */
    },
    // char_data
    /* metadata char_data: */
    "qtprotobufnamespace.tests.StepChildEnumMessage\0" /* = full message name */
    /* field char_data: */
    "localStepChildEnum\0localStepChildList\0"
};

const QtProtobufPrivate::QProtobufPropertyOrdering StepChildEnumMessage::staticPropertyOrdering = {
    &qt_protobuf_StepChildEnumMessage_metadata.data
};

void StepChildEnumMessage::registerTypes()
{
    qRegisterMetaType<StepChildEnumMessage>();
    qRegisterMetaType<StepChildEnumMessageRepeated>();
}

StepChildEnumMessage::StepChildEnumMessage()
    : QProtobufMessage(&StepChildEnumMessage::staticMetaObject, &StepChildEnumMessage::staticPropertyOrdering),
      dptr(new StepChildEnumMessage_QtProtobufData)
{
}

StepChildEnumMessage::StepChildEnumMessage(const StepChildEnumMessage &other)
    = default;
StepChildEnumMessage &StepChildEnumMessage::operator =(const StepChildEnumMessage &other)
{
    StepChildEnumMessage temp(other);
    swap(temp);
    return *this;
}
StepChildEnumMessage::StepChildEnumMessage(StepChildEnumMessage &&other) noexcept
    = default;
bool comparesEqual(const StepChildEnumMessage &lhs, const StepChildEnumMessage &rhs) noexcept
{
    return operator ==(static_cast<const QProtobufMessage&>(lhs),
                       static_cast<const QProtobufMessage&>(rhs))
        && lhs.dptr->m_localStepChildEnum == rhs.dptr->m_localStepChildEnum
        && lhs.dptr->m_localStepChildList == rhs.dptr->m_localStepChildList;
}

SimpleEnumMessage_QtProtobufNested::LocalEnum StepChildEnumMessage::localStepChildEnum() const
{
    return dptr->m_localStepChildEnum;
}

const SimpleEnumMessage_QtProtobufNested::LocalEnumRepeated &StepChildEnumMessage::localStepChildList() const &
{
    return dptr->m_localStepChildList;
}

void StepChildEnumMessage::setLocalStepChildEnum(SimpleEnumMessage_QtProtobufNested::LocalEnum localStepChildEnum)
{
    if (dptr->m_localStepChildEnum != localStepChildEnum) {
        dptr.detach();
        dptr->m_localStepChildEnum = localStepChildEnum;
    }
}

void StepChildEnumMessage::setLocalStepChildList(const SimpleEnumMessage_QtProtobufNested::LocalEnumRepeated &localStepChildList)
{
    if (dptr->m_localStepChildList != localStepChildList) {
        dptr.detach();
        dptr->m_localStepChildList = localStepChildList;
    }
}

void StepChildEnumMessage::setLocalStepChildList(SimpleEnumMessage_QtProtobufNested::LocalEnumRepeated &&localStepChildList)
{
    if (dptr->m_localStepChildList != localStepChildList) {
        dptr.detach();
        dptr->m_localStepChildList = std::move(localStepChildList);
    }
}


class A_QtProtobufData : public QSharedData
{
public:
    A_QtProtobufData()
        : QSharedData(),
          m_val(B_QtProtobufNested::BEnum::BVal0)
    {
    }

    A_QtProtobufData(const A_QtProtobufData &other)
        : QSharedData(other),
          m_val(other.m_val)
    {
    }

    B_QtProtobufNested::BEnum m_val;
};

A::~A() = default;

static constexpr struct {
    QtProtobufPrivate::QProtobufPropertyOrdering::Data data;
    const std::array<uint, 5> qt_protobuf_A_uint_data;
    const char qt_protobuf_A_char_data[33];
} qt_protobuf_A_metadata {
    // data
    {
        0, /* = version */
        1, /* = num fields */
        2, /* = field number offset */
        3, /* = property index offset */
        4, /* = field flags offset */
        27, /* = message full name length */
    },
    // uint_data
    {
        // JSON name offsets:
        28, /* = val */
        32, /* = end-of-string-marker */
        // Field numbers:
        1, /* = val */
        // Property indices:
        0, /* = val */
        // Field flags:
        uint(QtProtobufPrivate::FieldFlag::Enum), /* = val */
    },
    // char_data
    /* metadata char_data: */
    "qtprotobufnamespace.tests.A\0" /* = full message name */
    /* field char_data: */
    "val\0"
};

const QtProtobufPrivate::QProtobufPropertyOrdering A::staticPropertyOrdering = {
    &qt_protobuf_A_metadata.data
};

void A::registerTypes()
{
    qRegisterMetaType<A>();
    qRegisterMetaType<ARepeated>();
    qRegisterProtobufEnumType<A_QtProtobufNested::AEnum>();
    qRegisterMetaType<AEnum>();
    qRegisterMetaType<AEnumRepeated>();
}

A::A()
    : QProtobufMessage(&A::staticMetaObject, &A::staticPropertyOrdering),
      dptr(new A_QtProtobufData)
{
}

A::A(const A &other)
    = default;
A &A::operator =(const A &other)
{
    A temp(other);
    swap(temp);
    return *this;
}
A::A(A &&other) noexcept
    = default;
bool comparesEqual(const A &lhs, const A &rhs) noexcept
{
    return operator ==(static_cast<const QProtobufMessage&>(lhs),
                       static_cast<const QProtobufMessage&>(rhs))
        && lhs.dptr->m_val == rhs.dptr->m_val;
}

B_QtProtobufNested::BEnum A::val() const
{
    return dptr->m_val;
}

void A::setVal(B_QtProtobufNested::BEnum val)
{
    if (dptr->m_val != val) {
        dptr.detach();
        dptr->m_val = val;
    }
}


class B_QtProtobufData : public QSharedData
{
public:
    B_QtProtobufData()
        : QSharedData(),
          m_val(A_QtProtobufNested::AEnum::AVal0)
    {
    }

    B_QtProtobufData(const B_QtProtobufData &other)
        : QSharedData(other),
          m_val(other.m_val)
    {
    }

    A_QtProtobufNested::AEnum m_val;
};

B::~B() = default;

static constexpr struct {
    QtProtobufPrivate::QProtobufPropertyOrdering::Data data;
    const std::array<uint, 5> qt_protobuf_B_uint_data;
    const char qt_protobuf_B_char_data[33];
} qt_protobuf_B_metadata {
    // data
    {
        0, /* = version */
        1, /* = num fields */
        2, /* = field number offset */
        3, /* = property index offset */
        4, /* = field flags offset */
        27, /* = message full name length */
    },
    // uint_data
    {
        // JSON name offsets:
        28, /* = val */
        32, /* = end-of-string-marker */
        // Field numbers:
        1, /* = val */
        // Property indices:
        0, /* = val */
        // Field flags:
        uint(QtProtobufPrivate::FieldFlag::Enum), /* = val */
    },
    // char_data
    /* metadata char_data: */
    "qtprotobufnamespace.tests.B\0" /* = full message name */
    /* field char_data: */
    "val\0"
};

const QtProtobufPrivate::QProtobufPropertyOrdering B::staticPropertyOrdering = {
    &qt_protobuf_B_metadata.data
};

void B::registerTypes()
{
    qRegisterMetaType<B>();
    qRegisterMetaType<BRepeated>();
    qRegisterProtobufEnumType<B_QtProtobufNested::BEnum>();
    qRegisterMetaType<BEnum>();
    qRegisterMetaType<BEnumRepeated>();
}

B::B()
    : QProtobufMessage(&B::staticMetaObject, &B::staticPropertyOrdering),
      dptr(new B_QtProtobufData)
{
}

B::B(const B &other)
    = default;
B &B::operator =(const B &other)
{
    B temp(other);
    swap(temp);
    return *this;
}
B::B(B &&other) noexcept
    = default;
bool comparesEqual(const B &lhs, const B &rhs) noexcept
{
    return operator ==(static_cast<const QProtobufMessage&>(lhs),
                       static_cast<const QProtobufMessage&>(rhs))
        && lhs.dptr->m_val == rhs.dptr->m_val;
}

A_QtProtobufNested::AEnum B::val() const
{
    return dptr->m_val;
}

void B::setVal(A_QtProtobufNested::AEnum val)
{
    if (dptr->m_val != val) {
        dptr.detach();
        dptr->m_val = val;
    }
}

} // namespace qtprotobufnamespace::tests

#include "moc_enummessages.qpb.cpp"
