// Generated by the protocol buffer compiler. DO NOT EDIT!
|
// source: error_msg.proto
|
|
#include "error_msg.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/io/zero_copy_stream_impl_lite.h>
|
// @@protoc_insertion_point(includes)
|
#include <google/protobuf/port_def.inc>
|
|
PROTOBUF_PRAGMA_INIT_SEG
|
namespace bhome_msg {
|
constexpr ErrorMsg::ErrorMsg(
|
::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
|
: errstring_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
|
, errcode_(0)
|
{}
|
struct ErrorMsgDefaultTypeInternal {
|
constexpr ErrorMsgDefaultTypeInternal()
|
: _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
|
~ErrorMsgDefaultTypeInternal() {}
|
union {
|
ErrorMsg _instance;
|
};
|
};
|
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT ErrorMsgDefaultTypeInternal _ErrorMsg_default_instance_;
|
} // namespace bhome_msg
|
namespace bhome_msg {
|
bool ErrorCode_IsValid(int value) {
|
switch (value) {
|
case 0:
|
case 1:
|
case 2:
|
case 3:
|
case 4:
|
case 5:
|
case 6:
|
case 7:
|
return true;
|
default:
|
return false;
|
}
|
}
|
|
static ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<std::string> ErrorCode_strings[8] = {};
|
|
static const char ErrorCode_names[] =
|
"eAddressNotMatch"
|
"eError"
|
"eInvalidInput"
|
"eNoRespond"
|
"eNotFound"
|
"eNotRegistered"
|
"eOffline"
|
"eSuccess";
|
|
static const ::PROTOBUF_NAMESPACE_ID::internal::EnumEntry ErrorCode_entries[] = {
|
{ {ErrorCode_names + 0, 16}, 7 },
|
{ {ErrorCode_names + 16, 6}, 1 },
|
{ {ErrorCode_names + 22, 13}, 2 },
|
{ {ErrorCode_names + 35, 10}, 6 },
|
{ {ErrorCode_names + 45, 9}, 4 },
|
{ {ErrorCode_names + 54, 14}, 3 },
|
{ {ErrorCode_names + 68, 8}, 5 },
|
{ {ErrorCode_names + 76, 8}, 0 },
|
};
|
|
static const int ErrorCode_entries_by_number[] = {
|
7, // 0 -> eSuccess
|
1, // 1 -> eError
|
2, // 2 -> eInvalidInput
|
5, // 3 -> eNotRegistered
|
4, // 4 -> eNotFound
|
6, // 5 -> eOffline
|
3, // 6 -> eNoRespond
|
0, // 7 -> eAddressNotMatch
|
};
|
|
const std::string& ErrorCode_Name(
|
ErrorCode value) {
|
static const bool dummy =
|
::PROTOBUF_NAMESPACE_ID::internal::InitializeEnumStrings(
|
ErrorCode_entries,
|
ErrorCode_entries_by_number,
|
8, ErrorCode_strings);
|
(void) dummy;
|
int idx = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumName(
|
ErrorCode_entries,
|
ErrorCode_entries_by_number,
|
8, value);
|
return idx == -1 ? ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString() :
|
ErrorCode_strings[idx].get();
|
}
|
bool ErrorCode_Parse(
|
::PROTOBUF_NAMESPACE_ID::ConstStringParam name, ErrorCode* value) {
|
int int_value;
|
bool success = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumValue(
|
ErrorCode_entries, 8, name, &int_value);
|
if (success) {
|
*value = static_cast<ErrorCode>(int_value);
|
}
|
return success;
|
}
|
|
// ===================================================================
|
|
class ErrorMsg::_Internal {
|
public:
|
};
|
|
ErrorMsg::ErrorMsg(::PROTOBUF_NAMESPACE_ID::Arena* arena,
|
bool is_message_owned)
|
: ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
|
SharedCtor();
|
if (!is_message_owned) {
|
RegisterArenaDtor(arena);
|
}
|
// @@protoc_insertion_point(arena_constructor:bhome_msg.ErrorMsg)
|
}
|
ErrorMsg::ErrorMsg(const ErrorMsg& from)
|
: ::PROTOBUF_NAMESPACE_ID::MessageLite() {
|
_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
|
errstring_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
|
if (!from._internal_errstring().empty()) {
|
errstring_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_errstring(),
|
GetArenaForAllocation());
|
}
|
errcode_ = from.errcode_;
|
// @@protoc_insertion_point(copy_constructor:bhome_msg.ErrorMsg)
|
}
|
|
inline void ErrorMsg::SharedCtor() {
|
errstring_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
|
errcode_ = 0;
|
}
|
|
ErrorMsg::~ErrorMsg() {
|
// @@protoc_insertion_point(destructor:bhome_msg.ErrorMsg)
|
if (GetArenaForAllocation() != nullptr) return;
|
SharedDtor();
|
_internal_metadata_.Delete<std::string>();
|
}
|
|
inline void ErrorMsg::SharedDtor() {
|
GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
|
errstring_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
|
}
|
|
void ErrorMsg::ArenaDtor(void* object) {
|
ErrorMsg* _this = reinterpret_cast< ErrorMsg* >(object);
|
(void)_this;
|
}
|
void ErrorMsg::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
|
}
|
void ErrorMsg::SetCachedSize(int size) const {
|
_cached_size_.Set(size);
|
}
|
|
void ErrorMsg::Clear() {
|
// @@protoc_insertion_point(message_clear_start:bhome_msg.ErrorMsg)
|
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
|
// Prevent compiler warnings about cached_has_bits being unused
|
(void) cached_has_bits;
|
|
errstring_.ClearToEmpty();
|
errcode_ = 0;
|
_internal_metadata_.Clear<std::string>();
|
}
|
|
const char* ErrorMsg::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
|
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
|
while (!ctx->Done(&ptr)) {
|
::PROTOBUF_NAMESPACE_ID::uint32 tag;
|
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
|
switch (tag >> 3) {
|
// .bhome_msg.ErrorCode errCode = 1;
|
case 1:
|
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) {
|
::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
|
CHK_(ptr);
|
_internal_set_errcode(static_cast<::bhome_msg::ErrorCode>(val));
|
} else goto handle_unusual;
|
continue;
|
// bytes errString = 2;
|
case 2:
|
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) {
|
auto str = _internal_mutable_errstring();
|
ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
|
CHK_(ptr);
|
} else goto handle_unusual;
|
continue;
|
default: {
|
handle_unusual:
|
if ((tag == 0) || ((tag & 7) == 4)) {
|
CHK_(ptr);
|
ctx->SetLastTag(tag);
|
goto success;
|
}
|
ptr = UnknownFieldParse(tag,
|
_internal_metadata_.mutable_unknown_fields<std::string>(),
|
ptr, ctx);
|
CHK_(ptr != nullptr);
|
continue;
|
}
|
} // switch
|
} // while
|
success:
|
return ptr;
|
failure:
|
ptr = nullptr;
|
goto success;
|
#undef CHK_
|
}
|
|
::PROTOBUF_NAMESPACE_ID::uint8* ErrorMsg::_InternalSerialize(
|
::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
|
// @@protoc_insertion_point(serialize_to_array_start:bhome_msg.ErrorMsg)
|
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
|
(void) cached_has_bits;
|
|
// .bhome_msg.ErrorCode errCode = 1;
|
if (this->_internal_errcode() != 0) {
|
target = stream->EnsureSpace(target);
|
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
|
1, this->_internal_errcode(), target);
|
}
|
|
// bytes errString = 2;
|
if (!this->_internal_errstring().empty()) {
|
target = stream->WriteBytesMaybeAliased(
|
2, this->_internal_errstring(), target);
|
}
|
|
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:bhome_msg.ErrorMsg)
|
return target;
|
}
|
|
size_t ErrorMsg::ByteSizeLong() const {
|
// @@protoc_insertion_point(message_byte_size_start:bhome_msg.ErrorMsg)
|
size_t total_size = 0;
|
|
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
|
// Prevent compiler warnings about cached_has_bits being unused
|
(void) cached_has_bits;
|
|
// bytes errString = 2;
|
if (!this->_internal_errstring().empty()) {
|
total_size += 1 +
|
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
|
this->_internal_errstring());
|
}
|
|
// .bhome_msg.ErrorCode errCode = 1;
|
if (this->_internal_errcode() != 0) {
|
total_size += 1 +
|
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_errcode());
|
}
|
|
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 ErrorMsg::CheckTypeAndMergeFrom(
|
const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
|
MergeFrom(*::PROTOBUF_NAMESPACE_ID::internal::DownCast<const ErrorMsg*>(
|
&from));
|
}
|
|
void ErrorMsg::MergeFrom(const ErrorMsg& from) {
|
// @@protoc_insertion_point(class_specific_merge_from_start:bhome_msg.ErrorMsg)
|
GOOGLE_DCHECK_NE(&from, this);
|
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
|
(void) cached_has_bits;
|
|
if (!from._internal_errstring().empty()) {
|
_internal_set_errstring(from._internal_errstring());
|
}
|
if (from._internal_errcode() != 0) {
|
_internal_set_errcode(from._internal_errcode());
|
}
|
_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
|
}
|
|
void ErrorMsg::CopyFrom(const ErrorMsg& from) {
|
// @@protoc_insertion_point(class_specific_copy_from_start:bhome_msg.ErrorMsg)
|
if (&from == this) return;
|
Clear();
|
MergeFrom(from);
|
}
|
|
bool ErrorMsg::IsInitialized() const {
|
return true;
|
}
|
|
void ErrorMsg::InternalSwap(ErrorMsg* other) {
|
using std::swap;
|
_internal_metadata_.InternalSwap(&other->_internal_metadata_);
|
::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
|
&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
|
&errstring_, GetArenaForAllocation(),
|
&other->errstring_, other->GetArenaForAllocation()
|
);
|
swap(errcode_, other->errcode_);
|
}
|
|
std::string ErrorMsg::GetTypeName() const {
|
return "bhome_msg.ErrorMsg";
|
}
|
|
|
// @@protoc_insertion_point(namespace_scope)
|
} // namespace bhome_msg
|
PROTOBUF_NAMESPACE_OPEN
|
template<> PROTOBUF_NOINLINE ::bhome_msg::ErrorMsg* Arena::CreateMaybeMessage< ::bhome_msg::ErrorMsg >(Arena* arena) {
|
return Arena::CreateMessageInternal< ::bhome_msg::ErrorMsg >(arena);
|
}
|
PROTOBUF_NAMESPACE_CLOSE
|
|
// @@protoc_insertion_point(global_scope)
|
#include <google/protobuf/port_undef.inc>
|