target.nanopb.cc 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  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 "target.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_Target_fields[8] = {
  32. PB_FIELD( 1, INT32 , SINGULAR, STATIC , FIRST, firestore_client_Target, target_id, target_id, 0),
  33. PB_FIELD( 2, MESSAGE , SINGULAR, STATIC , OTHER, firestore_client_Target, snapshot_version, target_id, &google_protobuf_Timestamp_fields),
  34. PB_FIELD( 3, BYTES , SINGULAR, POINTER , OTHER, firestore_client_Target, resume_token, snapshot_version, 0),
  35. PB_FIELD( 4, INT64 , SINGULAR, STATIC , OTHER, firestore_client_Target, last_listen_sequence_number, resume_token, 0),
  36. PB_ANONYMOUS_ONEOF_FIELD(target_type, 5, MESSAGE , ONEOF, STATIC , OTHER, firestore_client_Target, query, last_listen_sequence_number, &google_firestore_v1_Target_QueryTarget_fields),
  37. PB_ANONYMOUS_ONEOF_FIELD(target_type, 6, MESSAGE , ONEOF, STATIC , UNION, firestore_client_Target, documents, last_listen_sequence_number, &google_firestore_v1_Target_DocumentsTarget_fields),
  38. PB_FIELD( 7, MESSAGE , SINGULAR, STATIC , OTHER, firestore_client_Target, last_limbo_free_snapshot_version, documents, &google_protobuf_Timestamp_fields),
  39. PB_LAST_FIELD
  40. };
  41. const pb_field_t firestore_client_TargetGlobal_fields[5] = {
  42. PB_FIELD( 1, INT32 , SINGULAR, STATIC , FIRST, firestore_client_TargetGlobal, highest_target_id, highest_target_id, 0),
  43. PB_FIELD( 2, INT64 , SINGULAR, STATIC , OTHER, firestore_client_TargetGlobal, highest_listen_sequence_number, highest_target_id, 0),
  44. PB_FIELD( 3, MESSAGE , SINGULAR, STATIC , OTHER, firestore_client_TargetGlobal, last_remote_snapshot_version, highest_listen_sequence_number, &google_protobuf_Timestamp_fields),
  45. PB_FIELD( 4, INT32 , SINGULAR, STATIC , OTHER, firestore_client_TargetGlobal, target_count, last_remote_snapshot_version, 0),
  46. PB_LAST_FIELD
  47. };
  48. /* Check that field information fits in pb_field_t */
  49. #if !defined(PB_FIELD_32BIT)
  50. /* If you get an error here, it means that you need to define PB_FIELD_32BIT
  51. * compile-time option. You can do that in pb.h or on compiler command line.
  52. *
  53. * The reason you need to do this is that some of your messages contain tag
  54. * numbers or field sizes that are larger than what can fit in 8 or 16 bit
  55. * field descriptors.
  56. */
  57. PB_STATIC_ASSERT((pb_membersize(firestore_client_Target, query) < 65536 && pb_membersize(firestore_client_Target, documents) < 65536 && pb_membersize(firestore_client_Target, snapshot_version) < 65536 && pb_membersize(firestore_client_Target, last_limbo_free_snapshot_version) < 65536 && pb_membersize(firestore_client_TargetGlobal, last_remote_snapshot_version) < 65536), YOU_MUST_DEFINE_PB_FIELD_32BIT_FOR_MESSAGES_firestore_client_Target_firestore_client_TargetGlobal)
  58. #endif
  59. #if !defined(PB_FIELD_16BIT) && !defined(PB_FIELD_32BIT)
  60. /* If you get an error here, it means that you need to define PB_FIELD_16BIT
  61. * compile-time option. You can do that in pb.h or on compiler command line.
  62. *
  63. * The reason you need to do this is that some of your messages contain tag
  64. * numbers or field sizes that are larger than what can fit in the default
  65. * 8 bit descriptors.
  66. */
  67. PB_STATIC_ASSERT((pb_membersize(firestore_client_Target, query) < 256 && pb_membersize(firestore_client_Target, documents) < 256 && pb_membersize(firestore_client_Target, snapshot_version) < 256 && pb_membersize(firestore_client_Target, last_limbo_free_snapshot_version) < 256 && pb_membersize(firestore_client_TargetGlobal, last_remote_snapshot_version) < 256), YOU_MUST_DEFINE_PB_FIELD_16BIT_FOR_MESSAGES_firestore_client_Target_firestore_client_TargetGlobal)
  68. #endif
  69. std::string firestore_client_Target::ToString(int indent) const {
  70. std::string tostring_header = PrintHeader(indent, "Target", this);
  71. std::string tostring_result;
  72. tostring_result += PrintPrimitiveField("target_id: ",
  73. target_id, indent + 1, false);
  74. tostring_result += PrintMessageField("snapshot_version ",
  75. snapshot_version, indent + 1, false);
  76. tostring_result += PrintPrimitiveField("resume_token: ",
  77. resume_token, indent + 1, false);
  78. tostring_result += PrintPrimitiveField("last_listen_sequence_number: ",
  79. last_listen_sequence_number, indent + 1, false);
  80. switch (which_target_type) {
  81. case firestore_client_Target_query_tag:
  82. tostring_result += PrintMessageField("query ",
  83. query, indent + 1, true);
  84. break;
  85. case firestore_client_Target_documents_tag:
  86. tostring_result += PrintMessageField("documents ",
  87. documents, indent + 1, true);
  88. break;
  89. }
  90. tostring_result += PrintMessageField("last_limbo_free_snapshot_version ",
  91. last_limbo_free_snapshot_version, indent + 1, false);
  92. std::string tostring_tail = PrintTail(indent);
  93. return tostring_header + tostring_result + tostring_tail;
  94. }
  95. std::string firestore_client_TargetGlobal::ToString(int indent) const {
  96. std::string tostring_header = PrintHeader(indent, "TargetGlobal", this);
  97. std::string tostring_result;
  98. tostring_result += PrintPrimitiveField("highest_target_id: ",
  99. highest_target_id, indent + 1, false);
  100. tostring_result += PrintPrimitiveField("highest_listen_sequence_number: ",
  101. highest_listen_sequence_number, indent + 1, false);
  102. tostring_result += PrintMessageField("last_remote_snapshot_version ",
  103. last_remote_snapshot_version, indent + 1, false);
  104. tostring_result += PrintPrimitiveField("target_count: ",
  105. target_count, indent + 1, false);
  106. std::string tostring_tail = PrintTail(indent);
  107. return tostring_header + tostring_result + tostring_tail;
  108. }
  109. } // namespace firestore
  110. } // namespace firebase
  111. /* @@protoc_insertion_point(eof) */