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

#include "qtgrpc/tests/testservice.qpb.h"
#include <QtProtobuf/qprotobufserializer.h>
#include <cmath>

namespace qtgrpc::tests {

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

    SimpleStringMessage_QtProtobufData(const SimpleStringMessage_QtProtobufData &other)
        : QSharedData(other),
          m_testFieldString(other.m_testFieldString)
    {
    }

    QString m_testFieldString;
};

SimpleStringMessage::~SimpleStringMessage() = default;

static constexpr struct {
    QtProtobufPrivate::QProtobufPropertyOrdering::Data data;
    const std::array<uint, 5> qt_protobuf_SimpleStringMessage_uint_data;
    const char qt_protobuf_SimpleStringMessage_char_data[50];
} qt_protobuf_SimpleStringMessage_metadata {
    // data
    {
        0, /* = version */
        1, /* = num fields */
        2, /* = field number offset */
        3, /* = property index offset */
        4, /* = field flags offset */
        32, /* = message full name length */
    },
    // uint_data
    {
        // JSON name offsets:
        33, /* = testFieldString */
        49, /* = end-of-string-marker */
        // Field numbers:
        6, /* = testFieldString */
        // Property indices:
        0, /* = testFieldString */
        // Field flags:
        QtProtobufPrivate::NoFlags, /* = testFieldString */
    },
    // char_data
    /* metadata char_data: */
    "qtgrpc.tests.SimpleStringMessage\0" /* = full message name */
    /* field char_data: */
    "testFieldString\0"
};

const QtProtobufPrivate::QProtobufPropertyOrdering SimpleStringMessage::propertyOrdering = {
    &qt_protobuf_SimpleStringMessage_metadata.data
};

void SimpleStringMessage::registerTypes()
{
    qRegisterMetaType<SimpleStringMessage>();
    qRegisterMetaType<SimpleStringMessageRepeated>();
}

SimpleStringMessage::SimpleStringMessage()
    : QProtobufMessage(&SimpleStringMessage::staticMetaObject),
      dptr(new SimpleStringMessage_QtProtobufData)
{
}

SimpleStringMessage::SimpleStringMessage(const SimpleStringMessage &other)
    : QProtobufMessage(other),
      dptr(other.dptr)
{
}
SimpleStringMessage &SimpleStringMessage::operator =(const SimpleStringMessage &other)
{
    QProtobufMessage::operator=(other);
    dptr = other.dptr;
    return *this;
}
SimpleStringMessage::SimpleStringMessage(SimpleStringMessage &&other) noexcept
    : QProtobufMessage(std::move(other)),
      dptr(std::move(other.dptr))
{
}
SimpleStringMessage &SimpleStringMessage::operator =(SimpleStringMessage &&other) noexcept
{
    QProtobufMessage::operator=(std::move(other));
    dptr.swap(other.dptr);
    return *this;
}
bool SimpleStringMessage::operator ==(const SimpleStringMessage &other) const
{
    return QProtobufMessage::isEqual(*this, other)
        && dptr->m_testFieldString == other.dptr->m_testFieldString;
}

bool SimpleStringMessage::operator !=(const SimpleStringMessage &other) const
{
    return !this->operator ==(other);
}

QString SimpleStringMessage::testFieldString() const
{
    return dptr->m_testFieldString;
}

void SimpleStringMessage::setTestFieldString(const QString &testFieldString)
{
    if (dptr->m_testFieldString != testFieldString) {
        dptr.detach();
        dptr->m_testFieldString = testFieldString;
    }
}


class SimpleIntMessage_QtProtobufData : public QSharedData
{
public:
    SimpleIntMessage_QtProtobufData()
        : QSharedData(),
          m_testField(0)
    {
    }

    SimpleIntMessage_QtProtobufData(const SimpleIntMessage_QtProtobufData &other)
        : QSharedData(other),
          m_testField(other.m_testField)
    {
    }

    QtProtobuf::sint32 m_testField;
};

SimpleIntMessage::~SimpleIntMessage() = default;

static constexpr struct {
    QtProtobufPrivate::QProtobufPropertyOrdering::Data data;
    const std::array<uint, 5> qt_protobuf_SimpleIntMessage_uint_data;
    const char qt_protobuf_SimpleIntMessage_char_data[41];
} qt_protobuf_SimpleIntMessage_metadata {
    // data
    {
        0, /* = version */
        1, /* = num fields */
        2, /* = field number offset */
        3, /* = property index offset */
        4, /* = field flags offset */
        29, /* = message full name length */
    },
    // uint_data
    {
        // JSON name offsets:
        30, /* = testField */
        40, /* = end-of-string-marker */
        // Field numbers:
        1, /* = testField */
        // Property indices:
        0, /* = testField */
        // Field flags:
        QtProtobufPrivate::NoFlags, /* = testField */
    },
    // char_data
    /* metadata char_data: */
    "qtgrpc.tests.SimpleIntMessage\0" /* = full message name */
    /* field char_data: */
    "testField\0"
};

