message_base.pb.cc 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618
  1. // Generated by the protocol buffer compiler. DO NOT EDIT!
  2. // source: message_base.proto
  3. #include "message_base.pb.h"
  4. #include <algorithm>
  5. #include <google/protobuf/stubs/common.h>
  6. #include <google/protobuf/stubs/port.h>
  7. #include <google/protobuf/stubs/once.h>
  8. #include <google/protobuf/io/coded_stream.h>
  9. #include <google/protobuf/wire_format_lite_inl.h>
  10. #include <google/protobuf/descriptor.h>
  11. #include <google/protobuf/generated_message_reflection.h>
  12. #include <google/protobuf/reflection_ops.h>
  13. #include <google/protobuf/wire_format.h>
  14. // This is a temporary google only hack
  15. #ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
  16. #include "third_party/protobuf/version.h"
  17. #endif
  18. // @@protoc_insertion_point(includes)
  19. namespace message {
  20. class Command_messageDefaultTypeInternal {
  21. public:
  22. ::google::protobuf::internal::ExplicitlyConstructed<Command_message>
  23. _instance;
  24. } _Command_message_default_instance_;
  25. } // namespace message
  26. namespace protobuf_message_5fbase_2eproto {
  27. void InitDefaultsCommand_messageImpl() {
  28. GOOGLE_PROTOBUF_VERIFY_VERSION;
  29. #ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
  30. ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
  31. #else
  32. ::google::protobuf::internal::InitProtobufDefaults();
  33. #endif // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
  34. {
  35. void* ptr = &::message::_Command_message_default_instance_;
  36. new (ptr) ::message::Command_message();
  37. ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
  38. }
  39. ::message::Command_message::InitAsDefaultInstance();
  40. }
  41. void InitDefaultsCommand_message() {
  42. static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
  43. ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsCommand_messageImpl);
  44. }
  45. ::google::protobuf::Metadata file_level_metadata[1];
  46. const ::google::protobuf::EnumDescriptor* file_level_enum_descriptors[2];
  47. const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
  48. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Command_message, _has_bits_),
  49. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Command_message, _internal_metadata_),
  50. ~0u, // no _extensions_
  51. ~0u, // no _oneof_case_
  52. ~0u, // no _weak_field_map_
  53. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Command_message, msg_type_),
  54. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Command_message, command_id_),
  55. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Command_message, act_type_),
  56. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Command_message, from_id_),
  57. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Command_message, destination_id_),
  58. 4,
  59. 0,
  60. 1,
  61. 2,
  62. 3,
  63. };
  64. static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
  65. { 0, 10, sizeof(::message::Command_message)},
  66. };
  67. static ::google::protobuf::Message const * const file_default_instances[] = {
  68. reinterpret_cast<const ::google::protobuf::Message*>(&::message::_Command_message_default_instance_),
  69. };
  70. void protobuf_AssignDescriptors() {
  71. AddDescriptors();
  72. ::google::protobuf::MessageFactory* factory = NULL;
  73. AssignDescriptors(
  74. "message_base.proto", schemas, file_default_instances, TableStruct::offsets, factory,
  75. file_level_metadata, file_level_enum_descriptors, NULL);
  76. }
  77. void protobuf_AssignDescriptorsOnce() {
  78. static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
  79. ::google::protobuf::GoogleOnceInit(&once, &protobuf_AssignDescriptors);
  80. }
  81. void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD;
  82. void protobuf_RegisterTypes(const ::std::string&) {
  83. protobuf_AssignDescriptorsOnce();
  84. ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 1);
  85. }
  86. void AddDescriptorsImpl() {
  87. InitDefaults();
  88. static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
  89. "\n\022message_base.proto\022\007message\"\237\001\n\017Comman"
  90. "d_message\022\'\n\010msg_type\030\001 \002(\0162\025.message.Me"
  91. "ssage_type\022\022\n\ncommand_id\030\002 \002(\005\022&\n\010act_ty"
  92. "pe\030\003 \002(\0162\024.message.Action_type\022\017\n\007from_i"
  93. "d\030\004 \002(\005\022\026\n\016destination_id\030\005 \002(\005*\320\001\n\014Mess"
  94. "age_type\022\023\n\017COMMAND_MESSAGE\020\001\022\032\n\026SENSING"
  95. "_STATUS_MESSAGE\020\021\022\033\n\027SENSING_REQUEST_MES"
  96. "SAGE\020\022\022\034\n\030SENSING_RESPONSE_MESSAGE\020\023\022\031\n\025"
  97. "HARWARE_STATU_MESSAGE\020!\022\033\n\027EXECUTE_REQUE"
  98. "ST_MESSAGE\020\"\022\034\n\030EXECUTE_RESPONSE_MESSAGE"
  99. "\020#*#\n\013Action_type\022\t\n\005ePark\020\000\022\t\n\005ePick\020\001"
  100. };
  101. ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
  102. descriptor, 439);
  103. ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
  104. "message_base.proto", &protobuf_RegisterTypes);
  105. }
  106. void AddDescriptors() {
  107. static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
  108. ::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl);
  109. }
  110. // Force AddDescriptors() to be called at dynamic initialization time.
  111. struct StaticDescriptorInitializer {
  112. StaticDescriptorInitializer() {
  113. AddDescriptors();
  114. }
  115. } static_descriptor_initializer;
  116. } // namespace protobuf_message_5fbase_2eproto
  117. namespace message {
  118. const ::google::protobuf::EnumDescriptor* Message_type_descriptor() {
  119. protobuf_message_5fbase_2eproto::protobuf_AssignDescriptorsOnce();
  120. return protobuf_message_5fbase_2eproto::file_level_enum_descriptors[0];
  121. }
  122. bool Message_type_IsValid(int value) {
  123. switch (value) {
  124. case 1:
  125. case 17:
  126. case 18:
  127. case 19:
  128. case 33:
  129. case 34:
  130. case 35:
  131. return true;
  132. default:
  133. return false;
  134. }
  135. }
  136. const ::google::protobuf::EnumDescriptor* Action_type_descriptor() {
  137. protobuf_message_5fbase_2eproto::protobuf_AssignDescriptorsOnce();
  138. return protobuf_message_5fbase_2eproto::file_level_enum_descriptors[1];
  139. }
  140. bool Action_type_IsValid(int value) {
  141. switch (value) {
  142. case 0:
  143. case 1:
  144. return true;
  145. default:
  146. return false;
  147. }
  148. }
  149. // ===================================================================
  150. void Command_message::InitAsDefaultInstance() {
  151. }
  152. #if !defined(_MSC_VER) || _MSC_VER >= 1900
  153. const int Command_message::kMsgTypeFieldNumber;
  154. const int Command_message::kCommandIdFieldNumber;
  155. const int Command_message::kActTypeFieldNumber;
  156. const int Command_message::kFromIdFieldNumber;
  157. const int Command_message::kDestinationIdFieldNumber;
  158. #endif // !defined(_MSC_VER) || _MSC_VER >= 1900
  159. Command_message::Command_message()
  160. : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  161. if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
  162. ::protobuf_message_5fbase_2eproto::InitDefaultsCommand_message();
  163. }
  164. SharedCtor();
  165. // @@protoc_insertion_point(constructor:message.Command_message)
  166. }
  167. Command_message::Command_message(const Command_message& from)
  168. : ::google::protobuf::Message(),
  169. _internal_metadata_(NULL),
  170. _has_bits_(from._has_bits_),
  171. _cached_size_(0) {
  172. _internal_metadata_.MergeFrom(from._internal_metadata_);
  173. ::memcpy(&command_id_, &from.command_id_,
  174. static_cast<size_t>(reinterpret_cast<char*>(&msg_type_) -
  175. reinterpret_cast<char*>(&command_id_)) + sizeof(msg_type_));
  176. // @@protoc_insertion_point(copy_constructor:message.Command_message)
  177. }
  178. void Command_message::SharedCtor() {
  179. _cached_size_ = 0;
  180. ::memset(&command_id_, 0, static_cast<size_t>(
  181. reinterpret_cast<char*>(&destination_id_) -
  182. reinterpret_cast<char*>(&command_id_)) + sizeof(destination_id_));
  183. msg_type_ = 1;
  184. }
  185. Command_message::~Command_message() {
  186. // @@protoc_insertion_point(destructor:message.Command_message)
  187. SharedDtor();
  188. }
  189. void Command_message::SharedDtor() {
  190. }
  191. void Command_message::SetCachedSize(int size) const {
  192. GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  193. _cached_size_ = size;
  194. GOOGLE_SAFE_CONCURRENT_WRITES_END();
  195. }
  196. const ::google::protobuf::Descriptor* Command_message::descriptor() {
  197. ::protobuf_message_5fbase_2eproto::protobuf_AssignDescriptorsOnce();
  198. return ::protobuf_message_5fbase_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
  199. }
  200. const Command_message& Command_message::default_instance() {
  201. ::protobuf_message_5fbase_2eproto::InitDefaultsCommand_message();
  202. return *internal_default_instance();
  203. }
  204. Command_message* Command_message::New(::google::protobuf::Arena* arena) const {
  205. Command_message* n = new Command_message;
  206. if (arena != NULL) {
  207. arena->Own(n);
  208. }
  209. return n;
  210. }
  211. void Command_message::Clear() {
  212. // @@protoc_insertion_point(message_clear_start:message.Command_message)
  213. ::google::protobuf::uint32 cached_has_bits = 0;
  214. // Prevent compiler warnings about cached_has_bits being unused
  215. (void) cached_has_bits;
  216. cached_has_bits = _has_bits_[0];
  217. if (cached_has_bits & 31u) {
  218. ::memset(&command_id_, 0, static_cast<size_t>(
  219. reinterpret_cast<char*>(&destination_id_) -
  220. reinterpret_cast<char*>(&command_id_)) + sizeof(destination_id_));
  221. msg_type_ = 1;
  222. }
  223. _has_bits_.Clear();
  224. _internal_metadata_.Clear();
  225. }
  226. bool Command_message::MergePartialFromCodedStream(
  227. ::google::protobuf::io::CodedInputStream* input) {
  228. #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  229. ::google::protobuf::uint32 tag;
  230. // @@protoc_insertion_point(parse_start:message.Command_message)
  231. for (;;) {
  232. ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
  233. tag = p.first;
  234. if (!p.second) goto handle_unusual;
  235. switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
  236. // required .message.Message_type msg_type = 1;
  237. case 1: {
  238. if (static_cast< ::google::protobuf::uint8>(tag) ==
  239. static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
  240. int value;
  241. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  242. int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
  243. input, &value)));
  244. if (::message::Message_type_IsValid(value)) {
  245. set_msg_type(static_cast< ::message::Message_type >(value));
  246. } else {
  247. mutable_unknown_fields()->AddVarint(
  248. 1, static_cast< ::google::protobuf::uint64>(value));
  249. }
  250. } else {
  251. goto handle_unusual;
  252. }
  253. break;
  254. }
  255. // required int32 command_id = 2;
  256. case 2: {
  257. if (static_cast< ::google::protobuf::uint8>(tag) ==
  258. static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) {
  259. set_has_command_id();
  260. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  261. ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
  262. input, &command_id_)));
  263. } else {
  264. goto handle_unusual;
  265. }
  266. break;
  267. }
  268. // required .message.Action_type act_type = 3;
  269. case 3: {
  270. if (static_cast< ::google::protobuf::uint8>(tag) ==
  271. static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) {
  272. int value;
  273. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  274. int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
  275. input, &value)));
  276. if (::message::Action_type_IsValid(value)) {
  277. set_act_type(static_cast< ::message::Action_type >(value));
  278. } else {
  279. mutable_unknown_fields()->AddVarint(
  280. 3, static_cast< ::google::protobuf::uint64>(value));
  281. }
  282. } else {
  283. goto handle_unusual;
  284. }
  285. break;
  286. }
  287. // required int32 from_id = 4;
  288. case 4: {
  289. if (static_cast< ::google::protobuf::uint8>(tag) ==
  290. static_cast< ::google::protobuf::uint8>(32u /* 32 & 0xFF */)) {
  291. set_has_from_id();
  292. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  293. ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
  294. input, &from_id_)));
  295. } else {
  296. goto handle_unusual;
  297. }
  298. break;
  299. }
  300. // required int32 destination_id = 5;
  301. case 5: {
  302. if (static_cast< ::google::protobuf::uint8>(tag) ==
  303. static_cast< ::google::protobuf::uint8>(40u /* 40 & 0xFF */)) {
  304. set_has_destination_id();
  305. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  306. ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
  307. input, &destination_id_)));
  308. } else {
  309. goto handle_unusual;
  310. }
  311. break;
  312. }
  313. default: {
  314. handle_unusual:
  315. if (tag == 0) {
  316. goto success;
  317. }
  318. DO_(::google::protobuf::internal::WireFormat::SkipField(
  319. input, tag, _internal_metadata_.mutable_unknown_fields()));
  320. break;
  321. }
  322. }
  323. }
  324. success:
  325. // @@protoc_insertion_point(parse_success:message.Command_message)
  326. return true;
  327. failure:
  328. // @@protoc_insertion_point(parse_failure:message.Command_message)
  329. return false;
  330. #undef DO_
  331. }
  332. void Command_message::SerializeWithCachedSizes(
  333. ::google::protobuf::io::CodedOutputStream* output) const {
  334. // @@protoc_insertion_point(serialize_start:message.Command_message)
  335. ::google::protobuf::uint32 cached_has_bits = 0;
  336. (void) cached_has_bits;
  337. cached_has_bits = _has_bits_[0];
  338. // required .message.Message_type msg_type = 1;
  339. if (cached_has_bits & 0x00000010u) {
  340. ::google::protobuf::internal::WireFormatLite::WriteEnum(
  341. 1, this->msg_type(), output);
  342. }
  343. // required int32 command_id = 2;
  344. if (cached_has_bits & 0x00000001u) {
  345. ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->command_id(), output);
  346. }
  347. // required .message.Action_type act_type = 3;
  348. if (cached_has_bits & 0x00000002u) {
  349. ::google::protobuf::internal::WireFormatLite::WriteEnum(
  350. 3, this->act_type(), output);
  351. }
  352. // required int32 from_id = 4;
  353. if (cached_has_bits & 0x00000004u) {
  354. ::google::protobuf::internal::WireFormatLite::WriteInt32(4, this->from_id(), output);
  355. }
  356. // required int32 destination_id = 5;
  357. if (cached_has_bits & 0x00000008u) {
  358. ::google::protobuf::internal::WireFormatLite::WriteInt32(5, this->destination_id(), output);
  359. }
  360. if (_internal_metadata_.have_unknown_fields()) {
  361. ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
  362. _internal_metadata_.unknown_fields(), output);
  363. }
  364. // @@protoc_insertion_point(serialize_end:message.Command_message)
  365. }
  366. ::google::protobuf::uint8* Command_message::InternalSerializeWithCachedSizesToArray(
  367. bool deterministic, ::google::protobuf::uint8* target) const {
  368. (void)deterministic; // Unused
  369. // @@protoc_insertion_point(serialize_to_array_start:message.Command_message)
  370. ::google::protobuf::uint32 cached_has_bits = 0;
  371. (void) cached_has_bits;
  372. cached_has_bits = _has_bits_[0];
  373. // required .message.Message_type msg_type = 1;
  374. if (cached_has_bits & 0x00000010u) {
  375. target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
  376. 1, this->msg_type(), target);
  377. }
  378. // required int32 command_id = 2;
  379. if (cached_has_bits & 0x00000001u) {
  380. target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->command_id(), target);
  381. }
  382. // required .message.Action_type act_type = 3;
  383. if (cached_has_bits & 0x00000002u) {
  384. target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
  385. 3, this->act_type(), target);
  386. }
  387. // required int32 from_id = 4;
  388. if (cached_has_bits & 0x00000004u) {
  389. target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(4, this->from_id(), target);
  390. }
  391. // required int32 destination_id = 5;
  392. if (cached_has_bits & 0x00000008u) {
  393. target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(5, this->destination_id(), target);
  394. }
  395. if (_internal_metadata_.have_unknown_fields()) {
  396. target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
  397. _internal_metadata_.unknown_fields(), target);
  398. }
  399. // @@protoc_insertion_point(serialize_to_array_end:message.Command_message)
  400. return target;
  401. }
  402. size_t Command_message::RequiredFieldsByteSizeFallback() const {
  403. // @@protoc_insertion_point(required_fields_byte_size_fallback_start:message.Command_message)
  404. size_t total_size = 0;
  405. if (has_command_id()) {
  406. // required int32 command_id = 2;
  407. total_size += 1 +
  408. ::google::protobuf::internal::WireFormatLite::Int32Size(
  409. this->command_id());
  410. }
  411. if (has_act_type()) {
  412. // required .message.Action_type act_type = 3;
  413. total_size += 1 +
  414. ::google::protobuf::internal::WireFormatLite::EnumSize(this->act_type());
  415. }
  416. if (has_from_id()) {
  417. // required int32 from_id = 4;
  418. total_size += 1 +
  419. ::google::protobuf::internal::WireFormatLite::Int32Size(
  420. this->from_id());
  421. }
  422. if (has_destination_id()) {
  423. // required int32 destination_id = 5;
  424. total_size += 1 +
  425. ::google::protobuf::internal::WireFormatLite::Int32Size(
  426. this->destination_id());
  427. }
  428. if (has_msg_type()) {
  429. // required .message.Message_type msg_type = 1;
  430. total_size += 1 +
  431. ::google::protobuf::internal::WireFormatLite::EnumSize(this->msg_type());
  432. }
  433. return total_size;
  434. }
  435. size_t Command_message::ByteSizeLong() const {
  436. // @@protoc_insertion_point(message_byte_size_start:message.Command_message)
  437. size_t total_size = 0;
  438. if (_internal_metadata_.have_unknown_fields()) {
  439. total_size +=
  440. ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
  441. _internal_metadata_.unknown_fields());
  442. }
  443. if (((_has_bits_[0] & 0x0000001f) ^ 0x0000001f) == 0) { // All required fields are present.
  444. // required int32 command_id = 2;
  445. total_size += 1 +
  446. ::google::protobuf::internal::WireFormatLite::Int32Size(
  447. this->command_id());
  448. // required .message.Action_type act_type = 3;
  449. total_size += 1 +
  450. ::google::protobuf::internal::WireFormatLite::EnumSize(this->act_type());
  451. // required int32 from_id = 4;
  452. total_size += 1 +
  453. ::google::protobuf::internal::WireFormatLite::Int32Size(
  454. this->from_id());
  455. // required int32 destination_id = 5;
  456. total_size += 1 +
  457. ::google::protobuf::internal::WireFormatLite::Int32Size(
  458. this->destination_id());
  459. // required .message.Message_type msg_type = 1;
  460. total_size += 1 +
  461. ::google::protobuf::internal::WireFormatLite::EnumSize(this->msg_type());
  462. } else {
  463. total_size += RequiredFieldsByteSizeFallback();
  464. }
  465. int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
  466. GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  467. _cached_size_ = cached_size;
  468. GOOGLE_SAFE_CONCURRENT_WRITES_END();
  469. return total_size;
  470. }
  471. void Command_message::MergeFrom(const ::google::protobuf::Message& from) {
  472. // @@protoc_insertion_point(generalized_merge_from_start:message.Command_message)
  473. GOOGLE_DCHECK_NE(&from, this);
  474. const Command_message* source =
  475. ::google::protobuf::internal::DynamicCastToGenerated<const Command_message>(
  476. &from);
  477. if (source == NULL) {
  478. // @@protoc_insertion_point(generalized_merge_from_cast_fail:message.Command_message)
  479. ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  480. } else {
  481. // @@protoc_insertion_point(generalized_merge_from_cast_success:message.Command_message)
  482. MergeFrom(*source);
  483. }
  484. }
  485. void Command_message::MergeFrom(const Command_message& from) {
  486. // @@protoc_insertion_point(class_specific_merge_from_start:message.Command_message)
  487. GOOGLE_DCHECK_NE(&from, this);
  488. _internal_metadata_.MergeFrom(from._internal_metadata_);
  489. ::google::protobuf::uint32 cached_has_bits = 0;
  490. (void) cached_has_bits;
  491. cached_has_bits = from._has_bits_[0];
  492. if (cached_has_bits & 31u) {
  493. if (cached_has_bits & 0x00000001u) {
  494. command_id_ = from.command_id_;
  495. }
  496. if (cached_has_bits & 0x00000002u) {
  497. act_type_ = from.act_type_;
  498. }
  499. if (cached_has_bits & 0x00000004u) {
  500. from_id_ = from.from_id_;
  501. }
  502. if (cached_has_bits & 0x00000008u) {
  503. destination_id_ = from.destination_id_;
  504. }
  505. if (cached_has_bits & 0x00000010u) {
  506. msg_type_ = from.msg_type_;
  507. }
  508. _has_bits_[0] |= cached_has_bits;
  509. }
  510. }
  511. void Command_message::CopyFrom(const ::google::protobuf::Message& from) {
  512. // @@protoc_insertion_point(generalized_copy_from_start:message.Command_message)
  513. if (&from == this) return;
  514. Clear();
  515. MergeFrom(from);
  516. }
  517. void Command_message::CopyFrom(const Command_message& from) {
  518. // @@protoc_insertion_point(class_specific_copy_from_start:message.Command_message)
  519. if (&from == this) return;
  520. Clear();
  521. MergeFrom(from);
  522. }
  523. bool Command_message::IsInitialized() const {
  524. if ((_has_bits_[0] & 0x0000001f) != 0x0000001f) return false;
  525. return true;
  526. }
  527. void Command_message::Swap(Command_message* other) {
  528. if (other == this) return;
  529. InternalSwap(other);
  530. }
  531. void Command_message::InternalSwap(Command_message* other) {
  532. using std::swap;
  533. swap(command_id_, other->command_id_);
  534. swap(act_type_, other->act_type_);
  535. swap(from_id_, other->from_id_);
  536. swap(destination_id_, other->destination_id_);
  537. swap(msg_type_, other->msg_type_);
  538. swap(_has_bits_[0], other->_has_bits_[0]);
  539. _internal_metadata_.Swap(&other->_internal_metadata_);
  540. swap(_cached_size_, other->_cached_size_);
  541. }
  542. ::google::protobuf::Metadata Command_message::GetMetadata() const {
  543. protobuf_message_5fbase_2eproto::protobuf_AssignDescriptorsOnce();
  544. return ::protobuf_message_5fbase_2eproto::file_level_metadata[kIndexInFileMessages];
  545. }
  546. // @@protoc_insertion_point(namespace_scope)
  547. } // namespace message
  548. // @@protoc_insertion_point(global_scope)