unittest_no_arena_import.pb.cc 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349
  1. // Generated by the protocol buffer compiler. DO NOT EDIT!
  2. // source: google/protobuf/unittest_no_arena_import.proto
  3. #include <google/protobuf/unittest_no_arena_import.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 proto2_arena_unittest {
  19. class ImportNoArenaNestedMessageDefaultTypeInternal {
  20. public:
  21. ::google::protobuf::internal::ExplicitlyConstructed<ImportNoArenaNestedMessage>
  22. _instance;
  23. } _ImportNoArenaNestedMessage_default_instance_;
  24. } // namespace proto2_arena_unittest
  25. namespace protobuf_google_2fprotobuf_2funittest_5fno_5farena_5fimport_2eproto {
  26. static void InitDefaultsImportNoArenaNestedMessage() {
  27. GOOGLE_PROTOBUF_VERIFY_VERSION;
  28. {
  29. void* ptr = &::proto2_arena_unittest::_ImportNoArenaNestedMessage_default_instance_;
  30. new (ptr) ::proto2_arena_unittest::ImportNoArenaNestedMessage();
  31. ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
  32. }
  33. ::proto2_arena_unittest::ImportNoArenaNestedMessage::InitAsDefaultInstance();
  34. }
  35. ::google::protobuf::internal::SCCInfo<0> scc_info_ImportNoArenaNestedMessage =
  36. {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsImportNoArenaNestedMessage}, {}};
  37. void InitDefaults() {
  38. ::google::protobuf::internal::InitSCC(&scc_info_ImportNoArenaNestedMessage.base);
  39. }
  40. ::google::protobuf::Metadata file_level_metadata[1];
  41. const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
  42. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto2_arena_unittest::ImportNoArenaNestedMessage, _has_bits_),
  43. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto2_arena_unittest::ImportNoArenaNestedMessage, _internal_metadata_),
  44. ~0u, // no _extensions_
  45. ~0u, // no _oneof_case_
  46. ~0u, // no _weak_field_map_
  47. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto2_arena_unittest::ImportNoArenaNestedMessage, d_),
  48. 0,
  49. };
  50. static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
  51. { 0, 6, sizeof(::proto2_arena_unittest::ImportNoArenaNestedMessage)},
  52. };
  53. static ::google::protobuf::Message const * const file_default_instances[] = {
  54. reinterpret_cast<const ::google::protobuf::Message*>(&::proto2_arena_unittest::_ImportNoArenaNestedMessage_default_instance_),
  55. };
  56. void protobuf_AssignDescriptors() {
  57. AddDescriptors();
  58. AssignDescriptors(
  59. "google/protobuf/unittest_no_arena_import.proto", schemas, file_default_instances, TableStruct::offsets,
  60. file_level_metadata, NULL, NULL);
  61. }
  62. void protobuf_AssignDescriptorsOnce() {
  63. static ::google::protobuf::internal::once_flag once;
  64. ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors);
  65. }
  66. void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD;
  67. void protobuf_RegisterTypes(const ::std::string&) {
  68. protobuf_AssignDescriptorsOnce();
  69. ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 1);
  70. }
  71. void AddDescriptorsImpl() {
  72. InitDefaults();
  73. static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
  74. "\n.google/protobuf/unittest_no_arena_impo"
  75. "rt.proto\022\025proto2_arena_unittest\"\'\n\032Impor"
  76. "tNoArenaNestedMessage\022\t\n\001d\030\001 \001(\005"
  77. };
  78. ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
  79. descriptor, 112);
  80. ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
  81. "google/protobuf/unittest_no_arena_import.proto", &protobuf_RegisterTypes);
  82. }
  83. void AddDescriptors() {
  84. static ::google::protobuf::internal::once_flag once;
  85. ::google::protobuf::internal::call_once(once, AddDescriptorsImpl);
  86. }
  87. // Force AddDescriptors() to be called at dynamic initialization time.
  88. struct StaticDescriptorInitializer {
  89. StaticDescriptorInitializer() {
  90. AddDescriptors();
  91. }
  92. } static_descriptor_initializer;
  93. } // namespace protobuf_google_2fprotobuf_2funittest_5fno_5farena_5fimport_2eproto
  94. namespace proto2_arena_unittest {
  95. // ===================================================================
  96. void ImportNoArenaNestedMessage::InitAsDefaultInstance() {
  97. }
  98. #if !defined(_MSC_VER) || _MSC_VER >= 1900
  99. const int ImportNoArenaNestedMessage::kDFieldNumber;
  100. #endif // !defined(_MSC_VER) || _MSC_VER >= 1900
  101. ImportNoArenaNestedMessage::ImportNoArenaNestedMessage()
  102. : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  103. ::google::protobuf::internal::InitSCC(
  104. &protobuf_google_2fprotobuf_2funittest_5fno_5farena_5fimport_2eproto::scc_info_ImportNoArenaNestedMessage.base);
  105. SharedCtor();
  106. // @@protoc_insertion_point(constructor:proto2_arena_unittest.ImportNoArenaNestedMessage)
  107. }
  108. ImportNoArenaNestedMessage::ImportNoArenaNestedMessage(const ImportNoArenaNestedMessage& from)
  109. : ::google::protobuf::Message(),
  110. _internal_metadata_(NULL),
  111. _has_bits_(from._has_bits_) {
  112. _internal_metadata_.MergeFrom(from._internal_metadata_);
  113. d_ = from.d_;
  114. // @@protoc_insertion_point(copy_constructor:proto2_arena_unittest.ImportNoArenaNestedMessage)
  115. }
  116. void ImportNoArenaNestedMessage::SharedCtor() {
  117. d_ = 0;
  118. }
  119. ImportNoArenaNestedMessage::~ImportNoArenaNestedMessage() {
  120. // @@protoc_insertion_point(destructor:proto2_arena_unittest.ImportNoArenaNestedMessage)
  121. SharedDtor();
  122. }
  123. void ImportNoArenaNestedMessage::SharedDtor() {
  124. }
  125. void ImportNoArenaNestedMessage::SetCachedSize(int size) const {
  126. _cached_size_.Set(size);
  127. }
  128. const ::google::protobuf::Descriptor* ImportNoArenaNestedMessage::descriptor() {
  129. ::protobuf_google_2fprotobuf_2funittest_5fno_5farena_5fimport_2eproto::protobuf_AssignDescriptorsOnce();
  130. return ::protobuf_google_2fprotobuf_2funittest_5fno_5farena_5fimport_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
  131. }
  132. const ImportNoArenaNestedMessage& ImportNoArenaNestedMessage::default_instance() {
  133. ::google::protobuf::internal::InitSCC(&protobuf_google_2fprotobuf_2funittest_5fno_5farena_5fimport_2eproto::scc_info_ImportNoArenaNestedMessage.base);
  134. return *internal_default_instance();
  135. }
  136. void ImportNoArenaNestedMessage::Clear() {
  137. // @@protoc_insertion_point(message_clear_start:proto2_arena_unittest.ImportNoArenaNestedMessage)
  138. ::google::protobuf::uint32 cached_has_bits = 0;
  139. // Prevent compiler warnings about cached_has_bits being unused
  140. (void) cached_has_bits;
  141. d_ = 0;
  142. _has_bits_.Clear();
  143. _internal_metadata_.Clear();
  144. }
  145. bool ImportNoArenaNestedMessage::MergePartialFromCodedStream(
  146. ::google::protobuf::io::CodedInputStream* input) {
  147. #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  148. ::google::protobuf::uint32 tag;
  149. // @@protoc_insertion_point(parse_start:proto2_arena_unittest.ImportNoArenaNestedMessage)
  150. for (;;) {
  151. ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
  152. tag = p.first;
  153. if (!p.second) goto handle_unusual;
  154. switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
  155. // optional int32 d = 1;
  156. case 1: {
  157. if (static_cast< ::google::protobuf::uint8>(tag) ==
  158. static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
  159. set_has_d();
  160. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  161. ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
  162. input, &d_)));
  163. } else {
  164. goto handle_unusual;
  165. }
  166. break;
  167. }
  168. default: {
  169. handle_unusual:
  170. if (tag == 0) {
  171. goto success;
  172. }
  173. DO_(::google::protobuf::internal::WireFormat::SkipField(
  174. input, tag, _internal_metadata_.mutable_unknown_fields()));
  175. break;
  176. }
  177. }
  178. }
  179. success:
  180. // @@protoc_insertion_point(parse_success:proto2_arena_unittest.ImportNoArenaNestedMessage)
  181. return true;
  182. failure:
  183. // @@protoc_insertion_point(parse_failure:proto2_arena_unittest.ImportNoArenaNestedMessage)
  184. return false;
  185. #undef DO_
  186. }
  187. void ImportNoArenaNestedMessage::SerializeWithCachedSizes(
  188. ::google::protobuf::io::CodedOutputStream* output) const {
  189. // @@protoc_insertion_point(serialize_start:proto2_arena_unittest.ImportNoArenaNestedMessage)
  190. ::google::protobuf::uint32 cached_has_bits = 0;
  191. (void) cached_has_bits;
  192. cached_has_bits = _has_bits_[0];
  193. // optional int32 d = 1;
  194. if (cached_has_bits & 0x00000001u) {
  195. ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->d(), output);
  196. }
  197. if (_internal_metadata_.have_unknown_fields()) {
  198. ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
  199. _internal_metadata_.unknown_fields(), output);
  200. }
  201. // @@protoc_insertion_point(serialize_end:proto2_arena_unittest.ImportNoArenaNestedMessage)
  202. }
  203. ::google::protobuf::uint8* ImportNoArenaNestedMessage::InternalSerializeWithCachedSizesToArray(
  204. bool deterministic, ::google::protobuf::uint8* target) const {
  205. (void)deterministic; // Unused
  206. // @@protoc_insertion_point(serialize_to_array_start:proto2_arena_unittest.ImportNoArenaNestedMessage)
  207. ::google::protobuf::uint32 cached_has_bits = 0;
  208. (void) cached_has_bits;
  209. cached_has_bits = _has_bits_[0];
  210. // optional int32 d = 1;
  211. if (cached_has_bits & 0x00000001u) {
  212. target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->d(), target);
  213. }
  214. if (_internal_metadata_.have_unknown_fields()) {
  215. target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
  216. _internal_metadata_.unknown_fields(), target);
  217. }
  218. // @@protoc_insertion_point(serialize_to_array_end:proto2_arena_unittest.ImportNoArenaNestedMessage)
  219. return target;
  220. }
  221. size_t ImportNoArenaNestedMessage::ByteSizeLong() const {
  222. // @@protoc_insertion_point(message_byte_size_start:proto2_arena_unittest.ImportNoArenaNestedMessage)
  223. size_t total_size = 0;
  224. if (_internal_metadata_.have_unknown_fields()) {
  225. total_size +=
  226. ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
  227. _internal_metadata_.unknown_fields());
  228. }
  229. // optional int32 d = 1;
  230. if (has_d()) {
  231. total_size += 1 +
  232. ::google::protobuf::internal::WireFormatLite::Int32Size(
  233. this->d());
  234. }
  235. int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
  236. SetCachedSize(cached_size);
  237. return total_size;
  238. }
  239. void ImportNoArenaNestedMessage::MergeFrom(const ::google::protobuf::Message& from) {
  240. // @@protoc_insertion_point(generalized_merge_from_start:proto2_arena_unittest.ImportNoArenaNestedMessage)
  241. GOOGLE_DCHECK_NE(&from, this);
  242. const ImportNoArenaNestedMessage* source =
  243. ::google::protobuf::internal::DynamicCastToGenerated<const ImportNoArenaNestedMessage>(
  244. &from);
  245. if (source == NULL) {
  246. // @@protoc_insertion_point(generalized_merge_from_cast_fail:proto2_arena_unittest.ImportNoArenaNestedMessage)
  247. ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  248. } else {
  249. // @@protoc_insertion_point(generalized_merge_from_cast_success:proto2_arena_unittest.ImportNoArenaNestedMessage)
  250. MergeFrom(*source);
  251. }
  252. }
  253. void ImportNoArenaNestedMessage::MergeFrom(const ImportNoArenaNestedMessage& from) {
  254. // @@protoc_insertion_point(class_specific_merge_from_start:proto2_arena_unittest.ImportNoArenaNestedMessage)
  255. GOOGLE_DCHECK_NE(&from, this);
  256. _internal_metadata_.MergeFrom(from._internal_metadata_);
  257. ::google::protobuf::uint32 cached_has_bits = 0;
  258. (void) cached_has_bits;
  259. if (from.has_d()) {
  260. set_d(from.d());
  261. }
  262. }
  263. void ImportNoArenaNestedMessage::CopyFrom(const ::google::protobuf::Message& from) {
  264. // @@protoc_insertion_point(generalized_copy_from_start:proto2_arena_unittest.ImportNoArenaNestedMessage)
  265. if (&from == this) return;
  266. Clear();
  267. MergeFrom(from);
  268. }
  269. void ImportNoArenaNestedMessage::CopyFrom(const ImportNoArenaNestedMessage& from) {
  270. // @@protoc_insertion_point(class_specific_copy_from_start:proto2_arena_unittest.ImportNoArenaNestedMessage)
  271. if (&from == this) return;
  272. Clear();
  273. MergeFrom(from);
  274. }
  275. bool ImportNoArenaNestedMessage::IsInitialized() const {
  276. return true;
  277. }
  278. void ImportNoArenaNestedMessage::Swap(ImportNoArenaNestedMessage* other) {
  279. if (other == this) return;
  280. InternalSwap(other);
  281. }
  282. void ImportNoArenaNestedMessage::InternalSwap(ImportNoArenaNestedMessage* other) {
  283. using std::swap;
  284. swap(d_, other->d_);
  285. swap(_has_bits_[0], other->_has_bits_[0]);
  286. _internal_metadata_.Swap(&other->_internal_metadata_);
  287. }
  288. ::google::protobuf::Metadata ImportNoArenaNestedMessage::GetMetadata() const {
  289. protobuf_google_2fprotobuf_2funittest_5fno_5farena_5fimport_2eproto::protobuf_AssignDescriptorsOnce();
  290. return ::protobuf_google_2fprotobuf_2funittest_5fno_5farena_5fimport_2eproto::file_level_metadata[kIndexInFileMessages];
  291. }
  292. // @@protoc_insertion_point(namespace_scope)
  293. } // namespace proto2_arena_unittest
  294. namespace google {
  295. namespace protobuf {
  296. template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::proto2_arena_unittest::ImportNoArenaNestedMessage* Arena::CreateMaybeMessage< ::proto2_arena_unittest::ImportNoArenaNestedMessage >(Arena* arena) {
  297. return Arena::CreateInternal< ::proto2_arena_unittest::ImportNoArenaNestedMessage >(arena);
  298. }
  299. } // namespace protobuf
  300. } // namespace google
  301. // @@protoc_insertion_point(global_scope)