zhangmeng
2022-12-12 1d3df8349f8ec3d09efa8f41ec8acc706979f40f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
// 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>