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


#include "google/protobuf/type.qpb.h"

#include <QtProtobuf/qprotobufregistration.h>

#include <cmath>

namespace google::protobuf {
static QtProtobuf::ProtoTypeRegistrar ProtoTypeRegistrarSyntaxGadget(SyntaxGadget::registerTypes);
void SyntaxGadget::registerTypes()
{
    qRegisterMetaType<Syntax>();
    qRegisterMetaType<google::protobuf::SyntaxGadget::Syntax>();
    qRegisterProtobufEnumType<google::protobuf::SyntaxGadget::Syntax>();
}


class Type_QtProtobufData : public QSharedData
{
public:
    Type_QtProtobufData()
        : QSharedData(),
          m_sourceContext(nullptr),
          m_syntax(SyntaxGadget::Syntax::SYNTAX_PROTO2)
    {
    }

    Type_QtProtobufData(const Type_QtProtobufData &other)
        : QSharedData(other),
          m_name(other.m_name),
          m_fields(other.m_fields),
          m_oneofs(other.m_oneofs),
          m_options(other.m_options),
          m_sourceContext(other.m_sourceContext
                                               ? new SourceContext(*other.m_sourceContext)
                                               : nullptr),
          m_syntax(other.m_syntax),
          m_edition(other.m_edition)
    {
    }

