unittest_no_generic_services.pb.cc 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405
  1. // Generated by the protocol buffer compiler. DO NOT EDIT!
  2. // source: google/protobuf/unittest_no_generic_services.proto
  3. #include <google/protobuf/unittest_no_generic_services.pb.h>
  4. #include <algorithm>
  5. #include <google/protobuf/stubs/common.h>
  6. #include <google/protobuf/stubs/port.h>
  7. #include <google/protobuf/io/coded_stream.h>
  8. #include <google/protobuf/wire_format_lite_inl.h>
  9. #include <google/protobuf/descriptor.h>
  10. #include <google/protobuf/generated_message_reflection.h>
  11. #include <google/protobuf/reflection_ops.h>
  12. #include <google/protobuf/wire_format.h>
  13. // This is a temporary google only hack
  14. #ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
  15. #include "third_party/protobuf/version.h"
  16. #endif
  17. // @@protoc_insertion_point(includes)
  18. namespace google {
  19. namespace protobuf {
  20. namespace no_generic_services_test {
  21. class TestMessageDefaultTypeInternal {
  22. public:
  23. ::google::protobuf::internal::ExplicitlyConstructed<TestMessage>
  24. _instance;
  25. } _TestMessage_default_instance_;
  26. } // namespace no_generic_services_test
  27. } // namespace protobuf
  28. } // namespace google
  29. namespace protobuf_google_2fprotobuf_2funittest_5fno_5fgeneric_5fservices_2eproto {
  30. static void InitDefaultsTestMessage() {
  31. GOOGLE_PROTOBUF_VERIFY_VERSION;
  32. {
  33. void* ptr = &::google::protobuf::no_generic_services_test::_TestMessage_default_instance_;
  34. new (ptr) ::google::protobuf::no_generic_services_test::TestMessage();
  35. ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
  36. }
  37. ::google::protobuf::no_generic_services_test::TestMessage::InitAsDefaultInstance();
  38. }
  39. ::google::protobuf::internal::SCCInfo<0> scc_info_TestMessage =
  40. {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsTestMessage}, {}};
  41. void InitDefaults() {
  42. ::google::protobuf::internal::InitSCC(&scc_info_TestMessage.base);
  43. }
  44. ::google::protobuf::Metadata file_level_metadata[1];
  45. const ::google::protobuf::EnumDescriptor* file_level_enum_descriptors[1];
  46. const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
  47. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::no_generic_services_test::TestMessage, _has_bits_),
  48. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::no_generic_services_test::TestMessage, _internal_metadata_),
  49. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::no_generic_services_test::TestMessage, _extensions_),
  50. ~0u, // no _oneof_case_
  51. ~0u, // no _weak_field_map_
  52. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::no_generic_services_test::TestMessage, a_),
  53. 0,
  54. };
  55. static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
  56. { 0, 6, sizeof(::google::protobuf::no_generic_services_test::TestMessage)},
  57. };
  58. static ::google::protobuf::Message const * const file_default_instances[] = {
  59. reinterpret_cast<const ::google::protobuf::Message*>(&::google::protobuf::no_generic_services_test::_TestMessage_default_instance_),
  60. };
  61. void protobuf_AssignDescriptors() {
  62. AddDescriptors();
  63. AssignDescriptors(
  64. "google/protobuf/unittest_no_generic_services.proto", schemas, file_default_instances, TableStruct::offsets,
  65. file_level_metadata, file_level_enum_descriptors, NULL);
  66. }
  67. void protobuf_AssignDescriptorsOnce() {
  68. static ::google::protobuf::internal::once_flag once;
  69. ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors);
  70. }
  71. void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD;
  72. void protobuf_RegisterTypes(const ::std::string&) {
  73. protobuf_AssignDescriptorsOnce();
  74. ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 1);
  75. }
  76. void AddDescriptorsImpl() {
  77. InitDefaults();
  78. static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
  79. "\n2google/protobuf/unittest_no_generic_se"
  80. "rvices.proto\022(google.protobuf.no_generic"
  81. "_services_test\"#\n\013TestMessage\022\t\n\001a\030\001 \001(\005"
  82. "*\t\010\350\007\020\200\200\200\200\002*\023\n\010TestEnum\022\007\n\003FOO\020\0012\202\001\n\013Tes"
  83. "tService\022s\n\003Foo\0225.google.protobuf.no_gen"
  84. "eric_services_test.TestMessage\0325.google."
  85. "protobuf.no_generic_services_test.TestMe"
  86. "ssage:N\n\016test_extension\0225.google.protobu"
  87. "f.no_generic_services_test.TestMessage\030\350"
  88. "\007 \001(\005"
  89. };
  90. ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
  91. descriptor, 365);
  92. ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
  93. "google/protobuf/unittest_no_generic_services.proto", &protobuf_RegisterTypes);
  94. }
  95. void AddDescriptors() {
  96. static ::google::protobuf::internal::once_flag once;
  97. ::google::protobuf::internal::call_once(once, AddDescriptorsImpl);
  98. }
  99. // Force AddDescriptors() to be called at dynamic initialization time.
  100. struct StaticDescriptorInitializer {
  101. StaticDescriptorInitializer() {
  102. AddDescriptors();
  103. }
  104. } static_descriptor_initializer;
  105. } // namespace protobuf_google_2fprotobuf_2funittest_5fno_5fgeneric_5fservices_2eproto
  106. namespace google {
  107. namespace protobuf {
  108. namespace no_generic_services_test {
  109. const ::google::protobuf::EnumDescriptor* TestEnum_descriptor() {
  110. protobuf_google_2fprotobuf_2funittest_5fno_5fgeneric_5fservices_2eproto::protobuf_AssignDescriptorsOnce();
  111. return protobuf_google_2fprotobuf_2funittest_5fno_5fgeneric_5fservices_2eproto::file_level_enum_descriptors[0];
  112. }
  113. bool TestEnum_IsValid(int value) {
  114. switch (value) {
  115. case 1:
  116. return true;
  117. default:
  118. return false;
  119. }
  120. }
  121. // ===================================================================
  122. void TestMessage::InitAsDefaultInstance() {
  123. }
  124. #if !defined(_MSC_VER) || _MSC_VER >= 1900
  125. const int TestMessage::kAFieldNumber;
  126. #endif // !defined(_MSC_VER) || _MSC_VER >= 1900
  127. TestMessage::TestMessage()
  128. : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  129. ::google::protobuf::internal::InitSCC(
  130. &protobuf_google_2fprotobuf_2funittest_5fno_5fgeneric_5fservices_2eproto::scc_info_TestMessage.base);
  131. SharedCtor();
  132. // @@protoc_insertion_point(constructor:google.protobuf.no_generic_services_test.TestMessage)
  133. }
  134. TestMessage::TestMessage(const TestMessage& from)
  135. : ::google::protobuf::Message(),
  136. _internal_metadata_(NULL),
  137. _has_bits_(from._has_bits_) {
  138. _internal_metadata_.MergeFrom(from._internal_metadata_);
  139. _extensions_.MergeFrom(from._extensions_);
  140. a_ = from.a_;
  141. // @@protoc_insertion_point(copy_constructor:google.protobuf.no_generic_services_test.TestMessage)
  142. }
  143. void TestMessage::SharedCtor() {
  144. a_ = 0;
  145. }
  146. TestMessage::~TestMessage() {
  147. // @@protoc_insertion_point(destructor:google.protobuf.no_generic_services_test.TestMessage)
  148. SharedDtor();
  149. }
  150. void TestMessage::SharedDtor() {
  151. }
  152. void TestMessage::SetCachedSize(int size) const {
  153. _cached_size_.Set(size);
  154. }
  155. const ::google::protobuf::Descriptor* TestMessage::descriptor() {
  156. ::protobuf_google_2fprotobuf_2funittest_5fno_5fgeneric_5fservices_2eproto::protobuf_AssignDescriptorsOnce();
  157. return ::protobuf_google_2fprotobuf_2funittest_5fno_5fgeneric_5fservices_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
  158. }
  159. const TestMessage& TestMessage::default_instance() {
  160. ::google::protobuf::internal::InitSCC(&protobuf_google_2fprotobuf_2funittest_5fno_5fgeneric_5fservices_2eproto::scc_info_TestMessage.base);
  161. return *internal_default_instance();
  162. }
  163. void TestMessage::Clear() {
  164. // @@protoc_insertion_point(message_clear_start:google.protobuf.no_generic_services_test.TestMessage)
  165. ::google::protobuf::uint32 cached_has_bits = 0;
  166. // Prevent compiler warnings about cached_has_bits being unused
  167. (void) cached_has_bits;
  168. _extensions_.Clear();
  169. a_ = 0;
  170. _has_bits_.Clear();
  171. _internal_metadata_.Clear();
  172. }
  173. bool TestMessage::MergePartialFromCodedStream(
  174. ::google::protobuf::io::CodedInputStream* input) {
  175. #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  176. ::google::protobuf::uint32 tag;
  177. // @@protoc_insertion_point(parse_start:google.protobuf.no_generic_services_test.TestMessage)
  178. for (;;) {
  179. ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
  180. tag = p.first;
  181. if (!p.second) goto handle_unusual;
  182. switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
  183. // optional int32 a = 1;
  184. case 1: {
  185. if (static_cast< ::google::protobuf::uint8>(tag) ==
  186. static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
  187. set_has_a();
  188. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  189. ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
  190. input, &a_)));
  191. } else {
  192. goto handle_unusual;
  193. }
  194. break;
  195. }
  196. default: {
  197. handle_unusual:
  198. if (tag == 0) {
  199. goto success;
  200. }
  201. if ((8000u <= tag)) {
  202. DO_(_extensions_.ParseField(tag, input,
  203. internal_default_instance(),
  204. _internal_metadata_.mutable_unknown_fields()));
  205. continue;
  206. }
  207. DO_(::google::protobuf::internal::WireFormat::SkipField(
  208. input, tag, _internal_metadata_.mutable_unknown_fields()));
  209. break;
  210. }
  211. }
  212. }
  213. success:
  214. // @@protoc_insertion_point(parse_success:google.protobuf.no_generic_services_test.TestMessage)
  215. return true;
  216. failure:
  217. // @@protoc_insertion_point(parse_failure:google.protobuf.no_generic_services_test.TestMessage)
  218. return false;
  219. #undef DO_
  220. }
  221. void TestMessage::SerializeWithCachedSizes(
  222. ::google::protobuf::io::CodedOutputStream* output) const {
  223. // @@protoc_insertion_point(serialize_start:google.protobuf.no_generic_services_test.TestMessage)
  224. ::google::protobuf::uint32 cached_has_bits = 0;
  225. (void) cached_has_bits;
  226. cached_has_bits = _has_bits_[0];
  227. // optional int32 a = 1;
  228. if (cached_has_bits & 0x00000001u) {
  229. ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->a(), output);
  230. }
  231. // Extension range [1000, 536870912)
  232. _extensions_.SerializeWithCachedSizes(
  233. 1000, 536870912, output);
  234. if (_internal_metadata_.have_unknown_fields()) {
  235. ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
  236. _internal_metadata_.unknown_fields(), output);
  237. }
  238. // @@protoc_insertion_point(serialize_end:google.protobuf.no_generic_services_test.TestMessage)
  239. }
  240. ::google::protobuf::uint8* TestMessage::InternalSerializeWithCachedSizesToArray(
  241. bool deterministic, ::google::protobuf::uint8* target) const {
  242. (void)deterministic; // Unused
  243. // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.no_generic_services_test.TestMessage)
  244. ::google::protobuf::uint32 cached_has_bits = 0;
  245. (void) cached_has_bits;
  246. cached_has_bits = _has_bits_[0];
  247. // optional int32 a = 1;
  248. if (cached_has_bits & 0x00000001u) {
  249. target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->a(), target);
  250. }
  251. // Extension range [1000, 536870912)
  252. target = _extensions_.InternalSerializeWithCachedSizesToArray(
  253. 1000, 536870912, deterministic, target);
  254. if (_internal_metadata_.have_unknown_fields()) {
  255. target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
  256. _internal_metadata_.unknown_fields(), target);
  257. }
  258. // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.no_generic_services_test.TestMessage)
  259. return target;
  260. }
  261. size_t TestMessage::ByteSizeLong() const {
  262. // @@protoc_insertion_point(message_byte_size_start:google.protobuf.no_generic_services_test.TestMessage)
  263. size_t total_size = 0;
  264. total_size += _extensions_.ByteSize();
  265. if (_internal_metadata_.have_unknown_fields()) {
  266. total_size +=
  267. ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
  268. _internal_metadata_.unknown_fields());
  269. }
  270. // optional int32 a = 1;
  271. if (has_a()) {
  272. total_size += 1 +
  273. ::google::protobuf::internal::WireFormatLite::Int32Size(
  274. this->a());
  275. }
  276. int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
  277. SetCachedSize(cached_size);
  278. return total_size;
  279. }
  280. void TestMessage::MergeFrom(const ::google::protobuf::Message& from) {
  281. // @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.no_generic_services_test.TestMessage)
  282. GOOGLE_DCHECK_NE(&from, this);
  283. const TestMessage* source =
  284. ::google::protobuf::internal::DynamicCastToGenerated<const TestMessage>(
  285. &from);
  286. if (source == NULL) {
  287. // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.no_generic_services_test.TestMessage)
  288. ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  289. } else {
  290. // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.no_generic_services_test.TestMessage)
  291. MergeFrom(*source);
  292. }
  293. }
  294. void TestMessage::MergeFrom(const TestMessage& from) {
  295. // @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.no_generic_services_test.TestMessage)
  296. GOOGLE_DCHECK_NE(&from, this);
  297. _extensions_.MergeFrom(from._extensions_);
  298. _internal_metadata_.MergeFrom(from._internal_metadata_);
  299. ::google::protobuf::uint32 cached_has_bits = 0;
  300. (void) cached_has_bits;
  301. if (from.has_a()) {
  302. set_a(from.a());
  303. }
  304. }
  305. void TestMessage::CopyFrom(const ::google::protobuf::Message& from) {
  306. // @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.no_generic_services_test.TestMessage)
  307. if (&from == this) return;
  308. Clear();
  309. MergeFrom(from);
  310. }
  311. void TestMessage::CopyFrom(const TestMessage& from) {
  312. // @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.no_generic_services_test.TestMessage)
  313. if (&from == this) return;
  314. Clear();
  315. MergeFrom(from);
  316. }
  317. bool TestMessage::IsInitialized() const {
  318. if (!_extensions_.IsInitialized()) {
  319. return false;
  320. }
  321. return true;
  322. }
  323. void TestMessage::Swap(TestMessage* other) {
  324. if (other == this) return;
  325. InternalSwap(other);
  326. }
  327. void TestMessage::InternalSwap(TestMessage* other) {
  328. using std::swap;
  329. swap(a_, other->a_);
  330. swap(_has_bits_[0], other->_has_bits_[0]);
  331. _internal_metadata_.Swap(&other->_internal_metadata_);
  332. _extensions_.Swap(&other->_extensions_);
  333. }
  334. ::google::protobuf::Metadata TestMessage::GetMetadata() const {
  335. protobuf_google_2fprotobuf_2funittest_5fno_5fgeneric_5fservices_2eproto::protobuf_AssignDescriptorsOnce();
  336. return ::protobuf_google_2fprotobuf_2funittest_5fno_5fgeneric_5fservices_2eproto::file_level_metadata[kIndexInFileMessages];
  337. }
  338. ::google::protobuf::internal::ExtensionIdentifier< ::google::protobuf::no_generic_services_test::TestMessage,
  339. ::google::protobuf::internal::PrimitiveTypeTraits< ::google::protobuf::int32 >, 5, false >
  340. test_extension(kTestExtensionFieldNumber, 0);
  341. // @@protoc_insertion_point(namespace_scope)
  342. } // namespace no_generic_services_test
  343. } // namespace protobuf
  344. } // namespace google
  345. namespace google {
  346. namespace protobuf {
  347. template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::google::protobuf::no_generic_services_test::TestMessage* Arena::CreateMaybeMessage< ::google::protobuf::no_generic_services_test::TestMessage >(Arena* arena) {
  348. return Arena::CreateInternal< ::google::protobuf::no_generic_services_test::TestMessage >(arena);
  349. }
  350. } // namespace protobuf
  351. } // namespace google
  352. // @@protoc_insertion_point(global_scope)