unittest_lite_imports_nonlite.pb.cc 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321
  1. // Generated by the protocol buffer compiler. DO NOT EDIT!
  2. // source: google/protobuf/unittest_lite_imports_nonlite.proto
  3. #include <google/protobuf/unittest_lite_imports_nonlite.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_google_2fprotobuf_2funittest_2eproto {
  16. extern PROTOBUF_INTERNAL_EXPORT_protobuf_google_2fprotobuf_2funittest_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_TestRequired;
  17. extern PROTOBUF_INTERNAL_EXPORT_protobuf_google_2fprotobuf_2funittest_2eproto ::google::protobuf::internal::SCCInfo<6> scc_info_TestAllTypes;
  18. } // namespace protobuf_google_2fprotobuf_2funittest_2eproto
  19. namespace protobuf_unittest {
  20. class TestLiteImportsNonliteDefaultTypeInternal {
  21. public:
  22. ::google::protobuf::internal::ExplicitlyConstructed<TestLiteImportsNonlite>
  23. _instance;
  24. } _TestLiteImportsNonlite_default_instance_;
  25. } // namespace protobuf_unittest
  26. namespace protobuf_google_2fprotobuf_2funittest_5flite_5fimports_5fnonlite_2eproto {
  27. static void InitDefaultsTestLiteImportsNonlite() {
  28. GOOGLE_PROTOBUF_VERIFY_VERSION;
  29. {
  30. void* ptr = &::protobuf_unittest::_TestLiteImportsNonlite_default_instance_;
  31. new (ptr) ::protobuf_unittest::TestLiteImportsNonlite();
  32. ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
  33. }
  34. ::protobuf_unittest::TestLiteImportsNonlite::InitAsDefaultInstance();
  35. }
  36. ::google::protobuf::internal::SCCInfo<2> scc_info_TestLiteImportsNonlite =
  37. {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 2, InitDefaultsTestLiteImportsNonlite}, {
  38. &protobuf_google_2fprotobuf_2funittest_2eproto::scc_info_TestAllTypes.base,
  39. &protobuf_google_2fprotobuf_2funittest_2eproto::scc_info_TestRequired.base,}};
  40. void InitDefaults() {
  41. ::google::protobuf::internal::InitSCC(&scc_info_TestLiteImportsNonlite.base);
  42. }
  43. } // namespace protobuf_google_2fprotobuf_2funittest_5flite_5fimports_5fnonlite_2eproto
  44. namespace protobuf_unittest {
  45. // ===================================================================
  46. void TestLiteImportsNonlite::InitAsDefaultInstance() {
  47. ::protobuf_unittest::_TestLiteImportsNonlite_default_instance_._instance.get_mutable()->message_ = const_cast< ::protobuf_unittest::TestAllTypes*>(
  48. ::protobuf_unittest::TestAllTypes::internal_default_instance());
  49. ::protobuf_unittest::_TestLiteImportsNonlite_default_instance_._instance.get_mutable()->message_with_required_ = const_cast< ::protobuf_unittest::TestRequired*>(
  50. ::protobuf_unittest::TestRequired::internal_default_instance());
  51. }
  52. void TestLiteImportsNonlite::clear_message() {
  53. if (message_ != NULL) message_->Clear();
  54. clear_has_message();
  55. }
  56. void TestLiteImportsNonlite::clear_message_with_required() {
  57. if (message_with_required_ != NULL) message_with_required_->Clear();
  58. clear_has_message_with_required();
  59. }
  60. #if !defined(_MSC_VER) || _MSC_VER >= 1900
  61. const int TestLiteImportsNonlite::kMessageFieldNumber;
  62. const int TestLiteImportsNonlite::kMessageWithRequiredFieldNumber;
  63. #endif // !defined(_MSC_VER) || _MSC_VER >= 1900
  64. TestLiteImportsNonlite::TestLiteImportsNonlite()
  65. : ::google::protobuf::MessageLite(), _internal_metadata_(NULL) {
  66. ::google::protobuf::internal::InitSCC(
  67. &protobuf_google_2fprotobuf_2funittest_5flite_5fimports_5fnonlite_2eproto::scc_info_TestLiteImportsNonlite.base);
  68. SharedCtor();
  69. // @@protoc_insertion_point(constructor:protobuf_unittest.TestLiteImportsNonlite)
  70. }
  71. TestLiteImportsNonlite::TestLiteImportsNonlite(const TestLiteImportsNonlite& from)
  72. : ::google::protobuf::MessageLite(),
  73. _internal_metadata_(NULL),
  74. _has_bits_(from._has_bits_) {
  75. _internal_metadata_.MergeFrom(from._internal_metadata_);
  76. if (from.has_message()) {
  77. message_ = new ::protobuf_unittest::TestAllTypes(*from.message_);
  78. } else {
  79. message_ = NULL;
  80. }
  81. if (from.has_message_with_required()) {
  82. message_with_required_ = new ::protobuf_unittest::TestRequired(*from.message_with_required_);
  83. } else {
  84. message_with_required_ = NULL;
  85. }
  86. // @@protoc_insertion_point(copy_constructor:protobuf_unittest.TestLiteImportsNonlite)
  87. }
  88. void TestLiteImportsNonlite::SharedCtor() {
  89. ::memset(&message_, 0, static_cast<size_t>(
  90. reinterpret_cast<char*>(&message_with_required_) -
  91. reinterpret_cast<char*>(&message_)) + sizeof(message_with_required_));
  92. }
  93. TestLiteImportsNonlite::~TestLiteImportsNonlite() {
  94. // @@protoc_insertion_point(destructor:protobuf_unittest.TestLiteImportsNonlite)
  95. SharedDtor();
  96. }
  97. void TestLiteImportsNonlite::SharedDtor() {
  98. if (this != internal_default_instance()) delete message_;
  99. if (this != internal_default_instance()) delete message_with_required_;
  100. }
  101. void TestLiteImportsNonlite::SetCachedSize(int size) const {
  102. _cached_size_.Set(size);
  103. }
  104. const TestLiteImportsNonlite& TestLiteImportsNonlite::default_instance() {
  105. ::google::protobuf::internal::InitSCC(&protobuf_google_2fprotobuf_2funittest_5flite_5fimports_5fnonlite_2eproto::scc_info_TestLiteImportsNonlite.base);
  106. return *internal_default_instance();
  107. }
  108. void TestLiteImportsNonlite::Clear() {
  109. // @@protoc_insertion_point(message_clear_start:protobuf_unittest.TestLiteImportsNonlite)
  110. ::google::protobuf::uint32 cached_has_bits = 0;
  111. // Prevent compiler warnings about cached_has_bits being unused
  112. (void) cached_has_bits;
  113. cached_has_bits = _has_bits_[0];
  114. if (cached_has_bits & 3u) {
  115. if (cached_has_bits & 0x00000001u) {
  116. GOOGLE_DCHECK(message_ != NULL);
  117. message_->Clear();
  118. }
  119. if (cached_has_bits & 0x00000002u) {
  120. GOOGLE_DCHECK(message_with_required_ != NULL);
  121. message_with_required_->Clear();
  122. }
  123. }
  124. _has_bits_.Clear();
  125. _internal_metadata_.Clear();
  126. }
  127. bool TestLiteImportsNonlite::MergePartialFromCodedStream(
  128. ::google::protobuf::io::CodedInputStream* input) {
  129. #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  130. ::google::protobuf::uint32 tag;
  131. ::google::protobuf::internal::LiteUnknownFieldSetter unknown_fields_setter(
  132. &_internal_metadata_);
  133. ::google::protobuf::io::StringOutputStream unknown_fields_output(
  134. unknown_fields_setter.buffer());
  135. ::google::protobuf::io::CodedOutputStream unknown_fields_stream(
  136. &unknown_fields_output, false);
  137. // @@protoc_insertion_point(parse_start:protobuf_unittest.TestLiteImportsNonlite)
  138. for (;;) {
  139. ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
  140. tag = p.first;
  141. if (!p.second) goto handle_unusual;
  142. switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
  143. // optional .protobuf_unittest.TestAllTypes message = 1;
  144. case 1: {
  145. if (static_cast< ::google::protobuf::uint8>(tag) ==
  146. static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
  147. DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
  148. input, mutable_message()));
  149. } else {
  150. goto handle_unusual;
  151. }
  152. break;
  153. }
  154. // optional .protobuf_unittest.TestRequired message_with_required = 2;
  155. case 2: {
  156. if (static_cast< ::google::protobuf::uint8>(tag) ==
  157. static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
  158. DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
  159. input, mutable_message_with_required()));
  160. } else {
  161. goto handle_unusual;
  162. }
  163. break;
  164. }
  165. default: {
  166. handle_unusual:
  167. if (tag == 0) {
  168. goto success;
  169. }
  170. DO_(::google::protobuf::internal::WireFormatLite::SkipField(
  171. input, tag, &unknown_fields_stream));
  172. break;
  173. }
  174. }
  175. }
  176. success:
  177. // @@protoc_insertion_point(parse_success:protobuf_unittest.TestLiteImportsNonlite)
  178. return true;
  179. failure:
  180. // @@protoc_insertion_point(parse_failure:protobuf_unittest.TestLiteImportsNonlite)
  181. return false;
  182. #undef DO_
  183. }
  184. void TestLiteImportsNonlite::SerializeWithCachedSizes(
  185. ::google::protobuf::io::CodedOutputStream* output) const {
  186. // @@protoc_insertion_point(serialize_start:protobuf_unittest.TestLiteImportsNonlite)
  187. ::google::protobuf::uint32 cached_has_bits = 0;
  188. (void) cached_has_bits;
  189. cached_has_bits = _has_bits_[0];
  190. // optional .protobuf_unittest.TestAllTypes message = 1;
  191. if (cached_has_bits & 0x00000001u) {
  192. ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
  193. 1, this->_internal_message(), output);
  194. }
  195. // optional .protobuf_unittest.TestRequired message_with_required = 2;
  196. if (cached_has_bits & 0x00000002u) {
  197. ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
  198. 2, this->_internal_message_with_required(), output);
  199. }
  200. output->WriteRaw(_internal_metadata_.unknown_fields().data(),
  201. static_cast<int>(_internal_metadata_.unknown_fields().size()));
  202. // @@protoc_insertion_point(serialize_end:protobuf_unittest.TestLiteImportsNonlite)
  203. }
  204. size_t TestLiteImportsNonlite::ByteSizeLong() const {
  205. // @@protoc_insertion_point(message_byte_size_start:protobuf_unittest.TestLiteImportsNonlite)
  206. size_t total_size = 0;
  207. total_size += _internal_metadata_.unknown_fields().size();
  208. if (_has_bits_[0 / 32] & 3u) {
  209. // optional .protobuf_unittest.TestAllTypes message = 1;
  210. if (has_message()) {
  211. total_size += 1 +
  212. ::google::protobuf::internal::WireFormatLite::MessageSize(
  213. *message_);
  214. }
  215. // optional .protobuf_unittest.TestRequired message_with_required = 2;
  216. if (has_message_with_required()) {
  217. total_size += 1 +
  218. ::google::protobuf::internal::WireFormatLite::MessageSize(
  219. *message_with_required_);
  220. }
  221. }
  222. int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
  223. SetCachedSize(cached_size);
  224. return total_size;
  225. }
  226. void TestLiteImportsNonlite::CheckTypeAndMergeFrom(
  227. const ::google::protobuf::MessageLite& from) {
  228. MergeFrom(*::google::protobuf::down_cast<const TestLiteImportsNonlite*>(&from));
  229. }
  230. void TestLiteImportsNonlite::MergeFrom(const TestLiteImportsNonlite& from) {
  231. // @@protoc_insertion_point(class_specific_merge_from_start:protobuf_unittest.TestLiteImportsNonlite)
  232. GOOGLE_DCHECK_NE(&from, this);
  233. _internal_metadata_.MergeFrom(from._internal_metadata_);
  234. ::google::protobuf::uint32 cached_has_bits = 0;
  235. (void) cached_has_bits;
  236. cached_has_bits = from._has_bits_[0];
  237. if (cached_has_bits & 3u) {
  238. if (cached_has_bits & 0x00000001u) {
  239. mutable_message()->::protobuf_unittest::TestAllTypes::MergeFrom(from.message());
  240. }
  241. if (cached_has_bits & 0x00000002u) {
  242. mutable_message_with_required()->::protobuf_unittest::TestRequired::MergeFrom(from.message_with_required());
  243. }
  244. }
  245. }
  246. void TestLiteImportsNonlite::CopyFrom(const TestLiteImportsNonlite& from) {
  247. // @@protoc_insertion_point(class_specific_copy_from_start:protobuf_unittest.TestLiteImportsNonlite)
  248. if (&from == this) return;
  249. Clear();
  250. MergeFrom(from);
  251. }
  252. bool TestLiteImportsNonlite::IsInitialized() const {
  253. if (has_message_with_required()) {
  254. if (!this->message_with_required_->IsInitialized()) return false;
  255. }
  256. return true;
  257. }
  258. void TestLiteImportsNonlite::Swap(TestLiteImportsNonlite* other) {
  259. if (other == this) return;
  260. InternalSwap(other);
  261. }
  262. void TestLiteImportsNonlite::InternalSwap(TestLiteImportsNonlite* other) {
  263. using std::swap;
  264. swap(message_, other->message_);
  265. swap(message_with_required_, other->message_with_required_);
  266. swap(_has_bits_[0], other->_has_bits_[0]);
  267. _internal_metadata_.Swap(&other->_internal_metadata_);
  268. }
  269. ::std::string TestLiteImportsNonlite::GetTypeName() const {
  270. return "protobuf_unittest.TestLiteImportsNonlite";
  271. }
  272. // @@protoc_insertion_point(namespace_scope)
  273. } // namespace protobuf_unittest
  274. namespace google {
  275. namespace protobuf {
  276. template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::protobuf_unittest::TestLiteImportsNonlite* Arena::CreateMaybeMessage< ::protobuf_unittest::TestLiteImportsNonlite >(Arena* arena) {
  277. return Arena::CreateInternal< ::protobuf_unittest::TestLiteImportsNonlite >(arena);
  278. }
  279. } // namespace protobuf
  280. } // namespace google
  281. // @@protoc_insertion_point(global_scope)