    QString m_name;
    QList<Field> m_fields;
    QStringList m_oneofs;
    QList<Option> m_options;
    QtProtobufPrivate::QProtobufLazyMessagePointer<SourceContext> m_sourceContext;
    SyntaxGadget::Syntax m_syntax;
    QString m_edition;
};

Type::~Type() = default;

static constexpr struct {
    QtProtobufPrivate::QProtobufPropertyOrdering::Data data;
    const std::array<uint, 29> qt_protobuf_Type_uint_data;
    const char qt_protobuf_Type_char_data[78];
} qt_protobuf_Type_metadata {
    // data
    {
        0, /* = version */
        7, /* = num fields */
        8, /* = field number offset */
        15, /* = property index offset */
        22, /* = field flags offset */
        20, /* = message full name length */
    },
    // uint_data
    {
        // JSON name offsets:
        21, /* = name */
        26, /* = fields */
        33, /* = oneofs */
        40, /* = options */
        48, /* = sourceContext */
        62, /* = syntax */
        69, /* = edition */
        77, /* = end-of-string-marker */
        // Field numbers:
        1, /* = name */
        2, /* = fields */
        3, /* = oneofs */
        4, /* = options */
        5, /* = sourceContext */
        6, /* = syntax */
        7, /* = edition */
        // Property indices:
        0, /* = name */
        1, /* = fields */
        3, /* = oneofs */
        4, /* = options */
        6, /* = sourceContext */
        8, /* = syntax */
        9, /* = edition */
        // Field flags:
        uint(QtProtobufPrivate::FieldFlag::NoFlags), /* = name */
        uint(QtProtobufPrivate::FieldFlag::Repeated | QtProtobufPrivate::FieldFlag::Message), /* = fields */
        uint(QtProtobufPrivate::FieldFlag::Repeated), /* = oneofs */
        uint(QtProtobufPrivate::FieldFlag::Repeated | QtProtobufPrivate::FieldFlag::Message), /* = options */
        uint(QtProtobufPrivate::FieldFlag::ExplicitPresence | QtProtobufPrivate::FieldFlag::Message), /* = sourceContext */
        uint(QtProtobufPrivate::FieldFlag::Enum), /* = syntax */
        uint(QtProtobufPrivate::FieldFlag::NoFlags), /* = edition */
    },
    // char_data
    /* metadata char_data: */
    "google.protobuf.Type\0" /* = full message name */
    /* field char_data: */
    "name\0fields\0oneofs\0options\0sourceContext\0"
    "syntax\0edition\0"
};

const QtProtobufPrivate::QProtobufPropertyOrdering Type::staticPropertyOrdering = {
    &qt_protobuf_Type_metadata.data
};

void Type::registerTypes()
{
    qRegisterMetaType<Type>();
    qRegisterMetaType<QList<Type>>();
}

Type::Type()
    : QProtobufMessage(&Type::staticMetaObject, &Type::staticPropertyOrdering),
      dptr(new Type_QtProtobufData)
{
}

Type::Type(const Type &other)
    = default;
Type &Type::operator =(const Type &other)
{
    Type temp(other);
    swap(temp);
    return *this;
}
Type::Type(Type &&other) noexcept
    = default;
Type::operator QVariant() const
{
    return QVariant::fromValue(*this);
}
bool comparesEqual(const Type &lhs, const Type &rhs) noexcept
{
    return operator ==(static_cast<const QProtobufMessage&>(lhs),
                       static_cast<const QProtobufMessage&>(rhs))
        && lhs.dptr->m_name == rhs.dptr->m_name
        && lhs.dptr->m_fields == rhs.dptr->m_fields
        && lhs.dptr->m_oneofs == rhs.dptr->m_oneofs
        && lhs.dptr->m_options == rhs.dptr->m_options
        && (lhs.dptr->m_sourceContext == rhs.dptr->m_sourceContext
            || *lhs.dptr->m_sourceContext == *rhs.dptr->m_sourceContext)
        && lhs.dptr->m_syntax == rhs.dptr->m_syntax
        && lhs.dptr->m_edition == rhs.dptr->m_edition;
}

const QString &Type::name() const &
{
    return dptr->m_name;
}

const QList<Field> &Type::fields() const &
{
    return dptr->m_fields;
}

const QStringList &Type::oneofs() const &
{
    return dptr->m_oneofs;
}

const QList<Option> &Type::options() const &
{
    return dptr->m_options;
}

SourceContext *Type::sourceContext_p()
{
    if (!dptr->m_sourceContext)
        dptr.detach();
    return dptr->m_sourceContext.get();
}

bool Type::hasSourceContext() const
{
    return dptr->m_sourceContext.operator bool();
}

const SourceContext &Type::sourceContext() const &
{
    return *dptr->m_sourceContext;
}

SourceContext &Type::mutSourceContext() &
{
    dptr.detach();
    return *dptr->m_sourceContext;
}

void Type::clearSourceContext()
{
    if (dptr->m_sourceContext) {
        dptr.detach();
        dptr->m_sourceContext.reset();
    }
}

SyntaxGadget::Syntax Type::syntax() const
{
    return dptr->m_syntax;
}

const QString &Type::edition() const &
{
    return dptr->m_edition;
}

void Type::setName(const QString &name)
{
    if (dptr->m_name != name) {
        dptr.detach();
        dptr->m_name = name;
    }
}

void Type::setName(QString &&name)
{
    if (dptr->m_name != name) {
        dptr.detach();
        dptr->m_name = std::move(name);
    }
}

void Type::setFields(const QList<Field> &fields)
{
    if (dptr->m_fields != fields) {
        dptr.detach();
        dptr->m_fields = fields;
    }
}

void Type::setFields(QList<Field> &&fields)
{
    if (dptr->m_fields != fields) {
        dptr.detach();
        dptr->m_fields = std::move(fields);
    }
}

void Type::setOneofs(const QStringList &oneofs)
{
    if (dptr->m_oneofs != oneofs) {
        dptr.detach();
        dptr->m_oneofs = oneofs;
    }
}

void Type::setOneofs(QStringList &&oneofs)
{
    if (dptr->m_oneofs != oneofs) {
        dptr.detach();
        dptr->m_oneofs = std::move(oneofs);
    }
}

void Type::setOptions(const QList<Option> &options)
{
    if (dptr->m_options != options) {
        dptr.detach();
        dptr->m_options = options;
    }
}

void Type::setOptions(QList<Option> &&options)
{
    if (dptr->m_options != options) {
        dptr.detach();
        dptr->m_options = std::move(options);
    }
}

void Type::setSourceContext_p(SourceContext *sourceContext)
{
    if (dptr->m_sourceContext.get() != sourceContext) {
        dptr.detach();
        dptr->m_sourceContext.reset(sourceContext);
    }
}

void Type::setSourceContext(const SourceContext &sourceContext)
{
    if (*dptr->m_sourceContext != sourceContext) {
        dptr.detach();
        *dptr->m_sourceContext = sourceContext;
    }
}

void Type::setSourceContext(SourceContext &&sourceContext)
{
    if (*dptr->m_sourceContext != sourceContext) {
        dptr.detach();
        *dptr->m_sourceContext = std::move(sourceContext);
    }
}

void Type::setSyntax(SyntaxGadget::Syntax syntax)
{
    if (dptr->m_syntax != syntax) {
        dptr.detach();
        dptr->m_syntax = syntax;
    }
}

void Type::setEdition(const QString &edition)
{
    if (dptr->m_edition != edition) {
        dptr.detach();
        dptr->m_edition = edition;
    }
}

void Type::setEdition(QString &&edition)
{
    if (dptr->m_edition != edition) {
        dptr.detach();
        dptr->m_edition = std::move(edition);
    }
}


class Field_QtProtobufData : public QSharedData
{
public:
    Field_QtProtobufData()
        : QSharedData(),
          m_kind(Field_QtProtobufNested::Kind::TYPE_UNKNOWN),
          m_cardinality(Field_QtProtobufNested::Cardinality::CARDINALITY_UNKNOWN),
          m_number(0),
          m_oneofIndex(0),
          m_packed(false)
    {
    }

