Source code

Revision control

Copy as Markdown

/* This file is autogenerated. DO NOT CHANGE. All changes will be lost */
#include "protoc2-opt-and-req-properties.qpb.h"
#include <QtProtobuf/qprotobufregistration.h>
#include <cmath>
class SimpleBoolMessage_QtProtobufData : public QSharedData
{
public:
SimpleBoolMessage_QtProtobufData()
: QSharedData(),
m_testReqFieldBool(false)
{
}
SimpleBoolMessage_QtProtobufData(const SimpleBoolMessage_QtProtobufData &other)
: QSharedData(other),
m_testReqFieldBool(other.m_testReqFieldBool),
m_testOptFieldBool(other.m_testOptFieldBool),
m_testRepFieldBool(other.m_testRepFieldBool)
{
}
bool m_testReqFieldBool;
std::optional<bool> m_testOptFieldBool;
QtProtobuf::boolList m_testRepFieldBool;
};
SimpleBoolMessage::~SimpleBoolMessage() = default;
static constexpr struct {
QtProtobufPrivate::QProtobufPropertyOrdering::Data data;
const std::array<uint, 13> qt_protobuf_SimpleBoolMessage_uint_data;
const char qt_protobuf_SimpleBoolMessage_char_data[70];
} qt_protobuf_SimpleBoolMessage_metadata {
// data
{
0, /* = version */
3, /* = num fields */
4, /* = field number offset */
7, /* = property index offset */
10, /* = field flags offset */
17, /* = message full name length */
},
// uint_data
{
// JSON name offsets:
18, /* = testReqFieldBool */
35, /* = testOptFieldBool */
52, /* = testRepFieldBool */
69, /* = end-of-string-marker */
// Field numbers:
1, /* = testReqFieldBool */
2, /* = testOptFieldBool */
3, /* = testRepFieldBool */
// Property indices:
0, /* = testReqFieldBool */
1, /* = testOptFieldBool */
3, /* = testRepFieldBool */
// Field flags:
uint(QtProtobufPrivate::FieldFlag::Required), /* = testReqFieldBool */
uint(QtProtobufPrivate::FieldFlag::Optional | QtProtobufPrivate::FieldFlag::ExplicitPresence), /* = testOptFieldBool */
uint(QtProtobufPrivate::FieldFlag::NonPacked | QtProtobufPrivate::FieldFlag::Repeated), /* = testRepFieldBool */
},
// char_data
/* metadata char_data: */
"SimpleBoolMessage\0" /* = full message name */
/* field char_data: */
"testReqFieldBool\0testOptFieldBool\0testRepFieldBool\0"
};
const QtProtobufPrivate::QProtobufPropertyOrdering SimpleBoolMessage::staticPropertyOrdering = {
&qt_protobuf_SimpleBoolMessage_metadata.data
};
void SimpleBoolMessage::registerTypes()
{
qRegisterMetaType<SimpleBoolMessage>();
qRegisterMetaType<QList<SimpleBoolMessage>>();
}
SimpleBoolMessage::SimpleBoolMessage()
: QProtobufMessage(&SimpleBoolMessage::staticMetaObject, &SimpleBoolMessage::staticPropertyOrdering),
dptr(new SimpleBoolMessage_QtProtobufData)
{
}
SimpleBoolMessage::SimpleBoolMessage(const SimpleBoolMessage &other)
= default;
SimpleBoolMessage &SimpleBoolMessage::operator =(const SimpleBoolMessage &other)
{
SimpleBoolMessage temp(other);
swap(temp);
return *this;
}
SimpleBoolMessage::SimpleBoolMessage(SimpleBoolMessage &&other) noexcept
= default;
SimpleBoolMessage::operator QVariant() const
{
return QVariant::fromValue(*this);
}
bool comparesEqual(const SimpleBoolMessage &lhs, const SimpleBoolMessage &rhs) noexcept
{
return operator ==(static_cast<const QProtobufMessage&>(lhs),
static_cast<const QProtobufMessage&>(rhs))
&& lhs.dptr->m_testReqFieldBool == rhs.dptr->m_testReqFieldBool
&& lhs.dptr->m_testOptFieldBool == rhs.dptr->m_testOptFieldBool
&& lhs.dptr->m_testRepFieldBool == rhs.dptr->m_testRepFieldBool;
}
bool SimpleBoolMessage::testReqFieldBool() const
{
return dptr->m_testReqFieldBool;
}
bool SimpleBoolMessage::testOptFieldBool_p() const
{
return dptr->m_testOptFieldBool ?
dptr->m_testOptFieldBool.value() : bool();
}
bool SimpleBoolMessage::hasTestOptFieldBool() const
{
return dptr->m_testOptFieldBool.has_value();
}
bool SimpleBoolMessage::testOptFieldBool() const
{
Q_ASSERT(dptr->m_testOptFieldBool.has_value());
return dptr->m_testOptFieldBool.value();
}
const QtProtobuf::boolList &SimpleBoolMessage::testRepFieldBool() const &
{
return dptr->m_testRepFieldBool;
}
void SimpleBoolMessage::setTestReqFieldBool(bool testReqFieldBool)
{
if (dptr->m_testReqFieldBool != testReqFieldBool) {
dptr.detach();
dptr->m_testReqFieldBool = testReqFieldBool;
}
}
void SimpleBoolMessage::setTestOptFieldBool(bool testOptFieldBool)
{
if (!dptr->m_testOptFieldBool || dptr->m_testOptFieldBool.value() != testOptFieldBool) {
dptr.detach();
dptr->m_testOptFieldBool = testOptFieldBool;
}
}
void SimpleBoolMessage::setTestOptFieldBool_p(bool testOptFieldBool)
{
if (!dptr->m_testOptFieldBool || dptr->m_testOptFieldBool != testOptFieldBool) {
dptr.detach();
dptr->m_testOptFieldBool = testOptFieldBool;
}
}
void SimpleBoolMessage::clearTestOptFieldBool()
{
if (dptr->m_testOptFieldBool.has_value()) {
dptr.detach();
dptr->m_testOptFieldBool.reset();
}
}
void SimpleBoolMessage::setTestRepFieldBool(const QtProtobuf::boolList &testRepFieldBool)
{
if (dptr->m_testRepFieldBool != testRepFieldBool) {
dptr.detach();
dptr->m_testRepFieldBool = testRepFieldBool;
}
}
void SimpleBoolMessage::setTestRepFieldBool(QtProtobuf::boolList &&testRepFieldBool)
{
if (dptr->m_testRepFieldBool != testRepFieldBool) {
dptr.detach();
dptr->m_testRepFieldBool = std::move(testRepFieldBool);
}
}
#include "moc_protoc2-opt-and-req-properties.qpb.cpp"