laser_message.pb.cc 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518
  1. // Generated by the protocol buffer compiler. DO NOT EDIT!
  2. // source: laser_message.proto
  3. #include "laser_message.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 laser_message {
  20. class laserMsgDefaultTypeInternal {
  21. public:
  22. ::google::protobuf::internal::ExplicitlyConstructed<laserMsg>
  23. _instance;
  24. } _laserMsg_default_instance_;
  25. } // namespace laser_message
  26. namespace protobuf_laser_5fmessage_2eproto {
  27. void InitDefaultslaserMsgImpl() {
  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 = &::laser_message::_laserMsg_default_instance_;
  36. new (ptr) ::laser_message::laserMsg();
  37. ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
  38. }
  39. ::laser_message::laserMsg::InitAsDefaultInstance();
  40. }
  41. void InitDefaultslaserMsg() {
  42. static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
  43. ::google::protobuf::GoogleOnceInit(&once, &InitDefaultslaserMsgImpl);
  44. }
  45. ::google::protobuf::Metadata file_level_metadata[1];
  46. const ::google::protobuf::EnumDescriptor* file_level_enum_descriptors[1];
  47. const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
  48. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::laser_message::laserMsg, _has_bits_),
  49. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::laser_message::laserMsg, _internal_metadata_),
  50. ~0u, // no _extensions_
  51. ~0u, // no _oneof_case_
  52. ~0u, // no _weak_field_map_
  53. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::laser_message::laserMsg, laser_status_),
  54. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::laser_message::laserMsg, queue_data_count_),
  55. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::laser_message::laserMsg, cloud_count_),
  56. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::laser_message::laserMsg, id_),
  57. 0,
  58. 1,
  59. 2,
  60. 3,
  61. };
  62. static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
  63. { 0, 9, sizeof(::laser_message::laserMsg)},
  64. };
  65. static ::google::protobuf::Message const * const file_default_instances[] = {
  66. reinterpret_cast<const ::google::protobuf::Message*>(&::laser_message::_laserMsg_default_instance_),
  67. };
  68. void protobuf_AssignDescriptors() {
  69. AddDescriptors();
  70. ::google::protobuf::MessageFactory* factory = NULL;
  71. AssignDescriptors(
  72. "laser_message.proto", schemas, file_default_instances, TableStruct::offsets, factory,
  73. file_level_metadata, file_level_enum_descriptors, NULL);
  74. }
  75. void protobuf_AssignDescriptorsOnce() {
  76. static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
  77. ::google::protobuf::GoogleOnceInit(&once, &protobuf_AssignDescriptors);
  78. }
  79. void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD;
  80. void protobuf_RegisterTypes(const ::std::string&) {
  81. protobuf_AssignDescriptorsOnce();
  82. ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 1);
  83. }
  84. void AddDescriptorsImpl() {
  85. InitDefaults();
  86. static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
  87. "\n\023laser_message.proto\022\rlaser_message\"w\n\010"
  88. "laserMsg\0220\n\014laser_status\030\001 \001(\0162\032.laser_m"
  89. "essage.laserStatus\022\030\n\020queue_data_count\030\002"
  90. " \001(\005\022\023\n\013cloud_count\030\003 \001(\005\022\n\n\002id\030\004 \002(\005*]\n"
  91. "\013laserStatus\022\023\n\017eLaserConnected\020\000\022\026\n\022eLa"
  92. "serDisconnected\020\001\022\016\n\neLaserBusy\020\002\022\021\n\reLa"
  93. "serUnknown\020\003"
  94. };
  95. ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
  96. descriptor, 252);
  97. ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
  98. "laser_message.proto", &protobuf_RegisterTypes);
  99. }
  100. void AddDescriptors() {
  101. static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
  102. ::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl);
  103. }
  104. // Force AddDescriptors() to be called at dynamic initialization time.
  105. struct StaticDescriptorInitializer {
  106. StaticDescriptorInitializer() {
  107. AddDescriptors();
  108. }
  109. } static_descriptor_initializer;
  110. } // namespace protobuf_laser_5fmessage_2eproto
  111. namespace laser_message {
  112. const ::google::protobuf::EnumDescriptor* laserStatus_descriptor() {
  113. protobuf_laser_5fmessage_2eproto::protobuf_AssignDescriptorsOnce();
  114. return protobuf_laser_5fmessage_2eproto::file_level_enum_descriptors[0];
  115. }
  116. bool laserStatus_IsValid(int value) {
  117. switch (value) {
  118. case 0:
  119. case 1:
  120. case 2:
  121. case 3:
  122. return true;
  123. default:
  124. return false;
  125. }
  126. }
  127. // ===================================================================
  128. void laserMsg::InitAsDefaultInstance() {
  129. }
  130. #if !defined(_MSC_VER) || _MSC_VER >= 1900
  131. const int laserMsg::kLaserStatusFieldNumber;
  132. const int laserMsg::kQueueDataCountFieldNumber;
  133. const int laserMsg::kCloudCountFieldNumber;
  134. const int laserMsg::kIdFieldNumber;
  135. #endif // !defined(_MSC_VER) || _MSC_VER >= 1900
  136. laserMsg::laserMsg()
  137. : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  138. if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
  139. ::protobuf_laser_5fmessage_2eproto::InitDefaultslaserMsg();
  140. }
  141. SharedCtor();
  142. // @@protoc_insertion_point(constructor:laser_message.laserMsg)
  143. }
  144. laserMsg::laserMsg(const laserMsg& from)
  145. : ::google::protobuf::Message(),
  146. _internal_metadata_(NULL),
  147. _has_bits_(from._has_bits_),
  148. _cached_size_(0) {
  149. _internal_metadata_.MergeFrom(from._internal_metadata_);
  150. ::memcpy(&laser_status_, &from.laser_status_,
  151. static_cast<size_t>(reinterpret_cast<char*>(&id_) -
  152. reinterpret_cast<char*>(&laser_status_)) + sizeof(id_));
  153. // @@protoc_insertion_point(copy_constructor:laser_message.laserMsg)
  154. }
  155. void laserMsg::SharedCtor() {
  156. _cached_size_ = 0;
  157. ::memset(&laser_status_, 0, static_cast<size_t>(
  158. reinterpret_cast<char*>(&id_) -
  159. reinterpret_cast<char*>(&laser_status_)) + sizeof(id_));
  160. }
  161. laserMsg::~laserMsg() {
  162. // @@protoc_insertion_point(destructor:laser_message.laserMsg)
  163. SharedDtor();
  164. }
  165. void laserMsg::SharedDtor() {
  166. }
  167. void laserMsg::SetCachedSize(int size) const {
  168. GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  169. _cached_size_ = size;
  170. GOOGLE_SAFE_CONCURRENT_WRITES_END();
  171. }
  172. const ::google::protobuf::Descriptor* laserMsg::descriptor() {
  173. ::protobuf_laser_5fmessage_2eproto::protobuf_AssignDescriptorsOnce();
  174. return ::protobuf_laser_5fmessage_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
  175. }
  176. const laserMsg& laserMsg::default_instance() {
  177. ::protobuf_laser_5fmessage_2eproto::InitDefaultslaserMsg();
  178. return *internal_default_instance();
  179. }
  180. laserMsg* laserMsg::New(::google::protobuf::Arena* arena) const {
  181. laserMsg* n = new laserMsg;
  182. if (arena != NULL) {
  183. arena->Own(n);
  184. }
  185. return n;
  186. }
  187. void laserMsg::Clear() {
  188. // @@protoc_insertion_point(message_clear_start:laser_message.laserMsg)
  189. ::google::protobuf::uint32 cached_has_bits = 0;
  190. // Prevent compiler warnings about cached_has_bits being unused
  191. (void) cached_has_bits;
  192. cached_has_bits = _has_bits_[0];
  193. if (cached_has_bits & 15u) {
  194. ::memset(&laser_status_, 0, static_cast<size_t>(
  195. reinterpret_cast<char*>(&id_) -
  196. reinterpret_cast<char*>(&laser_status_)) + sizeof(id_));
  197. }
  198. _has_bits_.Clear();
  199. _internal_metadata_.Clear();
  200. }
  201. bool laserMsg::MergePartialFromCodedStream(
  202. ::google::protobuf::io::CodedInputStream* input) {
  203. #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  204. ::google::protobuf::uint32 tag;
  205. // @@protoc_insertion_point(parse_start:laser_message.laserMsg)
  206. for (;;) {
  207. ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
  208. tag = p.first;
  209. if (!p.second) goto handle_unusual;
  210. switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
  211. // optional .laser_message.laserStatus laser_status = 1;
  212. case 1: {
  213. if (static_cast< ::google::protobuf::uint8>(tag) ==
  214. static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
  215. int value;
  216. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  217. int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
  218. input, &value)));
  219. if (::laser_message::laserStatus_IsValid(value)) {
  220. set_laser_status(static_cast< ::laser_message::laserStatus >(value));
  221. } else {
  222. mutable_unknown_fields()->AddVarint(
  223. 1, static_cast< ::google::protobuf::uint64>(value));
  224. }
  225. } else {
  226. goto handle_unusual;
  227. }
  228. break;
  229. }
  230. // optional int32 queue_data_count = 2;
  231. case 2: {
  232. if (static_cast< ::google::protobuf::uint8>(tag) ==
  233. static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) {
  234. set_has_queue_data_count();
  235. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  236. ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
  237. input, &queue_data_count_)));
  238. } else {
  239. goto handle_unusual;
  240. }
  241. break;
  242. }
  243. // optional int32 cloud_count = 3;
  244. case 3: {
  245. if (static_cast< ::google::protobuf::uint8>(tag) ==
  246. static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) {
  247. set_has_cloud_count();
  248. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  249. ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
  250. input, &cloud_count_)));
  251. } else {
  252. goto handle_unusual;
  253. }
  254. break;
  255. }
  256. // required int32 id = 4;
  257. case 4: {
  258. if (static_cast< ::google::protobuf::uint8>(tag) ==
  259. static_cast< ::google::protobuf::uint8>(32u /* 32 & 0xFF */)) {
  260. set_has_id();
  261. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  262. ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
  263. input, &id_)));
  264. } else {
  265. goto handle_unusual;
  266. }
  267. break;
  268. }
  269. default: {
  270. handle_unusual:
  271. if (tag == 0) {
  272. goto success;
  273. }
  274. DO_(::google::protobuf::internal::WireFormat::SkipField(
  275. input, tag, _internal_metadata_.mutable_unknown_fields()));
  276. break;
  277. }
  278. }
  279. }
  280. success:
  281. // @@protoc_insertion_point(parse_success:laser_message.laserMsg)
  282. return true;
  283. failure:
  284. // @@protoc_insertion_point(parse_failure:laser_message.laserMsg)
  285. return false;
  286. #undef DO_
  287. }
  288. void laserMsg::SerializeWithCachedSizes(
  289. ::google::protobuf::io::CodedOutputStream* output) const {
  290. // @@protoc_insertion_point(serialize_start:laser_message.laserMsg)
  291. ::google::protobuf::uint32 cached_has_bits = 0;
  292. (void) cached_has_bits;
  293. cached_has_bits = _has_bits_[0];
  294. // optional .laser_message.laserStatus laser_status = 1;
  295. if (cached_has_bits & 0x00000001u) {
  296. ::google::protobuf::internal::WireFormatLite::WriteEnum(
  297. 1, this->laser_status(), output);
  298. }
  299. // optional int32 queue_data_count = 2;
  300. if (cached_has_bits & 0x00000002u) {
  301. ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->queue_data_count(), output);
  302. }
  303. // optional int32 cloud_count = 3;
  304. if (cached_has_bits & 0x00000004u) {
  305. ::google::protobuf::internal::WireFormatLite::WriteInt32(3, this->cloud_count(), output);
  306. }
  307. // required int32 id = 4;
  308. if (cached_has_bits & 0x00000008u) {
  309. ::google::protobuf::internal::WireFormatLite::WriteInt32(4, this->id(), output);
  310. }
  311. if (_internal_metadata_.have_unknown_fields()) {
  312. ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
  313. _internal_metadata_.unknown_fields(), output);
  314. }
  315. // @@protoc_insertion_point(serialize_end:laser_message.laserMsg)
  316. }
  317. ::google::protobuf::uint8* laserMsg::InternalSerializeWithCachedSizesToArray(
  318. bool deterministic, ::google::protobuf::uint8* target) const {
  319. (void)deterministic; // Unused
  320. // @@protoc_insertion_point(serialize_to_array_start:laser_message.laserMsg)
  321. ::google::protobuf::uint32 cached_has_bits = 0;
  322. (void) cached_has_bits;
  323. cached_has_bits = _has_bits_[0];
  324. // optional .laser_message.laserStatus laser_status = 1;
  325. if (cached_has_bits & 0x00000001u) {
  326. target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
  327. 1, this->laser_status(), target);
  328. }
  329. // optional int32 queue_data_count = 2;
  330. if (cached_has_bits & 0x00000002u) {
  331. target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->queue_data_count(), target);
  332. }
  333. // optional int32 cloud_count = 3;
  334. if (cached_has_bits & 0x00000004u) {
  335. target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(3, this->cloud_count(), target);
  336. }
  337. // required int32 id = 4;
  338. if (cached_has_bits & 0x00000008u) {
  339. target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(4, this->id(), target);
  340. }
  341. if (_internal_metadata_.have_unknown_fields()) {
  342. target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
  343. _internal_metadata_.unknown_fields(), target);
  344. }
  345. // @@protoc_insertion_point(serialize_to_array_end:laser_message.laserMsg)
  346. return target;
  347. }
  348. size_t laserMsg::ByteSizeLong() const {
  349. // @@protoc_insertion_point(message_byte_size_start:laser_message.laserMsg)
  350. size_t total_size = 0;
  351. if (_internal_metadata_.have_unknown_fields()) {
  352. total_size +=
  353. ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
  354. _internal_metadata_.unknown_fields());
  355. }
  356. // required int32 id = 4;
  357. if (has_id()) {
  358. total_size += 1 +
  359. ::google::protobuf::internal::WireFormatLite::Int32Size(
  360. this->id());
  361. }
  362. if (_has_bits_[0 / 32] & 7u) {
  363. // optional .laser_message.laserStatus laser_status = 1;
  364. if (has_laser_status()) {
  365. total_size += 1 +
  366. ::google::protobuf::internal::WireFormatLite::EnumSize(this->laser_status());
  367. }
  368. // optional int32 queue_data_count = 2;
  369. if (has_queue_data_count()) {
  370. total_size += 1 +
  371. ::google::protobuf::internal::WireFormatLite::Int32Size(
  372. this->queue_data_count());
  373. }
  374. // optional int32 cloud_count = 3;
  375. if (has_cloud_count()) {
  376. total_size += 1 +
  377. ::google::protobuf::internal::WireFormatLite::Int32Size(
  378. this->cloud_count());
  379. }
  380. }
  381. int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
  382. GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  383. _cached_size_ = cached_size;
  384. GOOGLE_SAFE_CONCURRENT_WRITES_END();
  385. return total_size;
  386. }
  387. void laserMsg::MergeFrom(const ::google::protobuf::Message& from) {
  388. // @@protoc_insertion_point(generalized_merge_from_start:laser_message.laserMsg)
  389. GOOGLE_DCHECK_NE(&from, this);
  390. const laserMsg* source =
  391. ::google::protobuf::internal::DynamicCastToGenerated<const laserMsg>(
  392. &from);
  393. if (source == NULL) {
  394. // @@protoc_insertion_point(generalized_merge_from_cast_fail:laser_message.laserMsg)
  395. ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  396. } else {
  397. // @@protoc_insertion_point(generalized_merge_from_cast_success:laser_message.laserMsg)
  398. MergeFrom(*source);
  399. }
  400. }
  401. void laserMsg::MergeFrom(const laserMsg& from) {
  402. // @@protoc_insertion_point(class_specific_merge_from_start:laser_message.laserMsg)
  403. GOOGLE_DCHECK_NE(&from, this);
  404. _internal_metadata_.MergeFrom(from._internal_metadata_);
  405. ::google::protobuf::uint32 cached_has_bits = 0;
  406. (void) cached_has_bits;
  407. cached_has_bits = from._has_bits_[0];
  408. if (cached_has_bits & 15u) {
  409. if (cached_has_bits & 0x00000001u) {
  410. laser_status_ = from.laser_status_;
  411. }
  412. if (cached_has_bits & 0x00000002u) {
  413. queue_data_count_ = from.queue_data_count_;
  414. }
  415. if (cached_has_bits & 0x00000004u) {
  416. cloud_count_ = from.cloud_count_;
  417. }
  418. if (cached_has_bits & 0x00000008u) {
  419. id_ = from.id_;
  420. }
  421. _has_bits_[0] |= cached_has_bits;
  422. }
  423. }
  424. void laserMsg::CopyFrom(const ::google::protobuf::Message& from) {
  425. // @@protoc_insertion_point(generalized_copy_from_start:laser_message.laserMsg)
  426. if (&from == this) return;
  427. Clear();
  428. MergeFrom(from);
  429. }
  430. void laserMsg::CopyFrom(const laserMsg& from) {
  431. // @@protoc_insertion_point(class_specific_copy_from_start:laser_message.laserMsg)
  432. if (&from == this) return;
  433. Clear();
  434. MergeFrom(from);
  435. }
  436. bool laserMsg::IsInitialized() const {
  437. if ((_has_bits_[0] & 0x00000008) != 0x00000008) return false;
  438. return true;
  439. }
  440. void laserMsg::Swap(laserMsg* other) {
  441. if (other == this) return;
  442. InternalSwap(other);
  443. }
  444. void laserMsg::InternalSwap(laserMsg* other) {
  445. using std::swap;
  446. swap(laser_status_, other->laser_status_);
  447. swap(queue_data_count_, other->queue_data_count_);
  448. swap(cloud_count_, other->cloud_count_);
  449. swap(id_, other->id_);
  450. swap(_has_bits_[0], other->_has_bits_[0]);
  451. _internal_metadata_.Swap(&other->_internal_metadata_);
  452. swap(_cached_size_, other->_cached_size_);
  453. }
  454. ::google::protobuf::Metadata laserMsg::GetMetadata() const {
  455. protobuf_laser_5fmessage_2eproto::protobuf_AssignDescriptorsOnce();
  456. return ::protobuf_laser_5fmessage_2eproto::file_level_metadata[kIndexInFileMessages];
  457. }
  458. // @@protoc_insertion_point(namespace_scope)
  459. } // namespace laser_message
  460. // @@protoc_insertion_point(global_scope)