    Field_QtProtobufData(const Field_QtProtobufData &other)
        : QSharedData(other),
          m_kind(other.m_kind),
          m_cardinality(other.m_cardinality),
          m_number(other.m_number),
          m_name(other.m_name),
          m_typeUrl(other.m_typeUrl),
          m_oneofIndex(other.m_oneofIndex),
          m_packed(other.m_packed),
          m_options(other.m_options),
          m_jsonName(other.m_jsonName),
          m_defaultValue(other.m_defaultValue)
    {
    }

    Field_QtProtobufNested::Kind m_kind;
    Field_QtProtobufNested::Cardinality m_cardinality;
    QtProtobuf::int32 m_number;
    QString m_name;
    QString m_typeUrl;
    QtProtobuf::int32 m_oneofIndex;
    bool m_packed;
    QList<Option> m_options;
    QString m_jsonName;
    QString m_defaultValue;
};

Field::~Field() = default;

static constexpr struct {
    QtProtobufPrivate::QProtobufPropertyOrdering::Data data;
    const std::array<uint, 41> qt_protobuf_Field_uint_data;
    const char qt_protobuf_Field_char_data[108];
} qt_protobuf_Field_metadata {
    // data
    {
        0, /* = version */
        10, /* = num fields */
        11, /* = field number offset */
        21, /* = property index offset */
        31, /* = field flags offset */
        21, /* = message full name length */
    },
    // uint_data
    {
        // JSON name offsets:
        22, /* = kind */
        27, /* = cardinality */
        39, /* = number */
        46, /* = name */
        51, /* = typeUrl */
        59, /* = oneofIndex */
        70, /* = packed */
        77, /* = options */
        85, /* = jsonName */
        94, /* = defaultValue */
        107, /* = end-of-string-marker */
        // Field numbers:
        1, /* = kind */
        2, /* = cardinality */
        3, /* = number */
        4, /* = name */
        6, /* = typeUrl */
        7, /* = oneofIndex */
        8, /* = packed */
        9, /* = options */
        10, /* = jsonName */
        11, /* = defaultValue */
        // Property indices:
        0, /* = kind */
        1, /* = cardinality */
        2, /* = number */
        3, /* = name */
        4, /* = typeUrl */
        5, /* = oneofIndex */
        6, /* = packed */
        7, /* = options */
        9, /* = jsonName */
        10, /* = defaultValue */
        // Field flags:
        uint(QtProtobufPrivate::FieldFlag::Enum), /* = kind */
        uint(QtProtobufPrivate::FieldFlag::Enum), /* = cardinality */
        uint(QtProtobufPrivate::FieldFlag::NoFlags), /* = number */
        uint(QtProtobufPrivate::FieldFlag::NoFlags), /* = name */
        uint(QtProtobufPrivate::FieldFlag::NoFlags), /* = typeUrl */
        uint(QtProtobufPrivate::FieldFlag::NoFlags), /* = oneofIndex */
        uint(QtProtobufPrivate::FieldFlag::NoFlags), /* = packed */
        uint(QtProtobufPrivate::FieldFlag::Repeated | QtProtobufPrivate::FieldFlag::Message), /* = options */
        uint(QtProtobufPrivate::FieldFlag::NoFlags), /* = jsonName */
        uint(QtProtobufPrivate::FieldFlag::NoFlags), /* = defaultValue */
    },
    // char_data
    /* metadata char_data: */
    "google.protobuf.Field\0" /* = full message name */
    /* field char_data: */
    "kind\0cardinality\0number\0name\0typeUrl\0"
    "oneofIndex\0packed\0options\0jsonName\0defaultValue\0"
};

const QtProtobufPrivate::QProtobufPropertyOrdering Field::staticPropertyOrdering = {
    &qt_protobuf_Field_metadata.data
};

void Field::registerTypes()
{
    qRegisterMetaType<Field>();
    qRegisterMetaType<QList<Field>>();
    qRegisterProtobufEnumType<Field_QtProtobufNested::Kind>();
    qRegisterMetaType<Kind>();
    qRegisterMetaType<QList<Kind>>();
    qRegisterProtobufEnumType<Field_QtProtobufNested::Cardinality>();
    qRegisterMetaType<Cardinality>();
    qRegisterMetaType<QList<Cardinality>>();
}

Field::Field()
    : QProtobufMessage(&Field::staticMetaObject, &Field::staticPropertyOrdering),
      dptr(new Field_QtProtobufData)
{
}

Field::Field(const Field &other)
    = default;
Field &Field::operator =(const Field &other)
{
    Field temp(other);
    swap(temp);
    return *this;
}
Field::Field(Field &&other) noexcept
    = default;
Field::operator QVariant() const
{
    return QVariant::fromValue(*this);
}
bool comparesEqual(const Field &lhs, const Field &rhs) noexcept
{
    return operator ==(static_cast<const QProtobufMessage&>(lhs),
                       static_cast<const QProtobufMessage&>(rhs))
        && lhs.dptr->m_kind == rhs.dptr->m_kind
        && lhs.dptr->m_cardinality == rhs.dptr->m_cardinality
        && lhs.dptr->m_number == rhs.dptr->m_number
        && lhs.dptr->m_name == rhs.dptr->m_name
        && lhs.dptr->m_typeUrl == rhs.dptr->m_typeUrl
        && lhs.dptr->m_oneofIndex == rhs.dptr->m_oneofIndex
        && lhs.dptr->m_packed == rhs.dptr->m_packed
        && lhs.dptr->m_options == rhs.dptr->m_options
        && lhs.dptr->m_jsonName == rhs.dptr->m_jsonName
        && lhs.dptr->m_defaultValue == rhs.dptr->m_defaultValue;
}

Field_QtProtobufNested::Kind Field::kind() const
{
    return dptr->m_kind;
}

Field_QtProtobufNested::Cardinality Field::cardinality() const
{
    return dptr->m_cardinality;
}

QtProtobuf::int32 Field::number() const
{
    return dptr->m_number;
}

const QString &Field::name() const &
{
    return dptr->m_name;
}

const QString &Field::typeUrl() const &
{
    return dptr->m_typeUrl;
}

QtProtobuf::int32 Field::oneofIndex() const
{
    return dptr->m_oneofIndex;
}

bool Field::packed() const
{
    return dptr->m_packed;
}

const QList<Option> &Field::options() const &
{
    return dptr->m_options;
}

const QString &Field::jsonName() const &
{
    return dptr->m_jsonName;
}

const QString &Field::defaultValue() const &
{
    return dptr->m_defaultValue;
}

void Field::setKind(Field_QtProtobufNested::Kind kind)
{
    if (dptr->m_kind != kind) {
        dptr.detach();
        dptr->m_kind = kind;
    }
}

void Field::setCardinality(Field_QtProtobufNested::Cardinality cardinality)
{
    if (dptr->m_cardinality != cardinality) {
        dptr.detach();
        dptr->m_cardinality = cardinality;
    }
}

void Field::setNumber(QtProtobuf::int32 number)
{
    if (dptr->m_number != number) {
        dptr.detach();
        dptr->m_number = number;
    }
}

void Field::setName(const QString &name)
{
    if (dptr->m_name != name) {
        dptr.detach();
        dptr->m_name = name;
    }
}

void Field::setName(QString &&name)
{
    if (dptr->m_name != name) {
        dptr.detach();
        dptr->m_name = std::move(name);
    }
}

void Field::setTypeUrl(const QString &typeUrl)
{
    if (dptr->m_typeUrl != typeUrl) {
        dptr.detach();
        dptr->m_typeUrl = typeUrl;
    }
}

void Field::setTypeUrl(QString &&typeUrl)
{
    if (dptr->m_typeUrl != typeUrl) {
        dptr.detach();
        dptr->m_typeUrl = std::move(typeUrl);
    }
}

void Field::setOneofIndex(QtProtobuf::int32 oneofIndex)
{
    if (dptr->m_oneofIndex != oneofIndex) {
        dptr.detach();
        dptr->m_oneofIndex = oneofIndex;
    }
}

void Field::setPacked(bool packed)
{
    if (dptr->m_packed != packed) {
        dptr.detach();
        dptr->m_packed = packed;
    }
}

void Field::setOptions(const QList<Option> &options)
{
    if (dptr->m_options != options) {
        dptr.detach();
        dptr->m_options = options;
    }
}

void Field::setOptions(QList<Option> &&options)
{
    if (dptr->m_options != options) {
        dptr.detach();
        dptr->m_options = std::move(options);
    }
}

void Field::setJsonName(const QString &jsonName)
{
    if (dptr->m_jsonName != jsonName) {
        dptr.detach();
        dptr->m_jsonName = jsonName;
    }
}

void Field::setJsonName(QString &&jsonName)
{
    if (dptr->m_jsonName != jsonName) {
        dptr.detach();
        dptr->m_jsonName = std::move(jsonName);
    }
}

void Field::setDefaultValue(const QString &defaultValue)
{
    if (dptr->m_defaultValue != defaultValue) {
        dptr.detach();
        dptr->m_defaultValue = defaultValue;
    }
}

void Field::setDefaultValue(QString &&defaultValue)
{
    if (dptr->m_defaultValue != defaultValue) {
        dptr.detach();
        dptr->m_defaultValue = std::move(defaultValue);
    }
}


class Enum_QtProtobufData : public QSharedData
{
public:
    Enum_QtProtobufData()
        : QSharedData(),
          m_sourceContext(nullptr),
          m_syntax(SyntaxGadget::Syntax::SYNTAX_PROTO2)
    {
    }

