mutation.nanopb.cc 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. /*
  2. * Copyright 2024 Google LLC
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. /* Automatically generated nanopb constant definitions */
  17. /* Generated by nanopb-0.3.9.8 */
  18. #include "mutation.nanopb.h"
  19. #include "Firestore/core/src/nanopb/pretty_printing.h"
  20. namespace firebase {
  21. namespace firestore {
  22. using nanopb::PrintEnumField;
  23. using nanopb::PrintHeader;
  24. using nanopb::PrintMessageField;
  25. using nanopb::PrintPrimitiveField;
  26. using nanopb::PrintTail;
  27. /* @@protoc_insertion_point(includes) */
  28. #if PB_PROTO_HEADER_VERSION != 30
  29. #error Regenerate this file with the current version of nanopb generator.
  30. #endif
  31. const pb_field_t firestore_client_MutationQueue_fields[3] = {
  32. PB_FIELD( 1, INT32 , SINGULAR, STATIC , FIRST, firestore_client_MutationQueue, last_acknowledged_batch_id, last_acknowledged_batch_id, 0),
  33. PB_FIELD( 2, BYTES , SINGULAR, POINTER , OTHER, firestore_client_MutationQueue, last_stream_token, last_acknowledged_batch_id, 0),
  34. PB_LAST_FIELD
  35. };
  36. const pb_field_t firestore_client_WriteBatch_fields[5] = {
  37. PB_FIELD( 1, INT32 , SINGULAR, STATIC , FIRST, firestore_client_WriteBatch, batch_id, batch_id, 0),
  38. PB_FIELD( 2, MESSAGE , REPEATED, POINTER , OTHER, firestore_client_WriteBatch, writes, batch_id, &google_firestore_v1_Write_fields),
  39. PB_FIELD( 3, MESSAGE , SINGULAR, STATIC , OTHER, firestore_client_WriteBatch, local_write_time, writes, &google_protobuf_Timestamp_fields),
  40. PB_FIELD( 4, MESSAGE , REPEATED, POINTER , OTHER, firestore_client_WriteBatch, base_writes, local_write_time, &google_firestore_v1_Write_fields),
  41. PB_LAST_FIELD
  42. };
  43. /* Check that field information fits in pb_field_t */
  44. #if !defined(PB_FIELD_32BIT)
  45. /* If you get an error here, it means that you need to define PB_FIELD_32BIT
  46. * compile-time option. You can do that in pb.h or on compiler command line.
  47. *
  48. * The reason you need to do this is that some of your messages contain tag
  49. * numbers or field sizes that are larger than what can fit in 8 or 16 bit
  50. * field descriptors.
  51. */
  52. PB_STATIC_ASSERT((pb_membersize(firestore_client_WriteBatch, local_write_time) < 65536), YOU_MUST_DEFINE_PB_FIELD_32BIT_FOR_MESSAGES_firestore_client_MutationQueue_firestore_client_WriteBatch)
  53. #endif
  54. #if !defined(PB_FIELD_16BIT) && !defined(PB_FIELD_32BIT)
  55. /* If you get an error here, it means that you need to define PB_FIELD_16BIT
  56. * compile-time option. You can do that in pb.h or on compiler command line.
  57. *
  58. * The reason you need to do this is that some of your messages contain tag
  59. * numbers or field sizes that are larger than what can fit in the default
  60. * 8 bit descriptors.
  61. */
  62. PB_STATIC_ASSERT((pb_membersize(firestore_client_WriteBatch, local_write_time) < 256), YOU_MUST_DEFINE_PB_FIELD_16BIT_FOR_MESSAGES_firestore_client_MutationQueue_firestore_client_WriteBatch)
  63. #endif
  64. std::string firestore_client_MutationQueue::ToString(int indent) const {
  65. std::string tostring_header = PrintHeader(indent, "MutationQueue", this);
  66. std::string tostring_result;
  67. tostring_result += PrintPrimitiveField("last_acknowledged_batch_id: ",
  68. last_acknowledged_batch_id, indent + 1, false);
  69. tostring_result += PrintPrimitiveField("last_stream_token: ",
  70. last_stream_token, indent + 1, false);
  71. bool is_root = indent == 0;
  72. if (!tostring_result.empty() || is_root) {
  73. std::string tostring_tail = PrintTail(indent);
  74. return tostring_header + tostring_result + tostring_tail;
  75. } else {
  76. return "";
  77. }
  78. }
  79. std::string firestore_client_WriteBatch::ToString(int indent) const {
  80. std::string tostring_header = PrintHeader(indent, "WriteBatch", this);
  81. std::string tostring_result;
  82. tostring_result += PrintPrimitiveField("batch_id: ",
  83. batch_id, indent + 1, false);
  84. for (pb_size_t i = 0; i != writes_count; ++i) {
  85. tostring_result += PrintMessageField("writes ",
  86. writes[i], indent + 1, true);
  87. }
  88. tostring_result += PrintMessageField("local_write_time ",
  89. local_write_time, indent + 1, false);
  90. for (pb_size_t i = 0; i != base_writes_count; ++i) {
  91. tostring_result += PrintMessageField("base_writes ",
  92. base_writes[i], indent + 1, true);
  93. }
  94. std::string tostring_tail = PrintTail(indent);
  95. return tostring_header + tostring_result + tostring_tail;
  96. }
  97. } // namespace firestore
  98. } // namespace firebase
  99. /* @@protoc_insertion_point(eof) */