unittest_import_lite.pb.cc 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254
  1. // Generated by the protocol buffer compiler. DO NOT EDIT!
  2. // source: google/protobuf/unittest_import_lite.proto
  3. #include <google/protobuf/unittest_import_lite.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/io/zero_copy_stream_impl_lite.h>
  10. // This is a temporary google only hack
  11. #ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
  12. #include "third_party/protobuf/version.h"
  13. #endif
  14. // @@protoc_insertion_point(includes)
  15. namespace protobuf_unittest_import {
  16. class ImportMessageLiteDefaultTypeInternal {
  17. public:
  18. ::google::protobuf::internal::ExplicitlyConstructed<ImportMessageLite>
  19. _instance;
  20. } _ImportMessageLite_default_instance_;
  21. } // namespace protobuf_unittest_import
  22. namespace protobuf_google_2fprotobuf_2funittest_5fimport_5flite_2eproto {
  23. static void InitDefaultsImportMessageLite() {
  24. GOOGLE_PROTOBUF_VERIFY_VERSION;
  25. {
  26. void* ptr = &::protobuf_unittest_import::_ImportMessageLite_default_instance_;
  27. new (ptr) ::protobuf_unittest_import::ImportMessageLite();
  28. ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
  29. }
  30. ::protobuf_unittest_import::ImportMessageLite::InitAsDefaultInstance();
  31. }
  32. ::google::protobuf::internal::SCCInfo<0> scc_info_ImportMessageLite =
  33. {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsImportMessageLite}, {}};
  34. void InitDefaults() {
  35. ::google::protobuf::internal::InitSCC(&scc_info_ImportMessageLite.base);
  36. }
  37. } // namespace protobuf_google_2fprotobuf_2funittest_5fimport_5flite_2eproto
  38. namespace protobuf_unittest_import {
  39. bool ImportEnumLite_IsValid(int value) {
  40. switch (value) {
  41. case 7:
  42. case 8:
  43. case 9:
  44. return true;
  45. default:
  46. return false;
  47. }
  48. }
  49. // ===================================================================
  50. void ImportMessageLite::InitAsDefaultInstance() {
  51. }
  52. #if !defined(_MSC_VER) || _MSC_VER >= 1900
  53. const int ImportMessageLite::kDFieldNumber;
  54. #endif // !defined(_MSC_VER) || _MSC_VER >= 1900
  55. ImportMessageLite::ImportMessageLite()
  56. : ::google::protobuf::MessageLite(), _internal_metadata_(NULL) {
  57. ::google::protobuf::internal::InitSCC(
  58. &protobuf_google_2fprotobuf_2funittest_5fimport_5flite_2eproto::scc_info_ImportMessageLite.base);
  59. SharedCtor();
  60. // @@protoc_insertion_point(constructor:protobuf_unittest_import.ImportMessageLite)
  61. }
  62. ImportMessageLite::ImportMessageLite(const ImportMessageLite& from)
  63. : ::google::protobuf::MessageLite(),
  64. _internal_metadata_(NULL),
  65. _has_bits_(from._has_bits_) {
  66. _internal_metadata_.MergeFrom(from._internal_metadata_);
  67. d_ = from.d_;
  68. // @@protoc_insertion_point(copy_constructor:protobuf_unittest_import.ImportMessageLite)
  69. }
  70. void ImportMessageLite::SharedCtor() {
  71. d_ = 0;
  72. }
  73. ImportMessageLite::~ImportMessageLite() {
  74. // @@protoc_insertion_point(destructor:protobuf_unittest_import.ImportMessageLite)
  75. SharedDtor();
  76. }
  77. void ImportMessageLite::SharedDtor() {
  78. }
  79. void ImportMessageLite::SetCachedSize(int size) const {
  80. _cached_size_.Set(size);
  81. }
  82. const ImportMessageLite& ImportMessageLite::default_instance() {
  83. ::google::protobuf::internal::InitSCC(&protobuf_google_2fprotobuf_2funittest_5fimport_5flite_2eproto::scc_info_ImportMessageLite.base);
  84. return *internal_default_instance();
  85. }
  86. void ImportMessageLite::Clear() {
  87. // @@protoc_insertion_point(message_clear_start:protobuf_unittest_import.ImportMessageLite)
  88. ::google::protobuf::uint32 cached_has_bits = 0;
  89. // Prevent compiler warnings about cached_has_bits being unused
  90. (void) cached_has_bits;
  91. d_ = 0;
  92. _has_bits_.Clear();
  93. _internal_metadata_.Clear();
  94. }
  95. bool ImportMessageLite::MergePartialFromCodedStream(
  96. ::google::protobuf::io::CodedInputStream* input) {
  97. #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  98. ::google::protobuf::uint32 tag;
  99. ::google::protobuf::internal::LiteUnknownFieldSetter unknown_fields_setter(
  100. &_internal_metadata_);
  101. ::google::protobuf::io::StringOutputStream unknown_fields_output(
  102. unknown_fields_setter.buffer());
  103. ::google::protobuf::io::CodedOutputStream unknown_fields_stream(
  104. &unknown_fields_output, false);
  105. // @@protoc_insertion_point(parse_start:protobuf_unittest_import.ImportMessageLite)
  106. for (;;) {
  107. ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
  108. tag = p.first;
  109. if (!p.second) goto handle_unusual;
  110. switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
  111. // optional int32 d = 1;
  112. case 1: {
  113. if (static_cast< ::google::protobuf::uint8>(tag) ==
  114. static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
  115. set_has_d();
  116. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  117. ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
  118. input, &d_)));
  119. } else {
  120. goto handle_unusual;
  121. }
  122. break;
  123. }
  124. default: {
  125. handle_unusual:
  126. if (tag == 0) {
  127. goto success;
  128. }
  129. DO_(::google::protobuf::internal::WireFormatLite::SkipField(
  130. input, tag, &unknown_fields_stream));
  131. break;
  132. }
  133. }
  134. }
  135. success:
  136. // @@protoc_insertion_point(parse_success:protobuf_unittest_import.ImportMessageLite)
  137. return true;
  138. failure:
  139. // @@protoc_insertion_point(parse_failure:protobuf_unittest_import.ImportMessageLite)
  140. return false;
  141. #undef DO_
  142. }
  143. void ImportMessageLite::SerializeWithCachedSizes(
  144. ::google::protobuf::io::CodedOutputStream* output) const {
  145. // @@protoc_insertion_point(serialize_start:protobuf_unittest_import.ImportMessageLite)
  146. ::google::protobuf::uint32 cached_has_bits = 0;
  147. (void) cached_has_bits;
  148. cached_has_bits = _has_bits_[0];
  149. // optional int32 d = 1;
  150. if (cached_has_bits & 0x00000001u) {
  151. ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->d(), output);
  152. }
  153. output->WriteRaw(_internal_metadata_.unknown_fields().data(),
  154. static_cast<int>(_internal_metadata_.unknown_fields().size()));
  155. // @@protoc_insertion_point(serialize_end:protobuf_unittest_import.ImportMessageLite)
  156. }
  157. size_t ImportMessageLite::ByteSizeLong() const {
  158. // @@protoc_insertion_point(message_byte_size_start:protobuf_unittest_import.ImportMessageLite)
  159. size_t total_size = 0;
  160. total_size += _internal_metadata_.unknown_fields().size();
  161. // optional int32 d = 1;
  162. if (has_d()) {
  163. total_size += 1 +
  164. ::google::protobuf::internal::WireFormatLite::Int32Size(
  165. this->d());
  166. }
  167. int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
  168. SetCachedSize(cached_size);
  169. return total_size;
  170. }
  171. void ImportMessageLite::CheckTypeAndMergeFrom(
  172. const ::google::protobuf::MessageLite& from) {
  173. MergeFrom(*::google::protobuf::down_cast<const ImportMessageLite*>(&from));
  174. }
  175. void ImportMessageLite::MergeFrom(const ImportMessageLite& from) {
  176. // @@protoc_insertion_point(class_specific_merge_from_start:protobuf_unittest_import.ImportMessageLite)
  177. GOOGLE_DCHECK_NE(&from, this);
  178. _internal_metadata_.MergeFrom(from._internal_metadata_);
  179. ::google::protobuf::uint32 cached_has_bits = 0;
  180. (void) cached_has_bits;
  181. if (from.has_d()) {
  182. set_d(from.d());
  183. }
  184. }
  185. void ImportMessageLite::CopyFrom(const ImportMessageLite& from) {
  186. // @@protoc_insertion_point(class_specific_copy_from_start:protobuf_unittest_import.ImportMessageLite)
  187. if (&from == this) return;
  188. Clear();
  189. MergeFrom(from);
  190. }
  191. bool ImportMessageLite::IsInitialized() const {
  192. return true;
  193. }
  194. void ImportMessageLite::Swap(ImportMessageLite* other) {
  195. if (other == this) return;
  196. InternalSwap(other);
  197. }
  198. void ImportMessageLite::InternalSwap(ImportMessageLite* other) {
  199. using std::swap;
  200. swap(d_, other->d_);
  201. swap(_has_bits_[0], other->_has_bits_[0]);
  202. _internal_metadata_.Swap(&other->_internal_metadata_);
  203. }
  204. ::std::string ImportMessageLite::GetTypeName() const {
  205. return "protobuf_unittest_import.ImportMessageLite";
  206. }
  207. // @@protoc_insertion_point(namespace_scope)
  208. } // namespace protobuf_unittest_import
  209. namespace google {
  210. namespace protobuf {
  211. template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::protobuf_unittest_import::ImportMessageLite* Arena::CreateMaybeMessage< ::protobuf_unittest_import::ImportMessageLite >(Arena* arena) {
  212. return Arena::CreateInternal< ::protobuf_unittest_import::ImportMessageLite >(arena);
  213. }
  214. } // namespace protobuf
  215. } // namespace google
  216. // @@protoc_insertion_point(global_scope)