unittest_lazy_dependencies_custom_option.pb.cc 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395
  1. // Generated by the protocol buffer compiler. DO NOT EDIT!
  2. // source: google/protobuf/unittest_lazy_dependencies_custom_option.proto
  3. #include <google/protobuf/unittest_lazy_dependencies_custom_option.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 protobuf_unittest {
  19. namespace lazy_imports {
  20. class LazyMessageDefaultTypeInternal {
  21. public:
  22. ::google::protobuf::internal::ExplicitlyConstructed<LazyMessage>
  23. _instance;
  24. } _LazyMessage_default_instance_;
  25. } // namespace lazy_imports
  26. } // namespace protobuf_unittest
  27. namespace protobuf_google_2fprotobuf_2funittest_5flazy_5fdependencies_5fcustom_5foption_2eproto {
  28. static void InitDefaultsLazyMessage() {
  29. GOOGLE_PROTOBUF_VERIFY_VERSION;
  30. {
  31. void* ptr = &::protobuf_unittest::lazy_imports::_LazyMessage_default_instance_;
  32. new (ptr) ::protobuf_unittest::lazy_imports::LazyMessage();
  33. ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
  34. }
  35. ::protobuf_unittest::lazy_imports::LazyMessage::InitAsDefaultInstance();
  36. }
  37. ::google::protobuf::internal::SCCInfo<0> scc_info_LazyMessage =
  38. {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsLazyMessage}, {}};
  39. void InitDefaults() {
  40. ::google::protobuf::internal::InitSCC(&scc_info_LazyMessage.base);
  41. }
  42. ::google::protobuf::Metadata file_level_metadata[1];
  43. const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
  44. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest::lazy_imports::LazyMessage, _has_bits_),
  45. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest::lazy_imports::LazyMessage, _internal_metadata_),
  46. ~0u, // no _extensions_
  47. ~0u, // no _oneof_case_
  48. ~0u, // no _weak_field_map_
  49. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest::lazy_imports::LazyMessage, a_),
  50. 0,
  51. };
  52. static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
  53. { 0, 6, sizeof(::protobuf_unittest::lazy_imports::LazyMessage)},
  54. };
  55. static ::google::protobuf::Message const * const file_default_instances[] = {
  56. reinterpret_cast<const ::google::protobuf::Message*>(&::protobuf_unittest::lazy_imports::_LazyMessage_default_instance_),
  57. };
  58. void protobuf_AssignDescriptors() {
  59. AddDescriptors();
  60. AssignDescriptors(
  61. "google/protobuf/unittest_lazy_dependencies_custom_option.proto", schemas, file_default_instances, TableStruct::offsets,
  62. file_level_metadata, NULL, NULL);
  63. }
  64. void protobuf_AssignDescriptorsOnce() {
  65. static ::google::protobuf::internal::once_flag once;
  66. ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors);
  67. }
  68. void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD;
  69. void protobuf_RegisterTypes(const ::std::string&) {
  70. protobuf_AssignDescriptorsOnce();
  71. ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 1);
  72. }
  73. void AddDescriptorsImpl() {
  74. InitDefaults();
  75. static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
  76. "\n>google/protobuf/unittest_lazy_dependen"
  77. "cies_custom_option.proto\022\036protobuf_unitt"
  78. "est.lazy_imports\0325google/protobuf/unitte"
  79. "st_lazy_dependencies_enum.proto\032 google/"
  80. "protobuf/descriptor.proto\"\030\n\013LazyMessage"
  81. "\022\t\n\001a\030\001 \001(\005:s\n\020lazy_enum_option\022\037.google"
  82. ".protobuf.MessageOptions\030\357\237\213B \001(\0162(.prot"
  83. "obuf_unittest.lazy_imports.LazyEnum:\013LAZ"
  84. "Y_ENUM_1B4B$UnittestLazyImportsCustomOpt"
  85. "ionProtoH\001\200\001\001\210\001\001\220\001\001\370\001\001"
  86. };
  87. ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
  88. descriptor, 382);
  89. ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
  90. "google/protobuf/unittest_lazy_dependencies_custom_option.proto", &protobuf_RegisterTypes);
  91. ::protobuf_google_2fprotobuf_2funittest_5flazy_5fdependencies_5fenum_2eproto::AddDescriptors();
  92. ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::AddDescriptors();
  93. }
  94. void AddDescriptors() {
  95. static ::google::protobuf::internal::once_flag once;
  96. ::google::protobuf::internal::call_once(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_google_2fprotobuf_2funittest_5flazy_5fdependencies_5fcustom_5foption_2eproto
  105. namespace protobuf_unittest {
  106. namespace lazy_imports {
  107. // ===================================================================
  108. void LazyMessage::InitAsDefaultInstance() {
  109. }
  110. #if !defined(_MSC_VER) || _MSC_VER >= 1900
  111. const int LazyMessage::kAFieldNumber;
  112. #endif // !defined(_MSC_VER) || _MSC_VER >= 1900
  113. LazyMessage::LazyMessage()
  114. : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  115. ::google::protobuf::internal::InitSCC(
  116. &protobuf_google_2fprotobuf_2funittest_5flazy_5fdependencies_5fcustom_5foption_2eproto::scc_info_LazyMessage.base);
  117. SharedCtor();
  118. // @@protoc_insertion_point(constructor:protobuf_unittest.lazy_imports.LazyMessage)
  119. }
  120. LazyMessage::LazyMessage(::google::protobuf::Arena* arena)
  121. : ::google::protobuf::Message(),
  122. _internal_metadata_(arena) {
  123. ::google::protobuf::internal::InitSCC(&protobuf_google_2fprotobuf_2funittest_5flazy_5fdependencies_5fcustom_5foption_2eproto::scc_info_LazyMessage.base);
  124. SharedCtor();
  125. RegisterArenaDtor(arena);
  126. // @@protoc_insertion_point(arena_constructor:protobuf_unittest.lazy_imports.LazyMessage)
  127. }
  128. LazyMessage::LazyMessage(const LazyMessage& from)
  129. : ::google::protobuf::Message(),
  130. _internal_metadata_(NULL),
  131. _has_bits_(from._has_bits_) {
  132. _internal_metadata_.MergeFrom(from._internal_metadata_);
  133. a_ = from.a_;
  134. // @@protoc_insertion_point(copy_constructor:protobuf_unittest.lazy_imports.LazyMessage)
  135. }
  136. void LazyMessage::SharedCtor() {
  137. a_ = 0;
  138. }
  139. LazyMessage::~LazyMessage() {
  140. // @@protoc_insertion_point(destructor:protobuf_unittest.lazy_imports.LazyMessage)
  141. SharedDtor();
  142. }
  143. void LazyMessage::SharedDtor() {
  144. GOOGLE_DCHECK(GetArenaNoVirtual() == NULL);
  145. }
  146. void LazyMessage::ArenaDtor(void* object) {
  147. LazyMessage* _this = reinterpret_cast< LazyMessage* >(object);
  148. (void)_this;
  149. }
  150. void LazyMessage::RegisterArenaDtor(::google::protobuf::Arena* arena) {
  151. }
  152. void LazyMessage::SetCachedSize(int size) const {
  153. _cached_size_.Set(size);
  154. }
  155. const ::google::protobuf::Descriptor* LazyMessage::descriptor() {
  156. ::protobuf_google_2fprotobuf_2funittest_5flazy_5fdependencies_5fcustom_5foption_2eproto::protobuf_AssignDescriptorsOnce();
  157. return ::protobuf_google_2fprotobuf_2funittest_5flazy_5fdependencies_5fcustom_5foption_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
  158. }
  159. const LazyMessage& LazyMessage::default_instance() {
  160. ::google::protobuf::internal::InitSCC(&protobuf_google_2fprotobuf_2funittest_5flazy_5fdependencies_5fcustom_5foption_2eproto::scc_info_LazyMessage.base);
  161. return *internal_default_instance();
  162. }
  163. void LazyMessage::Clear() {
  164. // @@protoc_insertion_point(message_clear_start:protobuf_unittest.lazy_imports.LazyMessage)
  165. ::google::protobuf::uint32 cached_has_bits = 0;
  166. // Prevent compiler warnings about cached_has_bits being unused
  167. (void) cached_has_bits;
  168. a_ = 0;
  169. _has_bits_.Clear();
  170. _internal_metadata_.Clear();
  171. }
  172. bool LazyMessage::MergePartialFromCodedStream(
  173. ::google::protobuf::io::CodedInputStream* input) {
  174. #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  175. ::google::protobuf::uint32 tag;
  176. // @@protoc_insertion_point(parse_start:protobuf_unittest.lazy_imports.LazyMessage)
  177. for (;;) {
  178. ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
  179. tag = p.first;
  180. if (!p.second) goto handle_unusual;
  181. switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
  182. // optional int32 a = 1;
  183. case 1: {
  184. if (static_cast< ::google::protobuf::uint8>(tag) ==
  185. static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
  186. set_has_a();
  187. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  188. ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
  189. input, &a_)));
  190. } else {
  191. goto handle_unusual;
  192. }
  193. break;
  194. }
  195. default: {
  196. handle_unusual:
  197. if (tag == 0) {
  198. goto success;
  199. }
  200. DO_(::google::protobuf::internal::WireFormat::SkipField(
  201. input, tag, _internal_metadata_.mutable_unknown_fields()));
  202. break;
  203. }
  204. }
  205. }
  206. success:
  207. // @@protoc_insertion_point(parse_success:protobuf_unittest.lazy_imports.LazyMessage)
  208. return true;
  209. failure:
  210. // @@protoc_insertion_point(parse_failure:protobuf_unittest.lazy_imports.LazyMessage)
  211. return false;
  212. #undef DO_
  213. }
  214. void LazyMessage::SerializeWithCachedSizes(
  215. ::google::protobuf::io::CodedOutputStream* output) const {
  216. // @@protoc_insertion_point(serialize_start:protobuf_unittest.lazy_imports.LazyMessage)
  217. ::google::protobuf::uint32 cached_has_bits = 0;
  218. (void) cached_has_bits;
  219. cached_has_bits = _has_bits_[0];
  220. // optional int32 a = 1;
  221. if (cached_has_bits & 0x00000001u) {
  222. ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->a(), output);
  223. }
  224. if (_internal_metadata_.have_unknown_fields()) {
  225. ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
  226. _internal_metadata_.unknown_fields(), output);
  227. }
  228. // @@protoc_insertion_point(serialize_end:protobuf_unittest.lazy_imports.LazyMessage)
  229. }
  230. ::google::protobuf::uint8* LazyMessage::InternalSerializeWithCachedSizesToArray(
  231. bool deterministic, ::google::protobuf::uint8* target) const {
  232. (void)deterministic; // Unused
  233. // @@protoc_insertion_point(serialize_to_array_start:protobuf_unittest.lazy_imports.LazyMessage)
  234. ::google::protobuf::uint32 cached_has_bits = 0;
  235. (void) cached_has_bits;
  236. cached_has_bits = _has_bits_[0];
  237. // optional int32 a = 1;
  238. if (cached_has_bits & 0x00000001u) {
  239. target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->a(), target);
  240. }
  241. if (_internal_metadata_.have_unknown_fields()) {
  242. target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
  243. _internal_metadata_.unknown_fields(), target);
  244. }
  245. // @@protoc_insertion_point(serialize_to_array_end:protobuf_unittest.lazy_imports.LazyMessage)
  246. return target;
  247. }
  248. size_t LazyMessage::ByteSizeLong() const {
  249. // @@protoc_insertion_point(message_byte_size_start:protobuf_unittest.lazy_imports.LazyMessage)
  250. size_t total_size = 0;
  251. if (_internal_metadata_.have_unknown_fields()) {
  252. total_size +=
  253. ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
  254. _internal_metadata_.unknown_fields());
  255. }
  256. // optional int32 a = 1;
  257. if (has_a()) {
  258. total_size += 1 +
  259. ::google::protobuf::internal::WireFormatLite::Int32Size(
  260. this->a());
  261. }
  262. int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
  263. SetCachedSize(cached_size);
  264. return total_size;
  265. }
  266. void LazyMessage::MergeFrom(const ::google::protobuf::Message& from) {
  267. // @@protoc_insertion_point(generalized_merge_from_start:protobuf_unittest.lazy_imports.LazyMessage)
  268. GOOGLE_DCHECK_NE(&from, this);
  269. const LazyMessage* source =
  270. ::google::protobuf::internal::DynamicCastToGenerated<const LazyMessage>(
  271. &from);
  272. if (source == NULL) {
  273. // @@protoc_insertion_point(generalized_merge_from_cast_fail:protobuf_unittest.lazy_imports.LazyMessage)
  274. ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  275. } else {
  276. // @@protoc_insertion_point(generalized_merge_from_cast_success:protobuf_unittest.lazy_imports.LazyMessage)
  277. MergeFrom(*source);
  278. }
  279. }
  280. void LazyMessage::MergeFrom(const LazyMessage& from) {
  281. // @@protoc_insertion_point(class_specific_merge_from_start:protobuf_unittest.lazy_imports.LazyMessage)
  282. GOOGLE_DCHECK_NE(&from, this);
  283. _internal_metadata_.MergeFrom(from._internal_metadata_);
  284. ::google::protobuf::uint32 cached_has_bits = 0;
  285. (void) cached_has_bits;
  286. if (from.has_a()) {
  287. set_a(from.a());
  288. }
  289. }
  290. void LazyMessage::CopyFrom(const ::google::protobuf::Message& from) {
  291. // @@protoc_insertion_point(generalized_copy_from_start:protobuf_unittest.lazy_imports.LazyMessage)
  292. if (&from == this) return;
  293. Clear();
  294. MergeFrom(from);
  295. }
  296. void LazyMessage::CopyFrom(const LazyMessage& from) {
  297. // @@protoc_insertion_point(class_specific_copy_from_start:protobuf_unittest.lazy_imports.LazyMessage)
  298. if (&from == this) return;
  299. Clear();
  300. MergeFrom(from);
  301. }
  302. bool LazyMessage::IsInitialized() const {
  303. return true;
  304. }
  305. void LazyMessage::Swap(LazyMessage* other) {
  306. if (other == this) return;
  307. if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) {
  308. InternalSwap(other);
  309. } else {
  310. LazyMessage* temp = New(GetArenaNoVirtual());
  311. temp->MergeFrom(*other);
  312. other->CopyFrom(*this);
  313. InternalSwap(temp);
  314. if (GetArenaNoVirtual() == NULL) {
  315. delete temp;
  316. }
  317. }
  318. }
  319. void LazyMessage::UnsafeArenaSwap(LazyMessage* other) {
  320. if (other == this) return;
  321. GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual());
  322. InternalSwap(other);
  323. }
  324. void LazyMessage::InternalSwap(LazyMessage* other) {
  325. using std::swap;
  326. swap(a_, other->a_);
  327. swap(_has_bits_[0], other->_has_bits_[0]);
  328. _internal_metadata_.Swap(&other->_internal_metadata_);
  329. }
  330. ::google::protobuf::Metadata LazyMessage::GetMetadata() const {
  331. protobuf_google_2fprotobuf_2funittest_5flazy_5fdependencies_5fcustom_5foption_2eproto::protobuf_AssignDescriptorsOnce();
  332. return ::protobuf_google_2fprotobuf_2funittest_5flazy_5fdependencies_5fcustom_5foption_2eproto::file_level_metadata[kIndexInFileMessages];
  333. }
  334. ::google::protobuf::internal::ExtensionIdentifier< ::google::protobuf::MessageOptions,
  335. ::google::protobuf::internal::EnumTypeTraits< ::protobuf_unittest::lazy_imports::LazyEnum, ::protobuf_unittest::lazy_imports::LazyEnum_IsValid>, 14, false >
  336. lazy_enum_option(kLazyEnumOptionFieldNumber, static_cast< ::protobuf_unittest::lazy_imports::LazyEnum >(1));
  337. // @@protoc_insertion_point(namespace_scope)
  338. } // namespace lazy_imports
  339. } // namespace protobuf_unittest
  340. namespace google {
  341. namespace protobuf {
  342. template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::protobuf_unittest::lazy_imports::LazyMessage* Arena::CreateMaybeMessage< ::protobuf_unittest::lazy_imports::LazyMessage >(Arena* arena) {
  343. return Arena::CreateMessageInternal< ::protobuf_unittest::lazy_imports::LazyMessage >(arena);
  344. }
  345. } // namespace protobuf
  346. } // namespace google
  347. // @@protoc_insertion_point(global_scope)