simpletest.pb.cc 15 KB

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