plc_message.pb.cc 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432
  1. // Generated by the protocol buffer compiler. DO NOT EDIT!
  2. // source: plc_message.proto
  3. #include "plc_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 plc_message {
  20. class plcMsgDefaultTypeInternal {
  21. public:
  22. ::google::protobuf::internal::ExplicitlyConstructed<plcMsg>
  23. _instance;
  24. } _plcMsg_default_instance_;
  25. } // namespace plc_message
  26. namespace protobuf_plc_5fmessage_2eproto {
  27. void InitDefaultsplcMsgImpl() {
  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 = &::plc_message::_plcMsg_default_instance_;
  36. new (ptr) ::plc_message::plcMsg();
  37. ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
  38. }
  39. ::plc_message::plcMsg::InitAsDefaultInstance();
  40. }
  41. void InitDefaultsplcMsg() {
  42. static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
  43. ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsplcMsgImpl);
  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(::plc_message::plcMsg, _has_bits_),
  49. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::plc_message::plcMsg, _internal_metadata_),
  50. ~0u, // no _extensions_
  51. ~0u, // no _oneof_case_
  52. ~0u, // no _weak_field_map_
  53. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::plc_message::plcMsg, plc_status_),
  54. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::plc_message::plcMsg, plc_values_),
  55. 0,
  56. ~0u,
  57. };
  58. static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
  59. { 0, 7, sizeof(::plc_message::plcMsg)},
  60. };
  61. static ::google::protobuf::Message const * const file_default_instances[] = {
  62. reinterpret_cast<const ::google::protobuf::Message*>(&::plc_message::_plcMsg_default_instance_),
  63. };
  64. void protobuf_AssignDescriptors() {
  65. AddDescriptors();
  66. ::google::protobuf::MessageFactory* factory = NULL;
  67. AssignDescriptors(
  68. "plc_message.proto", schemas, file_default_instances, TableStruct::offsets, factory,
  69. file_level_metadata, file_level_enum_descriptors, NULL);
  70. }
  71. void protobuf_AssignDescriptorsOnce() {
  72. static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
  73. ::google::protobuf::GoogleOnceInit(&once, &protobuf_AssignDescriptors);
  74. }
  75. void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD;
  76. void protobuf_RegisterTypes(const ::std::string&) {
  77. protobuf_AssignDescriptorsOnce();
  78. ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 1);
  79. }
  80. void AddDescriptorsImpl() {
  81. InitDefaults();
  82. static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
  83. "\n\021plc_message.proto\022\013plc_message\"H\n\006plcM"
  84. "sg\022*\n\nplc_status\030\001 \001(\0162\026.plc_message.plc"
  85. "Status\022\022\n\nplc_values\030\002 \003(\005*V\n\tplcStatus\022"
  86. "\021\n\rePLCConnected\020\000\022\024\n\020ePLCDisconnected\020\001"
  87. "\022\017\n\013ePLCRefused\020\002\022\017\n\013ePLCUnknown\020\003"
  88. };
  89. ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
  90. descriptor, 194);
  91. ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
  92. "plc_message.proto", &protobuf_RegisterTypes);
  93. }
  94. void AddDescriptors() {
  95. static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
  96. ::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl);
  97. }
  98. // Force AddDescriptors() to be called at dynamic initialization time.
  99. struct StaticDescriptorInitializer {
  100. StaticDescriptorInitializer() {
  101. AddDescriptors();
  102. }
  103. } static_descriptor_initializer;
  104. } // namespace protobuf_plc_5fmessage_2eproto
  105. namespace plc_message {
  106. const ::google::protobuf::EnumDescriptor* plcStatus_descriptor() {
  107. protobuf_plc_5fmessage_2eproto::protobuf_AssignDescriptorsOnce();
  108. return protobuf_plc_5fmessage_2eproto::file_level_enum_descriptors[0];
  109. }
  110. bool plcStatus_IsValid(int value) {
  111. switch (value) {
  112. case 0:
  113. case 1:
  114. case 2:
  115. case 3:
  116. return true;
  117. default:
  118. return false;
  119. }
  120. }
  121. // ===================================================================
  122. void plcMsg::InitAsDefaultInstance() {
  123. }
  124. #if !defined(_MSC_VER) || _MSC_VER >= 1900
  125. const int plcMsg::kPlcStatusFieldNumber;
  126. const int plcMsg::kPlcValuesFieldNumber;
  127. #endif // !defined(_MSC_VER) || _MSC_VER >= 1900
  128. plcMsg::plcMsg()
  129. : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  130. if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
  131. ::protobuf_plc_5fmessage_2eproto::InitDefaultsplcMsg();
  132. }
  133. SharedCtor();
  134. // @@protoc_insertion_point(constructor:plc_message.plcMsg)
  135. }
  136. plcMsg::plcMsg(const plcMsg& from)
  137. : ::google::protobuf::Message(),
  138. _internal_metadata_(NULL),
  139. _has_bits_(from._has_bits_),
  140. _cached_size_(0),
  141. plc_values_(from.plc_values_) {
  142. _internal_metadata_.MergeFrom(from._internal_metadata_);
  143. plc_status_ = from.plc_status_;
  144. // @@protoc_insertion_point(copy_constructor:plc_message.plcMsg)
  145. }
  146. void plcMsg::SharedCtor() {
  147. _cached_size_ = 0;
  148. plc_status_ = 0;
  149. }
  150. plcMsg::~plcMsg() {
  151. // @@protoc_insertion_point(destructor:plc_message.plcMsg)
  152. SharedDtor();
  153. }
  154. void plcMsg::SharedDtor() {
  155. }
  156. void plcMsg::SetCachedSize(int size) const {
  157. GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  158. _cached_size_ = size;
  159. GOOGLE_SAFE_CONCURRENT_WRITES_END();
  160. }
  161. const ::google::protobuf::Descriptor* plcMsg::descriptor() {
  162. ::protobuf_plc_5fmessage_2eproto::protobuf_AssignDescriptorsOnce();
  163. return ::protobuf_plc_5fmessage_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
  164. }
  165. const plcMsg& plcMsg::default_instance() {
  166. ::protobuf_plc_5fmessage_2eproto::InitDefaultsplcMsg();
  167. return *internal_default_instance();
  168. }
  169. plcMsg* plcMsg::New(::google::protobuf::Arena* arena) const {
  170. plcMsg* n = new plcMsg;
  171. if (arena != NULL) {
  172. arena->Own(n);
  173. }
  174. return n;
  175. }
  176. void plcMsg::Clear() {
  177. // @@protoc_insertion_point(message_clear_start:plc_message.plcMsg)
  178. ::google::protobuf::uint32 cached_has_bits = 0;
  179. // Prevent compiler warnings about cached_has_bits being unused
  180. (void) cached_has_bits;
  181. plc_values_.Clear();
  182. plc_status_ = 0;
  183. _has_bits_.Clear();
  184. _internal_metadata_.Clear();
  185. }
  186. bool plcMsg::MergePartialFromCodedStream(
  187. ::google::protobuf::io::CodedInputStream* input) {
  188. #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  189. ::google::protobuf::uint32 tag;
  190. // @@protoc_insertion_point(parse_start:plc_message.plcMsg)
  191. for (;;) {
  192. ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
  193. tag = p.first;
  194. if (!p.second) goto handle_unusual;
  195. switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
  196. // optional .plc_message.plcStatus plc_status = 1;
  197. case 1: {
  198. if (static_cast< ::google::protobuf::uint8>(tag) ==
  199. static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
  200. int value;
  201. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  202. int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
  203. input, &value)));
  204. if (::plc_message::plcStatus_IsValid(value)) {
  205. set_plc_status(static_cast< ::plc_message::plcStatus >(value));
  206. } else {
  207. mutable_unknown_fields()->AddVarint(
  208. 1, static_cast< ::google::protobuf::uint64>(value));
  209. }
  210. } else {
  211. goto handle_unusual;
  212. }
  213. break;
  214. }
  215. // repeated int32 plc_values = 2;
  216. case 2: {
  217. if (static_cast< ::google::protobuf::uint8>(tag) ==
  218. static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) {
  219. DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
  220. ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
  221. 1, 16u, input, this->mutable_plc_values())));
  222. } else if (
  223. static_cast< ::google::protobuf::uint8>(tag) ==
  224. static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
  225. DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
  226. ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
  227. input, this->mutable_plc_values())));
  228. } else {
  229. goto handle_unusual;
  230. }
  231. break;
  232. }
  233. default: {
  234. handle_unusual:
  235. if (tag == 0) {
  236. goto success;
  237. }
  238. DO_(::google::protobuf::internal::WireFormat::SkipField(
  239. input, tag, _internal_metadata_.mutable_unknown_fields()));
  240. break;
  241. }
  242. }
  243. }
  244. success:
  245. // @@protoc_insertion_point(parse_success:plc_message.plcMsg)
  246. return true;
  247. failure:
  248. // @@protoc_insertion_point(parse_failure:plc_message.plcMsg)
  249. return false;
  250. #undef DO_
  251. }
  252. void plcMsg::SerializeWithCachedSizes(
  253. ::google::protobuf::io::CodedOutputStream* output) const {
  254. // @@protoc_insertion_point(serialize_start:plc_message.plcMsg)
  255. ::google::protobuf::uint32 cached_has_bits = 0;
  256. (void) cached_has_bits;
  257. cached_has_bits = _has_bits_[0];
  258. // optional .plc_message.plcStatus plc_status = 1;
  259. if (cached_has_bits & 0x00000001u) {
  260. ::google::protobuf::internal::WireFormatLite::WriteEnum(
  261. 1, this->plc_status(), output);
  262. }
  263. // repeated int32 plc_values = 2;
  264. for (int i = 0, n = this->plc_values_size(); i < n; i++) {
  265. ::google::protobuf::internal::WireFormatLite::WriteInt32(
  266. 2, this->plc_values(i), output);
  267. }
  268. if (_internal_metadata_.have_unknown_fields()) {
  269. ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
  270. _internal_metadata_.unknown_fields(), output);
  271. }
  272. // @@protoc_insertion_point(serialize_end:plc_message.plcMsg)
  273. }
  274. ::google::protobuf::uint8* plcMsg::InternalSerializeWithCachedSizesToArray(
  275. bool deterministic, ::google::protobuf::uint8* target) const {
  276. (void)deterministic; // Unused
  277. // @@protoc_insertion_point(serialize_to_array_start:plc_message.plcMsg)
  278. ::google::protobuf::uint32 cached_has_bits = 0;
  279. (void) cached_has_bits;
  280. cached_has_bits = _has_bits_[0];
  281. // optional .plc_message.plcStatus plc_status = 1;
  282. if (cached_has_bits & 0x00000001u) {
  283. target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
  284. 1, this->plc_status(), target);
  285. }
  286. // repeated int32 plc_values = 2;
  287. target = ::google::protobuf::internal::WireFormatLite::
  288. WriteInt32ToArray(2, this->plc_values_, target);
  289. if (_internal_metadata_.have_unknown_fields()) {
  290. target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
  291. _internal_metadata_.unknown_fields(), target);
  292. }
  293. // @@protoc_insertion_point(serialize_to_array_end:plc_message.plcMsg)
  294. return target;
  295. }
  296. size_t plcMsg::ByteSizeLong() const {
  297. // @@protoc_insertion_point(message_byte_size_start:plc_message.plcMsg)
  298. size_t total_size = 0;
  299. if (_internal_metadata_.have_unknown_fields()) {
  300. total_size +=
  301. ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
  302. _internal_metadata_.unknown_fields());
  303. }
  304. // repeated int32 plc_values = 2;
  305. {
  306. size_t data_size = ::google::protobuf::internal::WireFormatLite::
  307. Int32Size(this->plc_values_);
  308. total_size += 1 *
  309. ::google::protobuf::internal::FromIntSize(this->plc_values_size());
  310. total_size += data_size;
  311. }
  312. // optional .plc_message.plcStatus plc_status = 1;
  313. if (has_plc_status()) {
  314. total_size += 1 +
  315. ::google::protobuf::internal::WireFormatLite::EnumSize(this->plc_status());
  316. }
  317. int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
  318. GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  319. _cached_size_ = cached_size;
  320. GOOGLE_SAFE_CONCURRENT_WRITES_END();
  321. return total_size;
  322. }
  323. void plcMsg::MergeFrom(const ::google::protobuf::Message& from) {
  324. // @@protoc_insertion_point(generalized_merge_from_start:plc_message.plcMsg)
  325. GOOGLE_DCHECK_NE(&from, this);
  326. const plcMsg* source =
  327. ::google::protobuf::internal::DynamicCastToGenerated<const plcMsg>(
  328. &from);
  329. if (source == NULL) {
  330. // @@protoc_insertion_point(generalized_merge_from_cast_fail:plc_message.plcMsg)
  331. ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  332. } else {
  333. // @@protoc_insertion_point(generalized_merge_from_cast_success:plc_message.plcMsg)
  334. MergeFrom(*source);
  335. }
  336. }
  337. void plcMsg::MergeFrom(const plcMsg& from) {
  338. // @@protoc_insertion_point(class_specific_merge_from_start:plc_message.plcMsg)
  339. GOOGLE_DCHECK_NE(&from, this);
  340. _internal_metadata_.MergeFrom(from._internal_metadata_);
  341. ::google::protobuf::uint32 cached_has_bits = 0;
  342. (void) cached_has_bits;
  343. plc_values_.MergeFrom(from.plc_values_);
  344. if (from.has_plc_status()) {
  345. set_plc_status(from.plc_status());
  346. }
  347. }
  348. void plcMsg::CopyFrom(const ::google::protobuf::Message& from) {
  349. // @@protoc_insertion_point(generalized_copy_from_start:plc_message.plcMsg)
  350. if (&from == this) return;
  351. Clear();
  352. MergeFrom(from);
  353. }
  354. void plcMsg::CopyFrom(const plcMsg& from) {
  355. // @@protoc_insertion_point(class_specific_copy_from_start:plc_message.plcMsg)
  356. if (&from == this) return;
  357. Clear();
  358. MergeFrom(from);
  359. }
  360. bool plcMsg::IsInitialized() const {
  361. return true;
  362. }
  363. void plcMsg::Swap(plcMsg* other) {
  364. if (other == this) return;
  365. InternalSwap(other);
  366. }
  367. void plcMsg::InternalSwap(plcMsg* other) {
  368. using std::swap;
  369. plc_values_.InternalSwap(&other->plc_values_);
  370. swap(plc_status_, other->plc_status_);
  371. swap(_has_bits_[0], other->_has_bits_[0]);
  372. _internal_metadata_.Swap(&other->_internal_metadata_);
  373. swap(_cached_size_, other->_cached_size_);
  374. }
  375. ::google::protobuf::Metadata plcMsg::GetMetadata() const {
  376. protobuf_plc_5fmessage_2eproto::protobuf_AssignDescriptorsOnce();
  377. return ::protobuf_plc_5fmessage_2eproto::file_level_metadata[kIndexInFileMessages];
  378. }
  379. // @@protoc_insertion_point(namespace_scope)
  380. } // namespace plc_message
  381. // @@protoc_insertion_point(global_scope)