plc_module.pb.cc 30 KB

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