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


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

#include <QtProtobuf/qprotobufregistration.h>

#include <cmath>

namespace google::protobuf {

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

    Any_QtProtobufData(const Any_QtProtobufData &other)
        : QSharedData(other),
          m_typeUrl(other.m_typeUrl),
          m_value(other.m_value)
    {
    }

    QString m_typeUrl;
    QByteArray m_value;
};

Any::~Any() = default;

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

const QtProtobufPrivate::QProtobufPropertyOrdering Any::staticPropertyOrdering = {
    &qt_protobuf_Any_metadata.data
};

void Any::registerTypes()
{
    qRegisterMetaType<Any>();
    qRegisterMetaType<QList<Any>>();
    QT_PREPEND_NAMESPACE(QtProtobuf)::Any::registerTypes();
}

Any::Any()
    : QProtobufMessage(&Any::staticMetaObject, &Any::staticPropertyOrdering),
      dptr(new Any_QtProtobufData)
{
}

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

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

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

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

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

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

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

} // namespace google::protobuf

#include "moc_any.qpb.cpp"
