r5sdk/r5dev/protoc/sig_map.pb.cc

279 lines
9.6 KiB
C++
Raw Normal View History

// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: sig_map.proto
#include "sig_map.pb.h"
#include <algorithm>
#include <thirdparty/protobuf/io/coded_stream.h>
#include <thirdparty/protobuf/extension_set.h>
#include <thirdparty/protobuf/wire_format_lite.h>
#include <thirdparty/protobuf/io/zero_copy_stream_impl_lite.h>
// @@protoc_insertion_point(includes)
#include <thirdparty/protobuf/port_def.inc>
PROTOBUF_PRAGMA_INIT_SEG
constexpr SigMap_Pb_SMapEntry_DoNotUse::SigMap_Pb_SMapEntry_DoNotUse(
::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized){}
struct SigMap_Pb_SMapEntry_DoNotUseDefaultTypeInternal {
constexpr SigMap_Pb_SMapEntry_DoNotUseDefaultTypeInternal()
: _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
~SigMap_Pb_SMapEntry_DoNotUseDefaultTypeInternal() {}
union {
SigMap_Pb_SMapEntry_DoNotUse _instance;
};
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT SigMap_Pb_SMapEntry_DoNotUseDefaultTypeInternal _SigMap_Pb_SMapEntry_DoNotUse_default_instance_;
constexpr SigMap_Pb::SigMap_Pb(
::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
: smap_(){}
struct SigMap_PbDefaultTypeInternal {
constexpr SigMap_PbDefaultTypeInternal()
: _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
~SigMap_PbDefaultTypeInternal() {}
union {
SigMap_Pb _instance;
};
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT SigMap_PbDefaultTypeInternal _SigMap_Pb_default_instance_;
// ===================================================================
SigMap_Pb_SMapEntry_DoNotUse::SigMap_Pb_SMapEntry_DoNotUse() {}
SigMap_Pb_SMapEntry_DoNotUse::SigMap_Pb_SMapEntry_DoNotUse(::PROTOBUF_NAMESPACE_ID::Arena* arena)
: SuperType(arena) {}
void SigMap_Pb_SMapEntry_DoNotUse::MergeFrom(const SigMap_Pb_SMapEntry_DoNotUse& other) {
MergeFromInternal(other);
}
// ===================================================================
class SigMap_Pb::_Internal {
public:
};
SigMap_Pb::SigMap_Pb(::PROTOBUF_NAMESPACE_ID::Arena* arena,
bool is_message_owned)
: ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned),
smap_(arena) {
SharedCtor();
if (!is_message_owned) {
RegisterArenaDtor(arena);
}
// @@protoc_insertion_point(arena_constructor:SigMap_Pb)
}
SigMap_Pb::SigMap_Pb(const SigMap_Pb& from)
: ::PROTOBUF_NAMESPACE_ID::MessageLite() {
_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
smap_.MergeFrom(from.smap_);
// @@protoc_insertion_point(copy_constructor:SigMap_Pb)
}
inline void SigMap_Pb::SharedCtor() {
}
SigMap_Pb::~SigMap_Pb() {
// @@protoc_insertion_point(destructor:SigMap_Pb)
if (GetArenaForAllocation() != nullptr) return;
SharedDtor();
_internal_metadata_.Delete<std::string>();
}
inline void SigMap_Pb::SharedDtor() {
GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
}
void SigMap_Pb::ArenaDtor(void* object) {
SigMap_Pb* _this = reinterpret_cast< SigMap_Pb* >(object);
(void)_this;
}
void SigMap_Pb::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
}
void SigMap_Pb::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
void SigMap_Pb::Clear() {
// @@protoc_insertion_point(message_clear_start:SigMap_Pb)
uint32_t cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
smap_.Clear();
_internal_metadata_.Clear<std::string>();
}
const char* SigMap_Pb::_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) {
// map<string, uint64> sMap = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
ptr -= 1;
do {
ptr += 1;
ptr = ctx->ParseMessage(&smap_, ptr);
CHK_(ptr);
if (!ctx->DataAvailable(ptr)) break;
} while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<10>(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<std::string>(),
ptr, ctx);
CHK_(ptr != nullptr);
} // while
message_done:
return ptr;
failure:
ptr = nullptr;
goto message_done;
#undef CHK_
}
uint8_t* SigMap_Pb::_InternalSerialize(
uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:SigMap_Pb)
uint32_t cached_has_bits = 0;
(void) cached_has_bits;
// map<string, uint64> sMap = 1;
if (!this->_internal_smap().empty()) {
typedef ::PROTOBUF_NAMESPACE_ID::Map< std::string, uint64_t >::const_pointer
ConstPtr;
typedef ConstPtr SortItem;
typedef ::PROTOBUF_NAMESPACE_ID::internal::CompareByDerefFirst<SortItem> Less;
struct Utf8Check {
static void Check(ConstPtr p) {
(void)p;
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
p->first.data(), static_cast<int>(p->first.length()),
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
"SigMap_Pb.SMapEntry.key");
}
};
if (stream->IsSerializationDeterministic() &&
this->_internal_smap().size() > 1) {
::std::unique_ptr<SortItem[]> items(
new SortItem[this->_internal_smap().size()]);
typedef ::PROTOBUF_NAMESPACE_ID::Map< std::string, uint64_t >::size_type size_type;
size_type n = 0;
for (::PROTOBUF_NAMESPACE_ID::Map< std::string, uint64_t >::const_iterator
it = this->_internal_smap().begin();
it != this->_internal_smap().end(); ++it, ++n) {
items[static_cast<ptrdiff_t>(n)] = SortItem(&*it);
}
::std::sort(&items[0], &items[static_cast<ptrdiff_t>(n)], Less());
for (size_type i = 0; i < n; i++) {
target = SigMap_Pb_SMapEntry_DoNotUse::Funcs::InternalSerialize(1, items[static_cast<ptrdiff_t>(i)]->first, items[static_cast<ptrdiff_t>(i)]->second, target, stream);
Utf8Check::Check(&(*items[static_cast<ptrdiff_t>(i)]));
}
} else {
for (::PROTOBUF_NAMESPACE_ID::Map< std::string, uint64_t >::const_iterator
it = this->_internal_smap().begin();
it != this->_internal_smap().end(); ++it) {
target = SigMap_Pb_SMapEntry_DoNotUse::Funcs::InternalSerialize(1, it->first, it->second, target, stream);
Utf8Check::Check(&(*it));
}
}
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
}
// @@protoc_insertion_point(serialize_to_array_end:SigMap_Pb)
return target;
}
size_t SigMap_Pb::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:SigMap_Pb)
size_t total_size = 0;
uint32_t cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
// map<string, uint64> sMap = 1;
total_size += 1 *
::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->_internal_smap_size());
for (::PROTOBUF_NAMESPACE_ID::Map< std::string, uint64_t >::const_iterator
it = this->_internal_smap().begin();
it != this->_internal_smap().end(); ++it) {
total_size += SigMap_Pb_SMapEntry_DoNotUse::Funcs::ByteSizeLong(it->first, it->second);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
}
int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void SigMap_Pb::CheckTypeAndMergeFrom(
const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
MergeFrom(*::PROTOBUF_NAMESPACE_ID::internal::DownCast<const SigMap_Pb*>(
&from));
}
void SigMap_Pb::MergeFrom(const SigMap_Pb& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:SigMap_Pb)
GOOGLE_DCHECK_NE(&from, this);
uint32_t cached_has_bits = 0;
(void) cached_has_bits;
smap_.MergeFrom(from.smap_);
_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}
void SigMap_Pb::CopyFrom(const SigMap_Pb& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:SigMap_Pb)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool SigMap_Pb::IsInitialized() const {
return true;
}
void SigMap_Pb::InternalSwap(SigMap_Pb* other) {
using std::swap;
_internal_metadata_.InternalSwap(&other->_internal_metadata_);
smap_.InternalSwap(&other->smap_);
}
std::string SigMap_Pb::GetTypeName() const {
return "SigMap_Pb";
}
// @@protoc_insertion_point(namespace_scope)
PROTOBUF_NAMESPACE_OPEN
template<> PROTOBUF_NOINLINE ::SigMap_Pb_SMapEntry_DoNotUse* Arena::CreateMaybeMessage< ::SigMap_Pb_SMapEntry_DoNotUse >(Arena* arena) {
return Arena::CreateMessageInternal< ::SigMap_Pb_SMapEntry_DoNotUse >(arena);
}
template<> PROTOBUF_NOINLINE ::SigMap_Pb* Arena::CreateMaybeMessage< ::SigMap_Pb >(Arena* arena) {
return Arena::CreateMessageInternal< ::SigMap_Pb >(arena);
}
PROTOBUF_NAMESPACE_CLOSE
// @@protoc_insertion_point(global_scope)
#include <thirdparty/protobuf/port_undef.inc>