    Enum_QtProtobufData(const Enum_QtProtobufData &other)
        : QSharedData(other),
          m_name(other.m_name),
          m_enumvalue(other.m_enumvalue),
          m_options(other.m_options),
          m_sourceContext(other.m_sourceContext
                                               ? new SourceContext(*other.m_sourceContext)
                                               : nullptr),
          m_syntax(other.m_syntax),
          m_edition(other.m_edition)
    {
    }

    QString m_name;
    QList<EnumValue> m_enumvalue;
    QList<Option> m_options;
    QtProtobufPrivate::QProtobufLazyMessagePointer<SourceContext> m_sourceContext;
    SyntaxGadget::Syntax m_syntax;
    QString m_edition;
};

Enum::~Enum() = default;

static constexpr struct {
    QtProtobufPrivate::QProtobufPropertyOrdering::Data data;
    const std::array<uint, 25> qt_protobuf_Enum_uint_data;
    const char qt_protobuf_Enum_char_data[74];
} qt_protobuf_Enum_metadata {
    // data
    {
        0, /* = version */
        6, /* = num fields */
        7, /* = field number offset */
        13, /* = property index offset */
        19, /* = field flags offset */
        20, /* = message full name length */
    },
    // uint_data
    {
        // JSON name offsets:
        21, /* = name */
        26, /* = enumvalue */
        36, /* = options */
        44, /* = sourceContext */
        58, /* = syntax */
        65, /* = edition */
        73, /* = end-of-string-marker */
        // Field numbers:
        1, /* = name */
        2, /* = enumvalue */
        3, /* = options */
        4, /* = sourceContext */
        5, /* = syntax */
        6, /* = edition */
        // Property indices:
        0, /* = name */
        1, /* = enumvalue */
        3, /* = options */
        5, /* = sourceContext */
        7, /* = syntax */
        8, /* = edition */
        // Field flags:
        uint(QtProtobufPrivate::FieldFlag::NoFlags), /* = name */
        uint(QtProtobufPrivate::FieldFlag::Repeated | QtProtobufPrivate::FieldFlag::Message), /* = enumvalue */
        uint(QtProtobufPrivate::FieldFlag::Repeated | QtProtobufPrivate::FieldFlag::Message), /* = options */
        uint(QtProtobufPrivate::FieldFlag::ExplicitPresence | QtProtobufPrivate::FieldFlag::Message), /* = sourceContext */
        uint(QtProtobufPrivate::FieldFlag::Enum), /* = syntax */
        uint(QtProtobufPrivate::FieldFlag::NoFlags), /* = edition */
    },
    // char_data
    /* metadata char_data: */
    "google.protobuf.Enum\0" /* = full message name */
    /* field char_data: */
    "name\0enumvalue\0options\0sourceContext\0syntax\0"
    "edition\0"
};

const QtProtobufPrivate::QProtobufPropertyOrdering Enum::staticPropertyOrdering = {
    &qt_protobuf_Enum_metadata.data
};

void Enum::registerTypes()
{
    qRegisterMetaType<Enum>();
    qRegisterMetaType<QList<Enum>>();
}

Enum::Enum()
    : QProtobufMessage(&Enum::staticMetaObject, &Enum::staticPropertyOrdering),
      dptr(new Enum_QtProtobufData)
{
}

Enum::Enum(const Enum &other)
    = default;
Enum &Enum::operator =(const Enum &other)
{
    Enum temp(other);
    swap(temp);
    return *this;
}
Enum::Enum(Enum &&other) noexcept
    = default;
Enum::operator QVariant() const
{
    return QVariant::fromValue(*this);
}
bool comparesEqual(const Enum &lhs, const Enum &rhs) noexcept
{
    return operator ==(static_cast<const QProtobufMessage&>(lhs),
                       static_cast<const QProtobufMessage&>(rhs))
        && lhs.dptr->m_name == rhs.dptr->m_name
        && lhs.dptr->m_enumvalue == rhs.dptr->m_enumvalue
        && lhs.dptr->m_options == rhs.dptr->m_options
        && (lhs.dptr->m_sourceContext == rhs.dptr->m_sourceContext
            || *lhs.dptr->m_sourceContext == *rhs.dptr->m_sourceContext)
        && lhs.dptr->m_syntax == rhs.dptr->m_syntax
        && lhs.dptr->m_edition == rhs.dptr->m_edition;
}

const QString &Enum::name() const &
{
    return dptr->m_name;
}

const QList<EnumValue> &Enum::enumvalue() const &
{
    return dptr->m_enumvalue;
}

const QList<Option> &Enum::options() const &
{
    return dptr->m_options;
}

SourceContext *Enum::sourceContext_p()
{
    if (!dptr->m_sourceContext)
        dptr.detach();
    return dptr->m_sourceContext.get();
}

bool Enum::hasSourceContext() const
{
    return dptr->m_sourceContext.operator bool();
}

const SourceContext &Enum::sourceContext() const &
{
    return *dptr->m_sourceContext;
}

SourceContext &Enum::mutSourceContext() &
{
    dptr.detach();
    return *dptr->m_sourceContext;
}

void Enum::clearSourceContext()
{
    if (dptr->m_sourceContext) {
        dptr.detach();
        dptr->m_sourceContext.reset();
    }
}

SyntaxGadget::Syntax Enum::syntax() const
{
    return dptr->m_syntax;
}

const QString &Enum::edition() const &
{
    return dptr->m_edition;
}

void Enum::setName(const QString &name)
{
    if (dptr->m_name != name) {
        dptr.detach();
        dptr->m_name = name;
    }
}

void Enum::setName(QString &&name)
{
    if (dptr->m_name != name) {
        dptr.detach();
        dptr->m_name = std::move(name);
    }
}

void Enum::setEnumvalue(const QList<EnumValue> &enumvalue)
{
    if (dptr->m_enumvalue != enumvalue) {
        dptr.detach();
        dptr->m_enumvalue = enumvalue;
    }
}

void Enum::setEnumvalue(QList<EnumValue> &&enumvalue)
{
    if (dptr->m_enumvalue != enumvalue) {
        dptr.detach();
        dptr->m_enumvalue = std::move(enumvalue);
    }
}

void Enum::setOptions(const QList<Option> &options)
{
    if (dptr->m_options != options) {
        dptr.detach();
        dptr->m_options = options;
    }
}

void Enum::setOptions(QList<Option> &&options)
{
    if (dptr->m_options != options) {
        dptr.detach();
        dptr->m_options = std::move(options);
    }
}

void Enum::setSourceContext_p(SourceContext *sourceContext)
{
    if (dptr->m_sourceContext.get() != sourceContext) {
        dptr.detach();
        dptr->m_sourceContext.reset(sourceContext);
    }
}

void Enum::setSourceContext(const SourceContext &sourceContext)
{
    if (*dptr->m_sourceContext != sourceContext) {
        dptr.detach();
        *dptr->m_sourceContext = sourceContext;
    }
}

void Enum::setSourceContext(SourceContext &&sourceContext)
{
    if (*dptr->m_sourceContext != sourceContext) {
        dptr.detach();
        *dptr->m_sourceContext = std::move(sourceContext);
    }
}

void Enum::setSyntax(SyntaxGadget::Syntax syntax)
{
    if (dptr->m_syntax != syntax) {
        dptr.detach();
        dptr->m_syntax = syntax;
    }
}

void Enum::setEdition(const QString &edition)
{
    if (dptr->m_edition != edition) {
        dptr.detach();
        dptr->m_edition = edition;
    }
}

void Enum::setEdition(QString &&edition)
{
    if (dptr->m_edition != edition) {
        dptr.detach();
        dptr->m_edition = std::move(edition);
    }
}


class EnumValue_QtProtobufData : public QSharedData
{
public:
    EnumValue_QtProtobufData()
        : QSharedData(),
          m_number(0)
    {
    }

