message_base.pb.cc 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904
  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 Base_msgDefaultTypeInternal {
  21. public:
  22. ::google::protobuf::internal::ExplicitlyConstructed<Base_msg>
  23. _instance;
  24. } _Base_msg_default_instance_;
  25. class Command_messageDefaultTypeInternal {
  26. public:
  27. ::google::protobuf::internal::ExplicitlyConstructed<Command_message>
  28. _instance;
  29. } _Command_message_default_instance_;
  30. } // namespace message
  31. namespace protobuf_message_5fbase_2eproto {
  32. void InitDefaultsBase_msgImpl() {
  33. GOOGLE_PROTOBUF_VERIFY_VERSION;
  34. #ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
  35. ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
  36. #else
  37. ::google::protobuf::internal::InitProtobufDefaults();
  38. #endif // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
  39. {
  40. void* ptr = &::message::_Base_msg_default_instance_;
  41. new (ptr) ::message::Base_msg();
  42. ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
  43. }
  44. ::message::Base_msg::InitAsDefaultInstance();
  45. }
  46. void InitDefaultsBase_msg() {
  47. static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
  48. ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsBase_msgImpl);
  49. }
  50. void InitDefaultsCommand_messageImpl() {
  51. GOOGLE_PROTOBUF_VERIFY_VERSION;
  52. #ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
  53. ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
  54. #else
  55. ::google::protobuf::internal::InitProtobufDefaults();
  56. #endif // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
  57. {
  58. void* ptr = &::message::_Command_message_default_instance_;
  59. new (ptr) ::message::Command_message();
  60. ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
  61. }
  62. ::message::Command_message::InitAsDefaultInstance();
  63. }
  64. void InitDefaultsCommand_message() {
  65. static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
  66. ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsCommand_messageImpl);
  67. }
  68. ::google::protobuf::Metadata file_level_metadata[2];
  69. const ::google::protobuf::EnumDescriptor* file_level_enum_descriptors[2];
  70. const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
  71. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Base_msg, _has_bits_),
  72. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Base_msg, _internal_metadata_),
  73. ~0u, // no _extensions_
  74. ~0u, // no _oneof_case_
  75. ~0u, // no _weak_field_map_
  76. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Base_msg, msg_type_),
  77. 0,
  78. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Command_message, _has_bits_),
  79. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Command_message, _internal_metadata_),
  80. ~0u, // no _extensions_
  81. ~0u, // no _oneof_case_
  82. ~0u, // no _weak_field_map_
  83. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Command_message, msg_type_),
  84. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Command_message, command_id_),
  85. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Command_message, act_type_),
  86. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Command_message, from_id_),
  87. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Command_message, destination_id_),
  88. 0,
  89. 1,
  90. 2,
  91. 3,
  92. 4,
  93. };
  94. static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
  95. { 0, 6, sizeof(::message::Base_msg)},
  96. { 7, 17, sizeof(::message::Command_message)},
  97. };
  98. static ::google::protobuf::Message const * const file_default_instances[] = {
  99. reinterpret_cast<const ::google::protobuf::Message*>(&::message::_Base_msg_default_instance_),
  100. reinterpret_cast<const ::google::protobuf::Message*>(&::message::_Command_message_default_instance_),
  101. };
  102. void protobuf_AssignDescriptors() {
  103. AddDescriptors();
  104. ::google::protobuf::MessageFactory* factory = NULL;
  105. AssignDescriptors(
  106. "message_base.proto", schemas, file_default_instances, TableStruct::offsets, factory,
  107. file_level_metadata, file_level_enum_descriptors, NULL);
  108. }
  109. void protobuf_AssignDescriptorsOnce() {
  110. static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
  111. ::google::protobuf::GoogleOnceInit(&once, &protobuf_AssignDescriptors);
  112. }
  113. void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD;
  114. void protobuf_RegisterTypes(const ::std::string&) {
  115. protobuf_AssignDescriptorsOnce();
  116. ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 2);
  117. }
  118. void AddDescriptorsImpl() {
  119. InitDefaults();
  120. static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
  121. "\n\022message_base.proto\022\007message\"3\n\010Base_ms"
  122. "g\022\'\n\010msg_type\030\001 \002(\0162\025.message.Message_ty"
  123. "pe\"\237\001\n\017Command_message\022\'\n\010msg_type\030\001 \002(\016"
  124. "2\025.message.Message_type\022\022\n\ncommand_id\030\002 "
  125. "\002(\005\022&\n\010act_type\030\003 \002(\0162\024.message.Action_t"
  126. "ype\022\017\n\007from_id\030\004 \002(\005\022\026\n\016destination_id\030\005"
  127. " \002(\005*\307\001\n\014Message_type\022\r\n\teBase_msg\020\000\022\020\n\014"
  128. "eCommand_msg\020\001\022\026\n\022eLocate_status_msg\020\021\022\027"
  129. "\n\023eLocate_request_msg\020\022\022\030\n\024eLocate_respo"
  130. "nse_msg\020\023\022\026\n\022eHarware_statu_msg\020!\022\030\n\024eEx"
  131. "ecute_request_msg\020\"\022\031\n\025eExecute_response"
  132. "_msg\020#*#\n\013Action_type\022\t\n\005ePark\020\000\022\t\n\005ePic"
  133. "k\020\001"
  134. };
  135. ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
  136. descriptor, 483);
  137. ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
  138. "message_base.proto", &protobuf_RegisterTypes);
  139. }
  140. void AddDescriptors() {
  141. static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
  142. ::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl);
  143. }
  144. // Force AddDescriptors() to be called at dynamic initialization time.
  145. struct StaticDescriptorInitializer {
  146. StaticDescriptorInitializer() {
  147. AddDescriptors();
  148. }
  149. } static_descriptor_initializer;
  150. } // namespace protobuf_message_5fbase_2eproto
  151. namespace message {
  152. const ::google::protobuf::EnumDescriptor* Message_type_descriptor() {
  153. protobuf_message_5fbase_2eproto::protobuf_AssignDescriptorsOnce();
  154. return protobuf_message_5fbase_2eproto::file_level_enum_descriptors[0];
  155. }
  156. bool Message_type_IsValid(int value) {
  157. switch (value) {
  158. case 0:
  159. case 1:
  160. case 17:
  161. case 18:
  162. case 19:
  163. case 33:
  164. case 34:
  165. case 35:
  166. return true;
  167. default:
  168. return false;
  169. }
  170. }
  171. const ::google::protobuf::EnumDescriptor* Action_type_descriptor() {
  172. protobuf_message_5fbase_2eproto::protobuf_AssignDescriptorsOnce();
  173. return protobuf_message_5fbase_2eproto::file_level_enum_descriptors[1];
  174. }
  175. bool Action_type_IsValid(int value) {
  176. switch (value) {
  177. case 0:
  178. case 1:
  179. return true;
  180. default:
  181. return false;
  182. }
  183. }
  184. // ===================================================================
  185. void Base_msg::InitAsDefaultInstance() {
  186. }
  187. #if !defined(_MSC_VER) || _MSC_VER >= 1900
  188. const int Base_msg::kMsgTypeFieldNumber;
  189. #endif // !defined(_MSC_VER) || _MSC_VER >= 1900
  190. Base_msg::Base_msg()
  191. : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  192. if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
  193. ::protobuf_message_5fbase_2eproto::InitDefaultsBase_msg();
  194. }
  195. SharedCtor();
  196. // @@protoc_insertion_point(constructor:message.Base_msg)
  197. }
  198. Base_msg::Base_msg(const Base_msg& from)
  199. : ::google::protobuf::Message(),
  200. _internal_metadata_(NULL),
  201. _has_bits_(from._has_bits_),
  202. _cached_size_(0) {
  203. _internal_metadata_.MergeFrom(from._internal_metadata_);
  204. msg_type_ = from.msg_type_;
  205. // @@protoc_insertion_point(copy_constructor:message.Base_msg)
  206. }
  207. void Base_msg::SharedCtor() {
  208. _cached_size_ = 0;
  209. msg_type_ = 0;
  210. }
  211. Base_msg::~Base_msg() {
  212. // @@protoc_insertion_point(destructor:message.Base_msg)
  213. SharedDtor();
  214. }
  215. void Base_msg::SharedDtor() {
  216. }
  217. void Base_msg::SetCachedSize(int size) const {
  218. GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  219. _cached_size_ = size;
  220. GOOGLE_SAFE_CONCURRENT_WRITES_END();
  221. }
  222. const ::google::protobuf::Descriptor* Base_msg::descriptor() {
  223. ::protobuf_message_5fbase_2eproto::protobuf_AssignDescriptorsOnce();
  224. return ::protobuf_message_5fbase_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
  225. }
  226. const Base_msg& Base_msg::default_instance() {
  227. ::protobuf_message_5fbase_2eproto::InitDefaultsBase_msg();
  228. return *internal_default_instance();
  229. }
  230. Base_msg* Base_msg::New(::google::protobuf::Arena* arena) const {
  231. Base_msg* n = new Base_msg;
  232. if (arena != NULL) {
  233. arena->Own(n);
  234. }
  235. return n;
  236. }
  237. void Base_msg::Clear() {
  238. // @@protoc_insertion_point(message_clear_start:message.Base_msg)
  239. ::google::protobuf::uint32 cached_has_bits = 0;
  240. // Prevent compiler warnings about cached_has_bits being unused
  241. (void) cached_has_bits;
  242. msg_type_ = 0;
  243. _has_bits_.Clear();
  244. _internal_metadata_.Clear();
  245. }
  246. bool Base_msg::MergePartialFromCodedStream(
  247. ::google::protobuf::io::CodedInputStream* input) {
  248. #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  249. ::google::protobuf::uint32 tag;
  250. // @@protoc_insertion_point(parse_start:message.Base_msg)
  251. for (;;) {
  252. ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
  253. tag = p.first;
  254. if (!p.second) goto handle_unusual;
  255. switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
  256. // required .message.Message_type msg_type = 1;
  257. case 1: {
  258. if (static_cast< ::google::protobuf::uint8>(tag) ==
  259. static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
  260. int value;
  261. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  262. int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
  263. input, &value)));
  264. if (::message::Message_type_IsValid(value)) {
  265. set_msg_type(static_cast< ::message::Message_type >(value));
  266. } else {
  267. mutable_unknown_fields()->AddVarint(
  268. 1, static_cast< ::google::protobuf::uint64>(value));
  269. }
  270. } else {
  271. goto handle_unusual;
  272. }
  273. break;
  274. }
  275. default: {
  276. handle_unusual:
  277. if (tag == 0) {
  278. goto success;
  279. }
  280. DO_(::google::protobuf::internal::WireFormat::SkipField(
  281. input, tag, _internal_metadata_.mutable_unknown_fields()));
  282. break;
  283. }
  284. }
  285. }
  286. success:
  287. // @@protoc_insertion_point(parse_success:message.Base_msg)
  288. return true;
  289. failure:
  290. // @@protoc_insertion_point(parse_failure:message.Base_msg)
  291. return false;
  292. #undef DO_
  293. }
  294. void Base_msg::SerializeWithCachedSizes(
  295. ::google::protobuf::io::CodedOutputStream* output) const {
  296. // @@protoc_insertion_point(serialize_start:message.Base_msg)
  297. ::google::protobuf::uint32 cached_has_bits = 0;
  298. (void) cached_has_bits;
  299. cached_has_bits = _has_bits_[0];
  300. // required .message.Message_type msg_type = 1;
  301. if (cached_has_bits & 0x00000001u) {
  302. ::google::protobuf::internal::WireFormatLite::WriteEnum(
  303. 1, this->msg_type(), output);
  304. }
  305. if (_internal_metadata_.have_unknown_fields()) {
  306. ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
  307. _internal_metadata_.unknown_fields(), output);
  308. }
  309. // @@protoc_insertion_point(serialize_end:message.Base_msg)
  310. }
  311. ::google::protobuf::uint8* Base_msg::InternalSerializeWithCachedSizesToArray(
  312. bool deterministic, ::google::protobuf::uint8* target) const {
  313. (void)deterministic; // Unused
  314. // @@protoc_insertion_point(serialize_to_array_start:message.Base_msg)
  315. ::google::protobuf::uint32 cached_has_bits = 0;
  316. (void) cached_has_bits;
  317. cached_has_bits = _has_bits_[0];
  318. // required .message.Message_type msg_type = 1;
  319. if (cached_has_bits & 0x00000001u) {
  320. target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
  321. 1, this->msg_type(), target);
  322. }
  323. if (_internal_metadata_.have_unknown_fields()) {
  324. target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
  325. _internal_metadata_.unknown_fields(), target);
  326. }
  327. // @@protoc_insertion_point(serialize_to_array_end:message.Base_msg)
  328. return target;
  329. }
  330. size_t Base_msg::ByteSizeLong() const {
  331. // @@protoc_insertion_point(message_byte_size_start:message.Base_msg)
  332. size_t total_size = 0;
  333. if (_internal_metadata_.have_unknown_fields()) {
  334. total_size +=
  335. ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
  336. _internal_metadata_.unknown_fields());
  337. }
  338. // required .message.Message_type msg_type = 1;
  339. if (has_msg_type()) {
  340. total_size += 1 +
  341. ::google::protobuf::internal::WireFormatLite::EnumSize(this->msg_type());
  342. }
  343. int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
  344. GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  345. _cached_size_ = cached_size;
  346. GOOGLE_SAFE_CONCURRENT_WRITES_END();
  347. return total_size;
  348. }
  349. void Base_msg::MergeFrom(const ::google::protobuf::Message& from) {
  350. // @@protoc_insertion_point(generalized_merge_from_start:message.Base_msg)
  351. GOOGLE_DCHECK_NE(&from, this);
  352. const Base_msg* source =
  353. ::google::protobuf::internal::DynamicCastToGenerated<const Base_msg>(
  354. &from);
  355. if (source == NULL) {
  356. // @@protoc_insertion_point(generalized_merge_from_cast_fail:message.Base_msg)
  357. ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  358. } else {
  359. // @@protoc_insertion_point(generalized_merge_from_cast_success:message.Base_msg)
  360. MergeFrom(*source);
  361. }
  362. }
  363. void Base_msg::MergeFrom(const Base_msg& from) {
  364. // @@protoc_insertion_point(class_specific_merge_from_start:message.Base_msg)
  365. GOOGLE_DCHECK_NE(&from, this);
  366. _internal_metadata_.MergeFrom(from._internal_metadata_);
  367. ::google::protobuf::uint32 cached_has_bits = 0;
  368. (void) cached_has_bits;
  369. if (from.has_msg_type()) {
  370. set_msg_type(from.msg_type());
  371. }
  372. }
  373. void Base_msg::CopyFrom(const ::google::protobuf::Message& from) {
  374. // @@protoc_insertion_point(generalized_copy_from_start:message.Base_msg)
  375. if (&from == this) return;
  376. Clear();
  377. MergeFrom(from);
  378. }
  379. void Base_msg::CopyFrom(const Base_msg& from) {
  380. // @@protoc_insertion_point(class_specific_copy_from_start:message.Base_msg)
  381. if (&from == this) return;
  382. Clear();
  383. MergeFrom(from);
  384. }
  385. bool Base_msg::IsInitialized() const {
  386. if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
  387. return true;
  388. }
  389. void Base_msg::Swap(Base_msg* other) {
  390. if (other == this) return;
  391. InternalSwap(other);
  392. }
  393. void Base_msg::InternalSwap(Base_msg* other) {
  394. using std::swap;
  395. swap(msg_type_, other->msg_type_);
  396. swap(_has_bits_[0], other->_has_bits_[0]);
  397. _internal_metadata_.Swap(&other->_internal_metadata_);
  398. swap(_cached_size_, other->_cached_size_);
  399. }
  400. ::google::protobuf::Metadata Base_msg::GetMetadata() const {
  401. protobuf_message_5fbase_2eproto::protobuf_AssignDescriptorsOnce();
  402. return ::protobuf_message_5fbase_2eproto::file_level_metadata[kIndexInFileMessages];
  403. }
  404. // ===================================================================
  405. void Command_message::InitAsDefaultInstance() {
  406. }
  407. #if !defined(_MSC_VER) || _MSC_VER >= 1900
  408. const int Command_message::kMsgTypeFieldNumber;
  409. const int Command_message::kCommandIdFieldNumber;
  410. const int Command_message::kActTypeFieldNumber;
  411. const int Command_message::kFromIdFieldNumber;
  412. const int Command_message::kDestinationIdFieldNumber;
  413. #endif // !defined(_MSC_VER) || _MSC_VER >= 1900
  414. Command_message::Command_message()
  415. : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  416. if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
  417. ::protobuf_message_5fbase_2eproto::InitDefaultsCommand_message();
  418. }
  419. SharedCtor();
  420. // @@protoc_insertion_point(constructor:message.Command_message)
  421. }
  422. Command_message::Command_message(const Command_message& from)
  423. : ::google::protobuf::Message(),
  424. _internal_metadata_(NULL),
  425. _has_bits_(from._has_bits_),
  426. _cached_size_(0) {
  427. _internal_metadata_.MergeFrom(from._internal_metadata_);
  428. ::memcpy(&msg_type_, &from.msg_type_,
  429. static_cast<size_t>(reinterpret_cast<char*>(&destination_id_) -
  430. reinterpret_cast<char*>(&msg_type_)) + sizeof(destination_id_));
  431. // @@protoc_insertion_point(copy_constructor:message.Command_message)
  432. }
  433. void Command_message::SharedCtor() {
  434. _cached_size_ = 0;
  435. ::memset(&msg_type_, 0, static_cast<size_t>(
  436. reinterpret_cast<char*>(&destination_id_) -
  437. reinterpret_cast<char*>(&msg_type_)) + sizeof(destination_id_));
  438. }
  439. Command_message::~Command_message() {
  440. // @@protoc_insertion_point(destructor:message.Command_message)
  441. SharedDtor();
  442. }
  443. void Command_message::SharedDtor() {
  444. }
  445. void Command_message::SetCachedSize(int size) const {
  446. GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  447. _cached_size_ = size;
  448. GOOGLE_SAFE_CONCURRENT_WRITES_END();
  449. }
  450. const ::google::protobuf::Descriptor* Command_message::descriptor() {
  451. ::protobuf_message_5fbase_2eproto::protobuf_AssignDescriptorsOnce();
  452. return ::protobuf_message_5fbase_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
  453. }
  454. const Command_message& Command_message::default_instance() {
  455. ::protobuf_message_5fbase_2eproto::InitDefaultsCommand_message();
  456. return *internal_default_instance();
  457. }
  458. Command_message* Command_message::New(::google::protobuf::Arena* arena) const {
  459. Command_message* n = new Command_message;
  460. if (arena != NULL) {
  461. arena->Own(n);
  462. }
  463. return n;
  464. }
  465. void Command_message::Clear() {
  466. // @@protoc_insertion_point(message_clear_start:message.Command_message)
  467. ::google::protobuf::uint32 cached_has_bits = 0;
  468. // Prevent compiler warnings about cached_has_bits being unused
  469. (void) cached_has_bits;
  470. cached_has_bits = _has_bits_[0];
  471. if (cached_has_bits & 31u) {
  472. ::memset(&msg_type_, 0, static_cast<size_t>(
  473. reinterpret_cast<char*>(&destination_id_) -
  474. reinterpret_cast<char*>(&msg_type_)) + sizeof(destination_id_));
  475. }
  476. _has_bits_.Clear();
  477. _internal_metadata_.Clear();
  478. }
  479. bool Command_message::MergePartialFromCodedStream(
  480. ::google::protobuf::io::CodedInputStream* input) {
  481. #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  482. ::google::protobuf::uint32 tag;
  483. // @@protoc_insertion_point(parse_start:message.Command_message)
  484. for (;;) {
  485. ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
  486. tag = p.first;
  487. if (!p.second) goto handle_unusual;
  488. switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
  489. // required .message.Message_type msg_type = 1;
  490. case 1: {
  491. if (static_cast< ::google::protobuf::uint8>(tag) ==
  492. static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
  493. int value;
  494. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  495. int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
  496. input, &value)));
  497. if (::message::Message_type_IsValid(value)) {
  498. set_msg_type(static_cast< ::message::Message_type >(value));
  499. } else {
  500. mutable_unknown_fields()->AddVarint(
  501. 1, static_cast< ::google::protobuf::uint64>(value));
  502. }
  503. } else {
  504. goto handle_unusual;
  505. }
  506. break;
  507. }
  508. // required int32 command_id = 2;
  509. case 2: {
  510. if (static_cast< ::google::protobuf::uint8>(tag) ==
  511. static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) {
  512. set_has_command_id();
  513. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  514. ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
  515. input, &command_id_)));
  516. } else {
  517. goto handle_unusual;
  518. }
  519. break;
  520. }
  521. // required .message.Action_type act_type = 3;
  522. case 3: {
  523. if (static_cast< ::google::protobuf::uint8>(tag) ==
  524. static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) {
  525. int value;
  526. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  527. int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
  528. input, &value)));
  529. if (::message::Action_type_IsValid(value)) {
  530. set_act_type(static_cast< ::message::Action_type >(value));
  531. } else {
  532. mutable_unknown_fields()->AddVarint(
  533. 3, static_cast< ::google::protobuf::uint64>(value));
  534. }
  535. } else {
  536. goto handle_unusual;
  537. }
  538. break;
  539. }
  540. // required int32 from_id = 4;
  541. case 4: {
  542. if (static_cast< ::google::protobuf::uint8>(tag) ==
  543. static_cast< ::google::protobuf::uint8>(32u /* 32 & 0xFF */)) {
  544. set_has_from_id();
  545. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  546. ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
  547. input, &from_id_)));
  548. } else {
  549. goto handle_unusual;
  550. }
  551. break;
  552. }
  553. // required int32 destination_id = 5;
  554. case 5: {
  555. if (static_cast< ::google::protobuf::uint8>(tag) ==
  556. static_cast< ::google::protobuf::uint8>(40u /* 40 & 0xFF */)) {
  557. set_has_destination_id();
  558. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  559. ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
  560. input, &destination_id_)));
  561. } else {
  562. goto handle_unusual;
  563. }
  564. break;
  565. }
  566. default: {
  567. handle_unusual:
  568. if (tag == 0) {
  569. goto success;
  570. }
  571. DO_(::google::protobuf::internal::WireFormat::SkipField(
  572. input, tag, _internal_metadata_.mutable_unknown_fields()));
  573. break;
  574. }
  575. }
  576. }
  577. success:
  578. // @@protoc_insertion_point(parse_success:message.Command_message)
  579. return true;
  580. failure:
  581. // @@protoc_insertion_point(parse_failure:message.Command_message)
  582. return false;
  583. #undef DO_
  584. }
  585. void Command_message::SerializeWithCachedSizes(
  586. ::google::protobuf::io::CodedOutputStream* output) const {
  587. // @@protoc_insertion_point(serialize_start:message.Command_message)
  588. ::google::protobuf::uint32 cached_has_bits = 0;
  589. (void) cached_has_bits;
  590. cached_has_bits = _has_bits_[0];
  591. // required .message.Message_type msg_type = 1;
  592. if (cached_has_bits & 0x00000001u) {
  593. ::google::protobuf::internal::WireFormatLite::WriteEnum(
  594. 1, this->msg_type(), output);
  595. }
  596. // required int32 command_id = 2;
  597. if (cached_has_bits & 0x00000002u) {
  598. ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->command_id(), output);
  599. }
  600. // required .message.Action_type act_type = 3;
  601. if (cached_has_bits & 0x00000004u) {
  602. ::google::protobuf::internal::WireFormatLite::WriteEnum(
  603. 3, this->act_type(), output);
  604. }
  605. // required int32 from_id = 4;
  606. if (cached_has_bits & 0x00000008u) {
  607. ::google::protobuf::internal::WireFormatLite::WriteInt32(4, this->from_id(), output);
  608. }
  609. // required int32 destination_id = 5;
  610. if (cached_has_bits & 0x00000010u) {
  611. ::google::protobuf::internal::WireFormatLite::WriteInt32(5, this->destination_id(), output);
  612. }
  613. if (_internal_metadata_.have_unknown_fields()) {
  614. ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
  615. _internal_metadata_.unknown_fields(), output);
  616. }
  617. // @@protoc_insertion_point(serialize_end:message.Command_message)
  618. }
  619. ::google::protobuf::uint8* Command_message::InternalSerializeWithCachedSizesToArray(
  620. bool deterministic, ::google::protobuf::uint8* target) const {
  621. (void)deterministic; // Unused
  622. // @@protoc_insertion_point(serialize_to_array_start:message.Command_message)
  623. ::google::protobuf::uint32 cached_has_bits = 0;
  624. (void) cached_has_bits;
  625. cached_has_bits = _has_bits_[0];
  626. // required .message.Message_type msg_type = 1;
  627. if (cached_has_bits & 0x00000001u) {
  628. target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
  629. 1, this->msg_type(), target);
  630. }
  631. // required int32 command_id = 2;
  632. if (cached_has_bits & 0x00000002u) {
  633. target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->command_id(), target);
  634. }
  635. // required .message.Action_type act_type = 3;
  636. if (cached_has_bits & 0x00000004u) {
  637. target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
  638. 3, this->act_type(), target);
  639. }
  640. // required int32 from_id = 4;
  641. if (cached_has_bits & 0x00000008u) {
  642. target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(4, this->from_id(), target);
  643. }
  644. // required int32 destination_id = 5;
  645. if (cached_has_bits & 0x00000010u) {
  646. target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(5, this->destination_id(), target);
  647. }
  648. if (_internal_metadata_.have_unknown_fields()) {
  649. target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
  650. _internal_metadata_.unknown_fields(), target);
  651. }
  652. // @@protoc_insertion_point(serialize_to_array_end:message.Command_message)
  653. return target;
  654. }
  655. size_t Command_message::RequiredFieldsByteSizeFallback() const {
  656. // @@protoc_insertion_point(required_fields_byte_size_fallback_start:message.Command_message)
  657. size_t total_size = 0;
  658. if (has_msg_type()) {
  659. // required .message.Message_type msg_type = 1;
  660. total_size += 1 +
  661. ::google::protobuf::internal::WireFormatLite::EnumSize(this->msg_type());
  662. }
  663. if (has_command_id()) {
  664. // required int32 command_id = 2;
  665. total_size += 1 +
  666. ::google::protobuf::internal::WireFormatLite::Int32Size(
  667. this->command_id());
  668. }
  669. if (has_act_type()) {
  670. // required .message.Action_type act_type = 3;
  671. total_size += 1 +
  672. ::google::protobuf::internal::WireFormatLite::EnumSize(this->act_type());
  673. }
  674. if (has_from_id()) {
  675. // required int32 from_id = 4;
  676. total_size += 1 +
  677. ::google::protobuf::internal::WireFormatLite::Int32Size(
  678. this->from_id());
  679. }
  680. if (has_destination_id()) {
  681. // required int32 destination_id = 5;
  682. total_size += 1 +
  683. ::google::protobuf::internal::WireFormatLite::Int32Size(
  684. this->destination_id());
  685. }
  686. return total_size;
  687. }
  688. size_t Command_message::ByteSizeLong() const {
  689. // @@protoc_insertion_point(message_byte_size_start:message.Command_message)
  690. size_t total_size = 0;
  691. if (_internal_metadata_.have_unknown_fields()) {
  692. total_size +=
  693. ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
  694. _internal_metadata_.unknown_fields());
  695. }
  696. if (((_has_bits_[0] & 0x0000001f) ^ 0x0000001f) == 0) { // All required fields are present.
  697. // required .message.Message_type msg_type = 1;
  698. total_size += 1 +
  699. ::google::protobuf::internal::WireFormatLite::EnumSize(this->msg_type());
  700. // required int32 command_id = 2;
  701. total_size += 1 +
  702. ::google::protobuf::internal::WireFormatLite::Int32Size(
  703. this->command_id());
  704. // required .message.Action_type act_type = 3;
  705. total_size += 1 +
  706. ::google::protobuf::internal::WireFormatLite::EnumSize(this->act_type());
  707. // required int32 from_id = 4;
  708. total_size += 1 +
  709. ::google::protobuf::internal::WireFormatLite::Int32Size(
  710. this->from_id());
  711. // required int32 destination_id = 5;
  712. total_size += 1 +
  713. ::google::protobuf::internal::WireFormatLite::Int32Size(
  714. this->destination_id());
  715. } else {
  716. total_size += RequiredFieldsByteSizeFallback();
  717. }
  718. int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
  719. GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  720. _cached_size_ = cached_size;
  721. GOOGLE_SAFE_CONCURRENT_WRITES_END();
  722. return total_size;
  723. }
  724. void Command_message::MergeFrom(const ::google::protobuf::Message& from) {
  725. // @@protoc_insertion_point(generalized_merge_from_start:message.Command_message)
  726. GOOGLE_DCHECK_NE(&from, this);
  727. const Command_message* source =
  728. ::google::protobuf::internal::DynamicCastToGenerated<const Command_message>(
  729. &from);
  730. if (source == NULL) {
  731. // @@protoc_insertion_point(generalized_merge_from_cast_fail:message.Command_message)
  732. ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  733. } else {
  734. // @@protoc_insertion_point(generalized_merge_from_cast_success:message.Command_message)
  735. MergeFrom(*source);
  736. }
  737. }
  738. void Command_message::MergeFrom(const Command_message& from) {
  739. // @@protoc_insertion_point(class_specific_merge_from_start:message.Command_message)
  740. GOOGLE_DCHECK_NE(&from, this);
  741. _internal_metadata_.MergeFrom(from._internal_metadata_);
  742. ::google::protobuf::uint32 cached_has_bits = 0;
  743. (void) cached_has_bits;
  744. cached_has_bits = from._has_bits_[0];
  745. if (cached_has_bits & 31u) {
  746. if (cached_has_bits & 0x00000001u) {
  747. msg_type_ = from.msg_type_;
  748. }
  749. if (cached_has_bits & 0x00000002u) {
  750. command_id_ = from.command_id_;
  751. }
  752. if (cached_has_bits & 0x00000004u) {
  753. act_type_ = from.act_type_;
  754. }
  755. if (cached_has_bits & 0x00000008u) {
  756. from_id_ = from.from_id_;
  757. }
  758. if (cached_has_bits & 0x00000010u) {
  759. destination_id_ = from.destination_id_;
  760. }
  761. _has_bits_[0] |= cached_has_bits;
  762. }
  763. }
  764. void Command_message::CopyFrom(const ::google::protobuf::Message& from) {
  765. // @@protoc_insertion_point(generalized_copy_from_start:message.Command_message)
  766. if (&from == this) return;
  767. Clear();
  768. MergeFrom(from);
  769. }
  770. void Command_message::CopyFrom(const Command_message& from) {
  771. // @@protoc_insertion_point(class_specific_copy_from_start:message.Command_message)
  772. if (&from == this) return;
  773. Clear();
  774. MergeFrom(from);
  775. }
  776. bool Command_message::IsInitialized() const {
  777. if ((_has_bits_[0] & 0x0000001f) != 0x0000001f) return false;
  778. return true;
  779. }
  780. void Command_message::Swap(Command_message* other) {
  781. if (other == this) return;
  782. InternalSwap(other);
  783. }
  784. void Command_message::InternalSwap(Command_message* other) {
  785. using std::swap;
  786. swap(msg_type_, other->msg_type_);
  787. swap(command_id_, other->command_id_);
  788. swap(act_type_, other->act_type_);
  789. swap(from_id_, other->from_id_);
  790. swap(destination_id_, other->destination_id_);
  791. swap(_has_bits_[0], other->_has_bits_[0]);
  792. _internal_metadata_.Swap(&other->_internal_metadata_);
  793. swap(_cached_size_, other->_cached_size_);
  794. }
  795. ::google::protobuf::Metadata Command_message::GetMetadata() const {
  796. protobuf_message_5fbase_2eproto::protobuf_AssignDescriptorsOnce();
  797. return ::protobuf_message_5fbase_2eproto::file_level_metadata[kIndexInFileMessages];
  798. }
  799. // @@protoc_insertion_point(namespace_scope)
  800. } // namespace message
  801. // @@protoc_insertion_point(global_scope)