const QtProtobufPrivate::QProtobufPropertyOrdering SimpleIntMessage::propertyOrdering = {
    &qt_protobuf_SimpleIntMessage_metadata.data
};

void SimpleIntMessage::registerTypes()
{
    qRegisterMetaType<SimpleIntMessage>();
    qRegisterMetaType<SimpleIntMessageRepeated>();
}

SimpleIntMessage::SimpleIntMessage()
    : QProtobufMessage(&SimpleIntMessage::staticMetaObject),
      dptr(new SimpleIntMessage_QtProtobufData)
{
}

SimpleIntMessage::SimpleIntMessage(const SimpleIntMessage &other)
    : QProtobufMessage(other),
      dptr(other.dptr)
{
}
SimpleIntMessage &SimpleIntMessage::operator =(const SimpleIntMessage &other)
{
    QProtobufMessage::operator=(other);
    dptr = other.dptr;
    return *this;
}
SimpleIntMessage::SimpleIntMessage(SimpleIntMessage &&other) noexcept
    : QProtobufMessage(std::move(other)),
      dptr(std::move(other.dptr))
{
}
SimpleIntMessage &SimpleIntMessage::operator =(SimpleIntMessage &&other) noexcept
{
    QProtobufMessage::operator=(std::move(other));
    dptr.swap(other.dptr);
    return *this;
}
bool SimpleIntMessage::operator ==(const SimpleIntMessage &other) const
{
    return QProtobufMessage::isEqual(*this, other)
        && dptr->m_testField == other.dptr->m_testField;
}

bool SimpleIntMessage::operator !=(const SimpleIntMessage &other) const
{
    return !this->operator ==(other);
}

QtProtobuf::sint32 SimpleIntMessage::testField() const
{
    return dptr->m_testField;
}

void SimpleIntMessage::setTestField(const QtProtobuf::sint32 &testField)
{
    if (dptr->m_testField != testField) {
        dptr.detach();
        dptr->m_testField = testField;
    }
}


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

    BlobMessage_QtProtobufData(const BlobMessage_QtProtobufData &other)
        : QSharedData(other),
          m_testBytes(other.m_testBytes)
    {
    }

    QByteArray m_testBytes;
};

BlobMessage::~BlobMessage() = default;

static constexpr struct {
    QtProtobufPrivate::QProtobufPropertyOrdering::Data data;
    const std::array<uint, 5> qt_protobuf_BlobMessage_uint_data;
    const char qt_protobuf_BlobMessage_char_data[36];
} qt_protobuf_BlobMessage_metadata {
    // data
    {
        0, /* = version */
        1, /* = num fields */
        2, /* = field number offset */
        3, /* = property index offset */
        4, /* = field flags offset */
        24, /* = message full name length */
    },
    // uint_data
    {
        // JSON name offsets:
        25, /* = testBytes */
        35, /* = end-of-string-marker */
        // Field numbers:
        1, /* = testBytes */
        // Property indices:
        0, /* = testBytes */
        // Field flags:
        QtProtobufPrivate::NoFlags, /* = testBytes */
    },
    // char_data
    /* metadata char_data: */
    "qtgrpc.tests.BlobMessage\0" /* = full message name */
    /* field char_data: */
    "testBytes\0"
};

const QtProtobufPrivate::QProtobufPropertyOrdering BlobMessage::propertyOrdering = {
    &qt_protobuf_BlobMessage_metadata.data
};

void BlobMessage::registerTypes()
{
    qRegisterMetaType<BlobMessage>();
    qRegisterMetaType<BlobMessageRepeated>();
}

BlobMessage::BlobMessage()
    : QProtobufMessage(&BlobMessage::staticMetaObject),
      dptr(new BlobMessage_QtProtobufData)
{
}

BlobMessage::BlobMessage(const BlobMessage &other)
    : QProtobufMessage(other),
      dptr(other.dptr)
{
}
BlobMessage &BlobMessage::operator =(const BlobMessage &other)
{
    QProtobufMessage::operator=(other);
    dptr = other.dptr;
    return *this;
}
BlobMessage::BlobMessage(BlobMessage &&other) noexcept
    : QProtobufMessage(std::move(other)),
      dptr(std::move(other.dptr))
{
}
BlobMessage &BlobMessage::operator =(BlobMessage &&other) noexcept
{
    QProtobufMessage::operator=(std::move(other));
    dptr.swap(other.dptr);
    return *this;
}
bool BlobMessage::operator ==(const BlobMessage &other) const
{
    return QProtobufMessage::isEqual(*this, other)
        && dptr->m_testBytes == other.dptr->m_testBytes;
}

bool BlobMessage::operator !=(const BlobMessage &other) const
{
    return !this->operator ==(other);
}

QByteArray BlobMessage::testBytes() const
{
    return dptr->m_testBytes;
}

void BlobMessage::setTestBytes(const QByteArray &testBytes)
{
    if (dptr->m_testBytes != testBytes) {
        dptr.detach();
        dptr->m_testBytes = testBytes;
    }
}

} // namespace qtgrpc::tests

#include "moc_testservice.qpb.cpp"