    EnumValue_QtProtobufData(const EnumValue_QtProtobufData &other)
        : QSharedData(other),
          m_name(other.m_name),
          m_number(other.m_number),
          m_options(other.m_options)
    {
    }

    QString m_name;
    QtProtobuf::int32 m_number;
    QList<Option> m_options;
};

EnumValue::~EnumValue() = default;

static constexpr struct {
    QtProtobufPrivate::QProtobufPropertyOrdering::Data data;
    const std::array<uint, 13> qt_protobuf_EnumValue_uint_data;
    const char qt_protobuf_EnumValue_char_data[47];
} qt_protobuf_EnumValue_metadata {
    // data
    {
        0, /* = version */
        3, /* = num fields */
        4, /* = field number offset */
        7, /* = property index offset */
        10, /* = field flags offset */
        25, /* = message full name length */
    },
    // uint_data
    {
        // JSON name offsets:
        26, /* = name */
        31, /* = number */
        38, /* = options */
        46, /* = end-of-string-marker */
        // Field numbers:
        1, /* = name */
        2, /* = number */
        3, /* = options */
        // Property indices:
        0, /* = name */
        1, /* = number */
        2, /* = options */
        // Field flags:
        uint(QtProtobufPrivate::FieldFlag::NoFlags), /* = name */
        uint(QtProtobufPrivate::FieldFlag::NoFlags), /* = number */
        uint(QtProtobufPrivate::FieldFlag::Repeated | QtProtobufPrivate::FieldFlag::Message), /* = options */
    },
    // char_data
    /* metadata char_data: */
    "google.protobuf.EnumValue\0" /* = full message name */
    /* field char_data: */
    "name\0number\0options\0"
};

const QtProtobufPrivate::QProtobufPropertyOrdering EnumValue::staticPropertyOrdering = {
    &qt_protobuf_EnumValue_metadata.data
};

void EnumValue::registerTypes()
{
    qRegisterMetaType<EnumValue>();
    qRegisterMetaType<QList<EnumValue>>();
}

EnumValue::EnumValue()
    : QProtobufMessage(&EnumValue::staticMetaObject, &EnumValue::staticPropertyOrdering),
      dptr(new EnumValue_QtProtobufData)
{
}

EnumValue::EnumValue(const EnumValue &other)
    = default;
EnumValue &EnumValue::operator =(const EnumValue &other)
{
    EnumValue temp(other);
    swap(temp);
    return *this;
}
EnumValue::EnumValue(EnumValue &&other) noexcept
    = default;
EnumValue::operator QVariant() const
{
    return QVariant::fromValue(*this);
}
bool comparesEqual(const EnumValue &lhs, const EnumValue &rhs) noexcept
{
    return operator ==(static_cast<const QProtobufMessage&>(lhs),
                       static_cast<const QProtobufMessage&>(rhs))
        && lhs.dptr->m_name == rhs.dptr->m_name
        && lhs.dptr->m_number == rhs.dptr->m_number
        && lhs.dptr->m_options == rhs.dptr->m_options;
}

const QString &EnumValue::name() const &
{
    return dptr->m_name;
}

QtProtobuf::int32 EnumValue::number() const
{
    return dptr->m_number;
}

const QList<Option> &EnumValue::options() const &
{
    return dptr->m_options;
}

void EnumValue::setName(const QString &name)
{
    if (dptr->m_name != name) {
        dptr.detach();
        dptr->m_name = name;
    }
}

void EnumValue::setName(QString &&name)
{
    if (dptr->m_name != name) {
        dptr.detach();
        dptr->m_name = std::move(name);
    }
}

void EnumValue::setNumber(QtProtobuf::int32 number)
{
    if (dptr->m_number != number) {
        dptr.detach();
        dptr->m_number = number;
    }
}

void EnumValue::setOptions(const QList<Option> &options)
{
    if (dptr->m_options != options) {
        dptr.detach();
        dptr->m_options = options;
    }
}

void EnumValue::setOptions(QList<Option> &&options)
{
    if (dptr->m_options != options) {
        dptr.detach();
        dptr->m_options = std::move(options);
    }
}


class Option_QtProtobufData : public QSharedData
{
public:
    Option_QtProtobufData()
        : QSharedData(),
          m_value({})
    {
    }

