ADD: added new version of Orders and a first use in the entity base class

This commit is contained in:
Henry Winkel
2023-07-06 09:29:11 +02:00
parent 3333fadf20
commit 89665f3ce7
12 changed files with 263 additions and 474 deletions

View File

@@ -26,8 +26,6 @@ namespace order {
PROTOBUF_CONSTEXPR Order::Order(
::_pbi::ConstantInitialized): _impl_{
/*decltype(_impl_.orderid_)*/nullptr
, /*decltype(_impl_.orderingentity_)*/nullptr
, /*decltype(_impl_.orderedentity_)*/nullptr
, /*decltype(_impl_.orderpayload_)*/nullptr
, /*decltype(_impl_.ordertype_)*/0u
, /*decltype(_impl_._cached_size_)*/{}} {}
@@ -55,8 +53,6 @@ const uint32_t TableStruct_Order_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(pr
~0u, // no _weak_field_map_
~0u, // no _inlined_string_donated_
PROTOBUF_FIELD_OFFSET(::messages::entity::order::Order, _impl_.orderid_),
PROTOBUF_FIELD_OFFSET(::messages::entity::order::Order, _impl_.orderingentity_),
PROTOBUF_FIELD_OFFSET(::messages::entity::order::Order, _impl_.orderedentity_),
PROTOBUF_FIELD_OFFSET(::messages::entity::order::Order, _impl_.ordertype_),
PROTOBUF_FIELD_OFFSET(::messages::entity::order::Order, _impl_.orderpayload_),
};
@@ -71,12 +67,10 @@ static const ::_pb::Message* const file_default_instances[] = {
const char descriptor_table_protodef_Order_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
"\n\013Order.proto\022\025messages.entity.order\032\020Id"
"entifier.proto\032\031google/protobuf/any.prot"
"o\"\332\001\n\005Order\022+\n\007OrderID\030\001 \001(\0132\032.messages."
"track.Identifier\0222\n\016orderingEntity\030\002 \001(\013"
"2\032.messages.track.Identifier\0221\n\rorderedE"
"ntity\030\003 \001(\0132\032.messages.track.Identifier\022"
"\021\n\tOrderType\030\004 \001(\r\022*\n\014OrderPayload\030\005 \001(\013"
"2\024.google.protobuf.Anyb\006proto3"
"o\"s\n\005Order\022+\n\007OrderID\030\001 \001(\0132\032.messages.t"
"rack.Identifier\022\021\n\tOrderType\030\004 \001(\r\022*\n\014Or"
"derPayload\030\005 \001(\0132\024.google.protobuf.Anyb\006"
"proto3"
;
static const ::_pbi::DescriptorTable* const descriptor_table_Order_2eproto_deps[2] = {
&::descriptor_table_Identifier_2eproto,
@@ -84,7 +78,7 @@ static const ::_pbi::DescriptorTable* const descriptor_table_Order_2eproto_deps[
};
static ::_pbi::once_flag descriptor_table_Order_2eproto_once;
const ::_pbi::DescriptorTable descriptor_table_Order_2eproto = {
false, false, 310, descriptor_table_protodef_Order_2eproto,
false, false, 206, descriptor_table_protodef_Order_2eproto,
"Order.proto",
&descriptor_table_Order_2eproto_once, descriptor_table_Order_2eproto_deps, 2, 1,
schemas, file_default_instances, TableStruct_Order_2eproto::offsets,
@@ -106,8 +100,6 @@ namespace order {
class Order::_Internal {
public:
static const ::messages::track::Identifier& orderid(const Order* msg);
static const ::messages::track::Identifier& orderingentity(const Order* msg);
static const ::messages::track::Identifier& orderedentity(const Order* msg);
static const ::PROTOBUF_NAMESPACE_ID::Any& orderpayload(const Order* msg);
};
@@ -115,14 +107,6 @@ const ::messages::track::Identifier&
Order::_Internal::orderid(const Order* msg) {
return *msg->_impl_.orderid_;
}
const ::messages::track::Identifier&
Order::_Internal::orderingentity(const Order* msg) {
return *msg->_impl_.orderingentity_;
}
const ::messages::track::Identifier&
Order::_Internal::orderedentity(const Order* msg) {
return *msg->_impl_.orderedentity_;
}
const ::PROTOBUF_NAMESPACE_ID::Any&
Order::_Internal::orderpayload(const Order* msg) {
return *msg->_impl_.orderpayload_;
@@ -133,18 +117,6 @@ void Order::clear_orderid() {
}
_impl_.orderid_ = nullptr;
}
void Order::clear_orderingentity() {
if (GetArenaForAllocation() == nullptr && _impl_.orderingentity_ != nullptr) {
delete _impl_.orderingentity_;
}
_impl_.orderingentity_ = nullptr;
}
void Order::clear_orderedentity() {
if (GetArenaForAllocation() == nullptr && _impl_.orderedentity_ != nullptr) {
delete _impl_.orderedentity_;
}
_impl_.orderedentity_ = nullptr;
}
void Order::clear_orderpayload() {
if (GetArenaForAllocation() == nullptr && _impl_.orderpayload_ != nullptr) {
delete _impl_.orderpayload_;
@@ -162,8 +134,6 @@ Order::Order(const Order& from)
Order* const _this = this; (void)_this;
new (&_impl_) Impl_{
decltype(_impl_.orderid_){nullptr}
, decltype(_impl_.orderingentity_){nullptr}
, decltype(_impl_.orderedentity_){nullptr}
, decltype(_impl_.orderpayload_){nullptr}
, decltype(_impl_.ordertype_){}
, /*decltype(_impl_._cached_size_)*/{}};
@@ -172,12 +142,6 @@ Order::Order(const Order& from)
if (from._internal_has_orderid()) {
_this->_impl_.orderid_ = new ::messages::track::Identifier(*from._impl_.orderid_);
}
if (from._internal_has_orderingentity()) {
_this->_impl_.orderingentity_ = new ::messages::track::Identifier(*from._impl_.orderingentity_);
}
if (from._internal_has_orderedentity()) {
_this->_impl_.orderedentity_ = new ::messages::track::Identifier(*from._impl_.orderedentity_);
}
if (from._internal_has_orderpayload()) {
_this->_impl_.orderpayload_ = new ::PROTOBUF_NAMESPACE_ID::Any(*from._impl_.orderpayload_);
}
@@ -191,8 +155,6 @@ inline void Order::SharedCtor(
(void)is_message_owned;
new (&_impl_) Impl_{
decltype(_impl_.orderid_){nullptr}
, decltype(_impl_.orderingentity_){nullptr}
, decltype(_impl_.orderedentity_){nullptr}
, decltype(_impl_.orderpayload_){nullptr}
, decltype(_impl_.ordertype_){0u}
, /*decltype(_impl_._cached_size_)*/{}
@@ -211,8 +173,6 @@ Order::~Order() {
inline void Order::SharedDtor() {
GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
if (this != internal_default_instance()) delete _impl_.orderid_;
if (this != internal_default_instance()) delete _impl_.orderingentity_;
if (this != internal_default_instance()) delete _impl_.orderedentity_;
if (this != internal_default_instance()) delete _impl_.orderpayload_;
}
@@ -230,14 +190,6 @@ void Order::Clear() {
delete _impl_.orderid_;
}
_impl_.orderid_ = nullptr;
if (GetArenaForAllocation() == nullptr && _impl_.orderingentity_ != nullptr) {
delete _impl_.orderingentity_;
}
_impl_.orderingentity_ = nullptr;
if (GetArenaForAllocation() == nullptr && _impl_.orderedentity_ != nullptr) {
delete _impl_.orderedentity_;
}
_impl_.orderedentity_ = nullptr;
if (GetArenaForAllocation() == nullptr && _impl_.orderpayload_ != nullptr) {
delete _impl_.orderpayload_;
}
@@ -260,22 +212,6 @@ const char* Order::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
} else
goto handle_unusual;
continue;
// .messages.track.Identifier orderingEntity = 2;
case 2:
if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
ptr = ctx->ParseMessage(_internal_mutable_orderingentity(), ptr);
CHK_(ptr);
} else
goto handle_unusual;
continue;
// .messages.track.Identifier orderedEntity = 3;
case 3:
if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 26)) {
ptr = ctx->ParseMessage(_internal_mutable_orderedentity(), ptr);
CHK_(ptr);
} else
goto handle_unusual;
continue;
// uint32 OrderType = 4;
case 4:
if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 32)) {
@@ -328,20 +264,6 @@ uint8_t* Order::_InternalSerialize(
_Internal::orderid(this).GetCachedSize(), target, stream);
}
// .messages.track.Identifier orderingEntity = 2;
if (this->_internal_has_orderingentity()) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessage(2, _Internal::orderingentity(this),
_Internal::orderingentity(this).GetCachedSize(), target, stream);
}
// .messages.track.Identifier orderedEntity = 3;
if (this->_internal_has_orderedentity()) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessage(3, _Internal::orderedentity(this),
_Internal::orderedentity(this).GetCachedSize(), target, stream);
}
// uint32 OrderType = 4;
if (this->_internal_ordertype() != 0) {
target = stream->EnsureSpace(target);
@@ -378,20 +300,6 @@ size_t Order::ByteSizeLong() const {
*_impl_.orderid_);
}
// .messages.track.Identifier orderingEntity = 2;
if (this->_internal_has_orderingentity()) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
*_impl_.orderingentity_);
}
// .messages.track.Identifier orderedEntity = 3;
if (this->_internal_has_orderedentity()) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
*_impl_.orderedentity_);
}
// .google.protobuf.Any OrderPayload = 5;
if (this->_internal_has_orderpayload()) {
total_size += 1 +
@@ -426,14 +334,6 @@ void Order::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF
_this->_internal_mutable_orderid()->::messages::track::Identifier::MergeFrom(
from._internal_orderid());
}
if (from._internal_has_orderingentity()) {
_this->_internal_mutable_orderingentity()->::messages::track::Identifier::MergeFrom(
from._internal_orderingentity());
}
if (from._internal_has_orderedentity()) {
_this->_internal_mutable_orderedentity()->::messages::track::Identifier::MergeFrom(
from._internal_orderedentity());
}
if (from._internal_has_orderpayload()) {
_this->_internal_mutable_orderpayload()->::PROTOBUF_NAMESPACE_ID::Any::MergeFrom(
from._internal_orderpayload());