ADD: added new basic messages and added the parentID as an part of the identifier

This commit is contained in:
Henry Winkel
2023-01-19 16:03:58 +01:00
parent 49bdb28535
commit 73b15d235a
32 changed files with 2140 additions and 140 deletions

View File

@@ -26,9 +26,10 @@ PROTOBUF_CONSTEXPR Message::Message(
::_pbi::ConstantInitialized): _impl_{
/*decltype(_impl_.payload_)*/{}
, /*decltype(_impl_.topic_)*/0u
, /*decltype(_impl_.msgtype_)*/0
, /*decltype(_impl_.sourcetype_)*/0
, /*decltype(_impl_.sourceid_)*/0
, /*decltype(_impl_.msgtype_)*/0u
, /*decltype(_impl_.sourcetype_)*/0u
, /*decltype(_impl_.sourceid_)*/0u
, /*decltype(_impl_.parentid_)*/0u
, /*decltype(_impl_._cached_size_)*/{}} {}
struct MessageDefaultTypeInternal {
PROTOBUF_CONSTEXPR MessageDefaultTypeInternal()
@@ -56,6 +57,7 @@ const uint32_t TableStruct_message_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(
PROTOBUF_FIELD_OFFSET(::messages::header::Message, _impl_.msgtype_),
PROTOBUF_FIELD_OFFSET(::messages::header::Message, _impl_.sourcetype_),
PROTOBUF_FIELD_OFFSET(::messages::header::Message, _impl_.sourceid_),
PROTOBUF_FIELD_OFFSET(::messages::header::Message, _impl_.parentid_),
PROTOBUF_FIELD_OFFSET(::messages::header::Message, _impl_.payload_),
};
static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
@@ -68,17 +70,18 @@ static const ::_pb::Message* const file_default_instances[] = {
const char descriptor_table_protodef_message_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
"\n\rmessage.proto\022\017messages.header\032\031google"
"/protobuf/any.proto\"v\n\007Message\022\r\n\005topic\030"
"\001 \001(\r\022\017\n\007msgType\030\002 \001(\005\022\022\n\nsourceType\030\003 \001"
"(\005\022\020\n\010sourceID\030\004 \001(\005\022%\n\007payload\030\005 \003(\0132\024."
"google.protobuf.Anyb\006proto3"
"/protobuf/any.proto\"\210\001\n\007Message\022\r\n\005topic"
"\030\001 \001(\r\022\017\n\007msgType\030\002 \001(\r\022\022\n\nsourceType\030\003 "
"\001(\r\022\020\n\010sourceID\030\004 \001(\r\022\020\n\010parentID\030\005 \001(\r\022"
"%\n\007payload\030\006 \003(\0132\024.google.protobuf.Anyb\006"
"proto3"
;
static const ::_pbi::DescriptorTable* const descriptor_table_message_2eproto_deps[1] = {
&::descriptor_table_google_2fprotobuf_2fany_2eproto,
};
static ::_pbi::once_flag descriptor_table_message_2eproto_once;
const ::_pbi::DescriptorTable descriptor_table_message_2eproto = {
false, false, 187, descriptor_table_protodef_message_2eproto,
false, false, 206, descriptor_table_protodef_message_2eproto,
"message.proto",
&descriptor_table_message_2eproto_once, descriptor_table_message_2eproto_deps, 1, 1,
schemas, file_default_instances, TableStruct_message_2eproto::offsets,
@@ -118,12 +121,13 @@ Message::Message(const Message& from)
, decltype(_impl_.msgtype_){}
, decltype(_impl_.sourcetype_){}
, decltype(_impl_.sourceid_){}
, decltype(_impl_.parentid_){}
, /*decltype(_impl_._cached_size_)*/{}};
_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
::memcpy(&_impl_.topic_, &from._impl_.topic_,
static_cast<size_t>(reinterpret_cast<char*>(&_impl_.sourceid_) -
reinterpret_cast<char*>(&_impl_.topic_)) + sizeof(_impl_.sourceid_));
static_cast<size_t>(reinterpret_cast<char*>(&_impl_.parentid_) -
reinterpret_cast<char*>(&_impl_.topic_)) + sizeof(_impl_.parentid_));
// @@protoc_insertion_point(copy_constructor:messages.header.Message)
}
@@ -134,9 +138,10 @@ inline void Message::SharedCtor(
new (&_impl_) Impl_{
decltype(_impl_.payload_){arena}
, decltype(_impl_.topic_){0u}
, decltype(_impl_.msgtype_){0}
, decltype(_impl_.sourcetype_){0}
, decltype(_impl_.sourceid_){0}
, decltype(_impl_.msgtype_){0u}
, decltype(_impl_.sourcetype_){0u}
, decltype(_impl_.sourceid_){0u}
, decltype(_impl_.parentid_){0u}
, /*decltype(_impl_._cached_size_)*/{}
};
}
@@ -167,8 +172,8 @@ void Message::Clear() {
_impl_.payload_.Clear();
::memset(&_impl_.topic_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&_impl_.sourceid_) -
reinterpret_cast<char*>(&_impl_.topic_)) + sizeof(_impl_.sourceid_));
reinterpret_cast<char*>(&_impl_.parentid_) -
reinterpret_cast<char*>(&_impl_.topic_)) + sizeof(_impl_.parentid_));
_internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}
@@ -186,7 +191,7 @@ const char* Message::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx)
} else
goto handle_unusual;
continue;
// int32 msgType = 2;
// uint32 msgType = 2;
case 2:
if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
_impl_.msgtype_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
@@ -194,7 +199,7 @@ const char* Message::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx)
} else
goto handle_unusual;
continue;
// int32 sourceType = 3;
// uint32 sourceType = 3;
case 3:
if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 24)) {
_impl_.sourcetype_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
@@ -202,7 +207,7 @@ const char* Message::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx)
} else
goto handle_unusual;
continue;
// int32 sourceID = 4;
// uint32 sourceID = 4;
case 4:
if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 32)) {
_impl_.sourceid_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
@@ -210,16 +215,24 @@ const char* Message::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx)
} else
goto handle_unusual;
continue;
// repeated .google.protobuf.Any payload = 5;
// uint32 parentID = 5;
case 5:
if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 42)) {
if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 40)) {
_impl_.parentid_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
} else
goto handle_unusual;
continue;
// repeated .google.protobuf.Any payload = 6;
case 6:
if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 50)) {
ptr -= 1;
do {
ptr += 1;
ptr = ctx->ParseMessage(_internal_add_payload(), ptr);
CHK_(ptr);
if (!ctx->DataAvailable(ptr)) break;
} while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<42>(ptr));
} while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<50>(ptr));
} else
goto handle_unusual;
continue;
@@ -258,30 +271,36 @@ uint8_t* Message::_InternalSerialize(
target = ::_pbi::WireFormatLite::WriteUInt32ToArray(1, this->_internal_topic(), target);
}
// int32 msgType = 2;
// uint32 msgType = 2;
if (this->_internal_msgtype() != 0) {
target = stream->EnsureSpace(target);
target = ::_pbi::WireFormatLite::WriteInt32ToArray(2, this->_internal_msgtype(), target);
target = ::_pbi::WireFormatLite::WriteUInt32ToArray(2, this->_internal_msgtype(), target);
}
// int32 sourceType = 3;
// uint32 sourceType = 3;
if (this->_internal_sourcetype() != 0) {
target = stream->EnsureSpace(target);
target = ::_pbi::WireFormatLite::WriteInt32ToArray(3, this->_internal_sourcetype(), target);
target = ::_pbi::WireFormatLite::WriteUInt32ToArray(3, this->_internal_sourcetype(), target);
}
// int32 sourceID = 4;
// uint32 sourceID = 4;
if (this->_internal_sourceid() != 0) {
target = stream->EnsureSpace(target);
target = ::_pbi::WireFormatLite::WriteInt32ToArray(4, this->_internal_sourceid(), target);
target = ::_pbi::WireFormatLite::WriteUInt32ToArray(4, this->_internal_sourceid(), target);
}
// repeated .google.protobuf.Any payload = 5;
// uint32 parentID = 5;
if (this->_internal_parentid() != 0) {
target = stream->EnsureSpace(target);
target = ::_pbi::WireFormatLite::WriteUInt32ToArray(5, this->_internal_parentid(), target);
}
// repeated .google.protobuf.Any payload = 6;
for (unsigned i = 0,
n = static_cast<unsigned>(this->_internal_payload_size()); i < n; i++) {
const auto& repfield = this->_internal_payload(i);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessage(5, repfield, repfield.GetCachedSize(), target, stream);
InternalWriteMessage(6, repfield, repfield.GetCachedSize(), target, stream);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
@@ -300,7 +319,7 @@ size_t Message::ByteSizeLong() const {
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
// repeated .google.protobuf.Any payload = 5;
// repeated .google.protobuf.Any payload = 6;
total_size += 1UL * this->_internal_payload_size();
for (const auto& msg : this->_impl_.payload_) {
total_size +=
@@ -312,19 +331,24 @@ size_t Message::ByteSizeLong() const {
total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_topic());
}
// int32 msgType = 2;
// uint32 msgType = 2;
if (this->_internal_msgtype() != 0) {
total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_msgtype());
total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_msgtype());
}
// int32 sourceType = 3;
// uint32 sourceType = 3;
if (this->_internal_sourcetype() != 0) {
total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_sourcetype());
total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_sourcetype());
}
// int32 sourceID = 4;
// uint32 sourceID = 4;
if (this->_internal_sourceid() != 0) {
total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_sourceid());
total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_sourceid());
}
// uint32 parentID = 5;
if (this->_internal_parentid() != 0) {
total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_parentid());
}
return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_);
@@ -358,6 +382,9 @@ void Message::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOB
if (from._internal_sourceid() != 0) {
_this->_internal_set_sourceid(from._internal_sourceid());
}
if (from._internal_parentid() != 0) {
_this->_internal_set_parentid(from._internal_parentid());
}
_this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}
@@ -377,8 +404,8 @@ void Message::InternalSwap(Message* other) {
_internal_metadata_.InternalSwap(&other->_internal_metadata_);
_impl_.payload_.InternalSwap(&other->_impl_.payload_);
::PROTOBUF_NAMESPACE_ID::internal::memswap<
PROTOBUF_FIELD_OFFSET(Message, _impl_.sourceid_)
+ sizeof(Message::_impl_.sourceid_)
PROTOBUF_FIELD_OFFSET(Message, _impl_.parentid_)
+ sizeof(Message::_impl_.parentid_)
- PROTOBUF_FIELD_OFFSET(Message, _impl_.topic_)>(
reinterpret_cast<char*>(&_impl_.topic_),
reinterpret_cast<char*>(&other->_impl_.topic_));