    Option_QtProtobufData(const Option_QtProtobufData &other)
        : QSharedData(other),
          m_name(other.m_name),
          m_value(other.m_value)
    {
    }

    QString m_name;
    QtProtobuf::Any m_value;
};

Option::~Option() = default;

static constexpr struct {
    QtProtobufPrivate::QProtobufPropertyOrdering::Data data;
    const std::array<uint, 9> qt_protobuf_Option_uint_data;
    const char qt_protobuf_Option_char_data[35];
} qt_protobuf_Option_metadata {
    // data
    {
        0, /* = version */
        2, /* = num fields */
        3, /* = field number offset */
        5, /* = property index offset */
        7, /* = field flags offset */
        22, /* = message full name length */
    },
    // uint_data
    {
        // JSON name offsets:
        23, /* = name */
        28, /* = value */
        34, /* = end-of-string-marker */
        // Field numbers:
        1, /* = name */
        2, /* = value */
        // Property indices:
        0, /* = name */
        1, /* = value */
        // Field flags:
        uint(QtProtobufPrivate::FieldFlag::NoFlags), /* = name */
        uint(QtProtobufPrivate::FieldFlag::Message), /* = value */
    },
    // char_data
    /* metadata char_data: */
    "google.protobuf.Option\0" /* = full message name */
    /* field char_data: */
    "name\0value\0"
};

const QtProtobufPrivate::QProtobufPropertyOrdering Option::staticPropertyOrdering = {
    &qt_protobuf_Option_metadata.data
};

void Option::registerTypes()
{
    qRegisterMetaType<Option>();
    qRegisterMetaType<QList<Option>>();
}

Option::Option()
    : QProtobufMessage(&Option::staticMetaObject, &Option::staticPropertyOrdering),
      dptr(new Option_QtProtobufData)
{
}

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

const QString &Option::name() const &
{
    return dptr->m_name;
}

const QtProtobuf::Any &Option::value() const &
{
    return dptr->m_value;
}

void Option::setName(const QString &name)
{
    if (dptr->m_name != name) {
        dptr.detach();
        dptr->m_name = name;
    }
}

void Option::setName(QString &&name)
{
    if (dptr->m_name != name) {
        dptr.detach();
        dptr->m_name = std::move(name);
    }
}

void Option::setValue(const QtProtobuf::Any &value)
{
    if (dptr->m_value != value) {
        dptr.detach();
        dptr->m_value = value;
    }
}

void Option::setValue(QtProtobuf::Any &&value)
{
    if (dptr->m_value != value) {
        dptr.detach();
        dptr->m_value = std::move(value);
    }
}

} // namespace google::protobuf

#include "moc_type.qpb.cpp"
