// Generated by the protocol buffer compiler. DO NOT EDIT! // source: hello.proto #include "hello.pb.h" #include #include #include #include #include // @@protoc_insertion_point(includes) #include PROTOBUF_PRAGMA_INIT_SEG namespace _pb = ::PROTOBUF_NAMESPACE_ID; namespace _pbi = _pb::internal; namespace control { PROTOBUF_CONSTEXPR Hello::Hello( ::_pbi::ConstantInitialized): _impl_{ /*decltype(_impl_.name_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} , /*decltype(_impl_.id_)*/0 , /*decltype(_impl_._cached_size_)*/{}} {} struct HelloDefaultTypeInternal { PROTOBUF_CONSTEXPR HelloDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} ~HelloDefaultTypeInternal() {} union { Hello _instance; }; }; PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 HelloDefaultTypeInternal _Hello_default_instance_; } // namespace control namespace control { // =================================================================== class Hello::_Internal { public: }; Hello::Hello(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) { SharedCtor(arena, is_message_owned); // @@protoc_insertion_point(arena_constructor:control.Hello) } Hello::Hello(const Hello& from) : ::PROTOBUF_NAMESPACE_ID::MessageLite() { Hello* const _this = this; (void)_this; new (&_impl_) Impl_{ decltype(_impl_.name_) {} , decltype(_impl_.id_) {} , /*decltype(_impl_._cached_size_)*/{}}; _internal_metadata_.MergeFrom(from._internal_metadata_); _impl_.name_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING _impl_.name_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING if (!from._internal_name().empty()) { _this->_impl_.name_.Set(from._internal_name(), _this->GetArenaForAllocation()); } _this->_impl_.id_ = from._impl_.id_; // @@protoc_insertion_point(copy_constructor:control.Hello) } inline void Hello::SharedCtor( ::_pb::Arena* arena, bool is_message_owned) { (void)arena; (void)is_message_owned; new (&_impl_) Impl_{ decltype(_impl_.name_) {} , decltype(_impl_.id_) { 0 } , /*decltype(_impl_._cached_size_)*/{} }; _impl_.name_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING _impl_.name_.Set("", GetArenaForAllocation()); #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING } Hello::~Hello() { // @@protoc_insertion_point(destructor:control.Hello) if (auto *arena = _internal_metadata_.DeleteReturnArena()) { (void)arena; return; } SharedDtor(); } inline void Hello::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); _impl_.name_.Destroy(); } void Hello::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } void Hello::Clear() { // @@protoc_insertion_point(message_clear_start:control.Hello) uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; _impl_.name_.ClearToEmpty(); _impl_.id_ = 0; _internal_metadata_.Clear(); } const char* Hello::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { uint32_t tag; ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { // int32 id = 1; case 1: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 8)) { _impl_.id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); CHK_(ptr); } else goto handle_unusual; continue; // string name = 2; case 2: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { auto str = _internal_mutable_name(); ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); CHK_(::_pbi::VerifyUTF8(str, nullptr)); } 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(), ptr, ctx); CHK_(ptr != nullptr); } // while message_done: return ptr; failure: ptr = nullptr; goto message_done; #undef CHK_ } uint8_t* Hello::_InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:control.Hello) uint32_t cached_has_bits = 0; (void) cached_has_bits; // int32 id = 1; if (this->_internal_id() != 0) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteInt32ToArray(1, this->_internal_id(), target); } // string name = 2; if (!this->_internal_name().empty()) { ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( this->_internal_name().data(), static_cast(this->_internal_name().length()), ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, "control.Hello.name"); target = stream->WriteStringMaybeAliased( 2, this->_internal_name(), target); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { target = stream->WriteRaw(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(), static_cast(_internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target); } // @@protoc_insertion_point(serialize_to_array_end:control.Hello) return target; } size_t Hello::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:control.Hello) 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 name = 2; if (!this->_internal_name().empty()) { total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( this->_internal_name()); } // int32 id = 1; if (this->_internal_id() != 0) { total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_id()); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { total_size += _internal_metadata_.unknown_fields(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size(); } int cached_size = ::_pbi::ToCachedSize(total_size); SetCachedSize(cached_size); return total_size; } void Hello::CheckTypeAndMergeFrom( const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) { MergeFrom(*::_pbi::DownCast( &from)); } void Hello::MergeFrom(const Hello& from) { Hello* const _this = this; // @@protoc_insertion_point(class_specific_merge_from_start:control.Hello) GOOGLE_DCHECK_NE(&from, _this); uint32_t cached_has_bits = 0; (void) cached_has_bits; if (!from._internal_name().empty()) { _this->_internal_set_name(from._internal_name()); } if (from._internal_id() != 0) { _this->_internal_set_id(from._internal_id()); } _this->_internal_metadata_.MergeFrom(from._internal_metadata_); } void Hello::CopyFrom(const Hello& from) { // @@protoc_insertion_point(class_specific_copy_from_start:control.Hello) if (&from == this) return; Clear(); MergeFrom(from); } bool Hello::IsInitialized() const { return true; } void Hello::InternalSwap(Hello* 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( &_impl_.name_, lhs_arena, &other->_impl_.name_, rhs_arena ); swap(_impl_.id_, other->_impl_.id_); } std::string Hello::GetTypeName() const { return "control.Hello"; } // @@protoc_insertion_point(namespace_scope) } // namespace control PROTOBUF_NAMESPACE_OPEN template<> PROTOBUF_NOINLINE ::control::Hello* Arena::CreateMaybeMessage< ::control::Hello >(Arena* arena) { return Arena::CreateMessageInternal< ::control::Hello >(arena); } PROTOBUF_NAMESPACE_CLOSE // @@protoc_insertion_point(global_scope) #include