1 Star 2 Fork 4

满天星/grpc-async-client-stream-demo

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
hello.pb.cc 11.48 KB
一键复制 编辑 原始数据 按行查看 历史
mantianrong 提交于 2023-01-06 11:12 . init
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: hello.proto
#include "hello.pb.h"
#include <algorithm>
#include <google/protobuf/io/coded_stream.h>
#include <google/protobuf/extension_set.h>
#include <google/protobuf/wire_format_lite.h>
#include <google/protobuf/descriptor.h>
#include <google/protobuf/generated_message_reflection.h>
#include <google/protobuf/reflection_ops.h>
#include <google/protobuf/wire_format.h>
// @@protoc_insertion_point(includes)
#include <google/protobuf/port_def.inc>
PROTOBUF_PRAGMA_INIT_SEG
namespace hello {
constexpr HelloMsg::HelloMsg(
::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
: msg_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
, id_(0){}
struct HelloMsgDefaultTypeInternal {
constexpr HelloMsgDefaultTypeInternal()
: _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
~HelloMsgDefaultTypeInternal() {}
union {
HelloMsg _instance;
};
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT HelloMsgDefaultTypeInternal _HelloMsg_default_instance_;
} // namespace hello
static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_hello_2eproto[1];
static constexpr ::PROTOBUF_NAMESPACE_ID::EnumDescriptor const** file_level_enum_descriptors_hello_2eproto = nullptr;
static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const** file_level_service_descriptors_hello_2eproto = nullptr;
const uint32_t TableStruct_hello_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::hello::HelloMsg, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
~0u, // no _inlined_string_donated_
PROTOBUF_FIELD_OFFSET(::hello::HelloMsg, id_),
PROTOBUF_FIELD_OFFSET(::hello::HelloMsg, msg_),
};
static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
{ 0, -1, -1, sizeof(::hello::HelloMsg)},
};
static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = {
reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::hello::_HelloMsg_default_instance_),
};
const char descriptor_table_protodef_hello_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
"\n\013hello.proto\022\005hello\"#\n\010HelloMsg\022\n\n\002id\030\001"
" \001(\005\022\013\n\003msg\030\002 \001(\t2\?\n\014HelloService\022/\n\005hel"
"lo\022\017.hello.HelloMsg\032\017.hello.HelloMsg\"\000(\001"
"0\001b\006proto3"
;
static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_hello_2eproto_once;
const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_hello_2eproto = {
false, false, 130, descriptor_table_protodef_hello_2eproto, "hello.proto",
&descriptor_table_hello_2eproto_once, nullptr, 0, 1,
schemas, file_default_instances, TableStruct_hello_2eproto::offsets,
file_level_metadata_hello_2eproto, file_level_enum_descriptors_hello_2eproto, file_level_service_descriptors_hello_2eproto,
};
PROTOBUF_ATTRIBUTE_WEAK const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable* descriptor_table_hello_2eproto_getter() {
return &descriptor_table_hello_2eproto;
}
// Force running AddDescriptors() at dynamic initialization time.
PROTOBUF_ATTRIBUTE_INIT_PRIORITY static ::PROTOBUF_NAMESPACE_ID::internal::AddDescriptorsRunner dynamic_init_dummy_hello_2eproto(&descriptor_table_hello_2eproto);
namespace hello {
// ===================================================================
class HelloMsg::_Internal {
public:
};
HelloMsg::HelloMsg(::PROTOBUF_NAMESPACE_ID::Arena* arena,
bool is_message_owned)
: ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
SharedCtor();
if (!is_message_owned) {
RegisterArenaDtor(arena);
}
// @@protoc_insertion_point(arena_constructor:hello.HelloMsg)
}
HelloMsg::HelloMsg(const HelloMsg& from)
: ::PROTOBUF_NAMESPACE_ID::Message() {
_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
msg_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
msg_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
if (!from._internal_msg().empty()) {
msg_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_msg(),
GetArenaForAllocation());
}
id_ = from.id_;
// @@protoc_insertion_point(copy_constructor:hello.HelloMsg)
}
inline void HelloMsg::SharedCtor() {
msg_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
msg_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
id_ = 0;
}
HelloMsg::~HelloMsg() {
// @@protoc_insertion_point(destructor:hello.HelloMsg)
if (GetArenaForAllocation() != nullptr) return;
SharedDtor();
_internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}
inline void HelloMsg::SharedDtor() {
GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
msg_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
}
void HelloMsg::ArenaDtor(void* object) {
HelloMsg* _this = reinterpret_cast< HelloMsg* >(object);
(void)_this;
}
void HelloMsg::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
}
void HelloMsg::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
void HelloMsg::Clear() {
// @@protoc_insertion_point(message_clear_start:hello.HelloMsg)
uint32_t cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
msg_.ClearToEmpty();
id_ = 0;
_internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}
const char* HelloMsg::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
while (!ctx->Done(&ptr)) {
uint32_t tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
switch (tag >> 3) {
// int32 id = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
} else
goto handle_unusual;
continue;
// string msg = 2;
case 2:
if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
auto str = _internal_mutable_msg();
ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "hello.HelloMsg.msg"));
CHK_(ptr);
} else
goto handle_unusual;
continue;
default:
goto handle_unusual;
} // switch
handle_unusual:
if ((tag == 0) || ((tag & 7) == 4)) {
CHK_(ptr);
ctx->SetLastTag(tag);
goto message_done;
}
ptr = UnknownFieldParse(
tag,
_internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
ptr, ctx);
CHK_(ptr != nullptr);
} // while
message_done:
return ptr;
failure:
ptr = nullptr;
goto message_done;
#undef CHK_
}
uint8_t* HelloMsg::_InternalSerialize(
uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:hello.HelloMsg)
uint32_t cached_has_bits = 0;
(void) cached_has_bits;
// int32 id = 1;
if (this->_internal_id() != 0) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(1, this->_internal_id(), target);
}
// string msg = 2;
if (!this->_internal_msg().empty()) {
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
this->_internal_msg().data(), static_cast<int>(this->_internal_msg().length()),
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
"hello.HelloMsg.msg");
target = stream->WriteStringMaybeAliased(
2, this->_internal_msg(), target);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:hello.HelloMsg)
return target;
}
size_t HelloMsg::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:hello.HelloMsg)
size_t total_size = 0;
uint32_t cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
// string msg = 2;
if (!this->_internal_msg().empty()) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
this->_internal_msg());
}
// int32 id = 1;
if (this->_internal_id() != 0) {
total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_id());
}
return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
}
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData HelloMsg::_class_data_ = {
::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
HelloMsg::MergeImpl
};
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*HelloMsg::GetClassData() const { return &_class_data_; }
void HelloMsg::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
const ::PROTOBUF_NAMESPACE_ID::Message& from) {
static_cast<HelloMsg *>(to)->MergeFrom(
static_cast<const HelloMsg &>(from));
}
void HelloMsg::MergeFrom(const HelloMsg& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:hello.HelloMsg)
GOOGLE_DCHECK_NE(&from, this);
uint32_t cached_has_bits = 0;
(void) cached_has_bits;
if (!from._internal_msg().empty()) {
_internal_set_msg(from._internal_msg());
}
if (from._internal_id() != 0) {
_internal_set_id(from._internal_id());
}
_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}
void HelloMsg::CopyFrom(const HelloMsg& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:hello.HelloMsg)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool HelloMsg::IsInitialized() const {
return true;
}
void HelloMsg::InternalSwap(HelloMsg* other) {
using std::swap;
auto* lhs_arena = GetArenaForAllocation();
auto* rhs_arena = other->GetArenaForAllocation();
_internal_metadata_.InternalSwap(&other->_internal_metadata_);
::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
&msg_, lhs_arena,
&other->msg_, rhs_arena
);
swap(id_, other->id_);
}
::PROTOBUF_NAMESPACE_ID::Metadata HelloMsg::GetMetadata() const {
return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
&descriptor_table_hello_2eproto_getter, &descriptor_table_hello_2eproto_once,
file_level_metadata_hello_2eproto[0]);
}
// @@protoc_insertion_point(namespace_scope)
} // namespace hello
PROTOBUF_NAMESPACE_OPEN
template<> PROTOBUF_NOINLINE ::hello::HelloMsg* Arena::CreateMaybeMessage< ::hello::HelloMsg >(Arena* arena) {
return Arena::CreateMessageInternal< ::hello::HelloMsg >(arena);
}
PROTOBUF_NAMESPACE_CLOSE
// @@protoc_insertion_point(global_scope)
#include <google/protobuf/port_undef.inc>
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/evilskyman/grpc-async-client-stream-demo.git
[email protected]:evilskyman/grpc-async-client-stream-demo.git
evilskyman
grpc-async-client-stream-demo
grpc-async-client-stream-demo
master

搜索帮助