protovalidate 0.1.0.beta1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1827) hide show
  1. checksums.yaml +7 -0
  2. data/.yardopts +8 -0
  3. data/CHANGELOG.md +5 -0
  4. data/LICENSE.txt +201 -0
  5. data/NOTICE.md +30 -0
  6. data/README.md +93 -0
  7. data/Rakefile +32 -0
  8. data/ext/protovalidate/Cargo.lock +342 -0
  9. data/ext/protovalidate/Cargo.toml +27 -0
  10. data/ext/protovalidate/build.rs +4 -0
  11. data/ext/protovalidate/extconf.rb +8 -0
  12. data/ext/protovalidate/src/lib.rs +161 -0
  13. data/ext/protovalidate/sys/Cargo.toml +11 -0
  14. data/ext/protovalidate/sys/build.rs +218 -0
  15. data/ext/protovalidate/sys/filelists/absl.txt +126 -0
  16. data/ext/protovalidate/sys/filelists/antlr4.txt +139 -0
  17. data/ext/protovalidate/sys/filelists/celcpp.txt +199 -0
  18. data/ext/protovalidate/sys/filelists/protobuf.txt +83 -0
  19. data/ext/protovalidate/sys/filelists/protovalidate.txt +14 -0
  20. data/ext/protovalidate/sys/filelists/re2.txt +25 -0
  21. data/ext/protovalidate/sys/gen/buf/validate/validate.pb.cc +23621 -0
  22. data/ext/protovalidate/sys/gen/buf/validate/validate.pb.h +27800 -0
  23. data/ext/protovalidate/sys/gen/cel/expr/checked.pb.cc +6286 -0
  24. data/ext/protovalidate/sys/gen/cel/expr/checked.pb.h +6412 -0
  25. data/ext/protovalidate/sys/gen/cel/expr/syntax.pb.cc +7423 -0
  26. data/ext/protovalidate/sys/gen/cel/expr/syntax.pb.h +7510 -0
  27. data/ext/protovalidate/sys/gen/cel/expr/value.pb.cc +2512 -0
  28. data/ext/protovalidate/sys/gen/cel/expr/value.pb.h +2589 -0
  29. data/ext/protovalidate/sys/gen/internal/empty_descriptor_set_embed.inc +1 -0
  30. data/ext/protovalidate/sys/gen/parser/internal/CelBaseVisitor.cpp +9 -0
  31. data/ext/protovalidate/sys/gen/parser/internal/CelBaseVisitor.h +167 -0
  32. data/ext/protovalidate/sys/gen/parser/internal/CelLexer.cpp +308 -0
  33. data/ext/protovalidate/sys/gen/parser/internal/CelLexer.h +57 -0
  34. data/ext/protovalidate/sys/gen/parser/internal/CelParser.cpp +2484 -0
  35. data/ext/protovalidate/sys/gen/parser/internal/CelParser.h +697 -0
  36. data/ext/protovalidate/sys/gen/parser/internal/CelVisitor.cpp +9 -0
  37. data/ext/protovalidate/sys/gen/parser/internal/CelVisitor.h +98 -0
  38. data/ext/protovalidate/sys/shim/pv_shim.cc +260 -0
  39. data/ext/protovalidate/sys/shim/pv_shim.h +84 -0
  40. data/ext/protovalidate/sys/src/lib.rs +176 -0
  41. data/ext/protovalidate/sys/third_party/abseil-cpp/LICENSE +203 -0
  42. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/algorithm/algorithm.h +96 -0
  43. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/algorithm/container.h +2011 -0
  44. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/base/attributes.h +1100 -0
  45. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/base/call_once.h +228 -0
  46. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/base/casts.cc +61 -0
  47. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/base/casts.h +313 -0
  48. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/base/config.h +898 -0
  49. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/base/const_init.h +76 -0
  50. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/base/dynamic_annotations.h +480 -0
  51. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/base/fast_type_id.h +73 -0
  52. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/base/internal/atomic_hook.h +200 -0
  53. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/base/internal/atomic_hook_test_helper.h +34 -0
  54. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/base/internal/cycleclock.cc +72 -0
  55. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/base/internal/cycleclock.h +144 -0
  56. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/base/internal/cycleclock_config.h +55 -0
  57. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/base/internal/direct_mmap.h +170 -0
  58. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/base/internal/dynamic_annotations.h +398 -0
  59. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/base/internal/endian.h +279 -0
  60. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/base/internal/errno_saver.h +43 -0
  61. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/base/internal/exception_safety_testing.h +1112 -0
  62. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/base/internal/exception_testing.h +42 -0
  63. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/base/internal/hardening.h +136 -0
  64. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/base/internal/hide_ptr.h +51 -0
  65. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/base/internal/iterator_traits.h +75 -0
  66. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/base/internal/iterator_traits_test_helper.h +97 -0
  67. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/base/internal/low_level_alloc.cc +667 -0
  68. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/base/internal/low_level_alloc.h +133 -0
  69. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/base/internal/low_level_scheduling.h +196 -0
  70. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/base/internal/nullability_traits.h +71 -0
  71. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/base/internal/per_thread_tls.h +52 -0
  72. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/base/internal/poison.h +59 -0
  73. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/base/internal/pretty_function.h +33 -0
  74. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/base/internal/raw_logging.cc +279 -0
  75. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/base/internal/raw_logging.h +217 -0
  76. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/base/internal/scheduling_mode.h +58 -0
  77. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/base/internal/scoped_set_env.h +45 -0
  78. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/base/internal/spinlock.cc +225 -0
  79. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/base/internal/spinlock.h +310 -0
  80. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/base/internal/spinlock_akaros.inc +35 -0
  81. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/base/internal/spinlock_linux.inc +71 -0
  82. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/base/internal/spinlock_posix.inc +46 -0
  83. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/base/internal/spinlock_wait.cc +81 -0
  84. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/base/internal/spinlock_wait.h +95 -0
  85. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/base/internal/spinlock_win32.inc +40 -0
  86. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/base/internal/strerror.cc +88 -0
  87. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/base/internal/strerror.h +39 -0
  88. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/base/internal/sysinfo.cc +493 -0
  89. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/base/internal/sysinfo.h +74 -0
  90. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/base/internal/thread_identity.cc +163 -0
  91. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/base/internal/thread_identity.h +325 -0
  92. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/base/internal/tracing.cc +39 -0
  93. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/base/internal/tracing.h +81 -0
  94. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/base/internal/tsan_mutex_interface.h +68 -0
  95. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/base/internal/unaligned_access.h +89 -0
  96. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.cc +134 -0
  97. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.h +118 -0
  98. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock_config.h +62 -0
  99. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/base/log_severity.cc +56 -0
  100. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/base/log_severity.h +185 -0
  101. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/base/macros.h +259 -0
  102. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/base/no_destructor.h +191 -0
  103. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/base/nullability.h +318 -0
  104. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/base/optimization.h +311 -0
  105. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/base/options.h +212 -0
  106. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/base/policy_checks.h +115 -0
  107. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/base/port.h +25 -0
  108. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/base/prefetch.h +209 -0
  109. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/base/thread_annotations.h +333 -0
  110. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/base/throw_delegate.cc +205 -0
  111. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/base/throw_delegate.h +65 -0
  112. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/cleanup/cleanup.h +143 -0
  113. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/cleanup/internal/cleanup.h +100 -0
  114. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/container/btree_map.h +941 -0
  115. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/container/btree_set.h +872 -0
  116. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/container/chunked_queue.h +757 -0
  117. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/container/fixed_array.h +548 -0
  118. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/container/flat_hash_map.h +714 -0
  119. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/container/flat_hash_set.h +604 -0
  120. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/container/hash_container_defaults.h +45 -0
  121. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/container/inlined_vector.h +1025 -0
  122. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/container/internal/btree.h +3157 -0
  123. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/container/internal/btree_container.h +875 -0
  124. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/container/internal/chunked_queue.h +173 -0
  125. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/container/internal/common.h +302 -0
  126. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/container/internal/common_policy_traits.h +151 -0
  127. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/container/internal/compressed_tuple.h +275 -0
  128. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/container/internal/container_memory.h +571 -0
  129. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/container/internal/hash_function_defaults.h +281 -0
  130. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/container/internal/hash_generator_testing.h +172 -0
  131. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/container/internal/hash_policy_testing.h +173 -0
  132. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/container/internal/hash_policy_traits.h +195 -0
  133. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/container/internal/hashtable_control_bytes.h +527 -0
  134. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/container/internal/hashtable_debug.h +102 -0
  135. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/container/internal/hashtable_debug_hooks.h +85 -0
  136. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/container/internal/hashtablez_sampler.cc +316 -0
  137. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/container/internal/hashtablez_sampler.h +294 -0
  138. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/container/internal/hashtablez_sampler_force_weak_definition.cc +31 -0
  139. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/container/internal/heterogeneous_lookup_testing.h +80 -0
  140. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/container/internal/inlined_vector.h +1094 -0
  141. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/container/internal/layout.h +828 -0
  142. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/container/internal/node_slot_policy.h +95 -0
  143. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/container/internal/raw_hash_map.h +380 -0
  144. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/container/internal/raw_hash_set.cc +2110 -0
  145. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/container/internal/raw_hash_set.h +4056 -0
  146. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/container/internal/raw_hash_set_resize_impl.h +79 -0
  147. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/container/internal/test_allocator.h +387 -0
  148. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/container/internal/test_instance_tracker.h +274 -0
  149. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/container/internal/tracked.h +83 -0
  150. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/container/linked_hash_map.h +666 -0
  151. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/container/linked_hash_set.h +527 -0
  152. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/container/node_hash_map.h +710 -0
  153. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/container/node_hash_set.h +603 -0
  154. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/crc/crc32c.cc +95 -0
  155. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/crc/crc32c.h +192 -0
  156. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/crc/internal/cpu_detect.cc +359 -0
  157. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/crc/internal/cpu_detect.h +69 -0
  158. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/crc/internal/crc.cc +435 -0
  159. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/crc/internal/crc.h +83 -0
  160. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/crc/internal/crc32_x86_arm_combined_simd.h +319 -0
  161. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/crc/internal/crc32c.h +39 -0
  162. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/crc/internal/crc32c_inline.h +72 -0
  163. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/crc/internal/crc_cord_state.cc +131 -0
  164. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/crc/internal/crc_cord_state.h +159 -0
  165. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/crc/internal/crc_internal.h +161 -0
  166. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/crc/internal/crc_memcpy.h +122 -0
  167. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/crc/internal/crc_memcpy_fallback.cc +78 -0
  168. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/crc/internal/crc_memcpy_x86_arm_combined.cc +459 -0
  169. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/crc/internal/crc_non_temporal_memcpy.cc +93 -0
  170. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/crc/internal/crc_x86_arm_combined.cc +824 -0
  171. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/crc/internal/non_temporal_arm_intrinsics.h +81 -0
  172. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/crc/internal/non_temporal_memcpy.h +195 -0
  173. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/debugging/failure_signal_handler.h +121 -0
  174. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/debugging/internal/address_is_readable.cc +98 -0
  175. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/debugging/internal/address_is_readable.h +32 -0
  176. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/debugging/internal/addresses.h +57 -0
  177. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/debugging/internal/bounded_utf8_length_sequence.h +126 -0
  178. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/debugging/internal/decode_rust_punycode.cc +258 -0
  179. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/debugging/internal/decode_rust_punycode.h +55 -0
  180. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/debugging/internal/demangle.cc +2958 -0
  181. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/debugging/internal/demangle.h +76 -0
  182. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/debugging/internal/demangle_rust.cc +925 -0
  183. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/debugging/internal/demangle_rust.h +50 -0
  184. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/debugging/internal/elf_mem_image.cc +413 -0
  185. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/debugging/internal/elf_mem_image.h +141 -0
  186. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/debugging/internal/examine_stack.cc +334 -0
  187. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/debugging/internal/examine_stack.h +70 -0
  188. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/debugging/internal/stack_consumption.h +50 -0
  189. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/debugging/internal/stacktrace_aarch64-inl.inc +299 -0
  190. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/debugging/internal/stacktrace_arm-inl.inc +148 -0
  191. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/debugging/internal/stacktrace_config.h +96 -0
  192. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/debugging/internal/stacktrace_emscripten-inl.inc +121 -0
  193. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/debugging/internal/stacktrace_generic-inl.inc +121 -0
  194. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/debugging/internal/stacktrace_powerpc-inl.inc +270 -0
  195. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/debugging/internal/stacktrace_riscv-inl.inc +208 -0
  196. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/debugging/internal/stacktrace_unimplemented-inl.inc +25 -0
  197. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/debugging/internal/stacktrace_win32-inl.inc +81 -0
  198. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/debugging/internal/stacktrace_x86-inl.inc +410 -0
  199. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/debugging/internal/symbolize.h +163 -0
  200. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/debugging/internal/utf8_for_code_point.cc +70 -0
  201. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/debugging/internal/utf8_for_code_point.h +47 -0
  202. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/debugging/internal/vdso_support.cc +209 -0
  203. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/debugging/internal/vdso_support.h +158 -0
  204. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/debugging/leak_check.cc +73 -0
  205. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/debugging/leak_check.h +150 -0
  206. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/debugging/stacktrace.cc +204 -0
  207. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/debugging/stacktrace.h +259 -0
  208. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/debugging/symbolize.cc +62 -0
  209. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/debugging/symbolize.h +99 -0
  210. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/debugging/symbolize_darwin.inc +102 -0
  211. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/debugging/symbolize_elf.inc +1708 -0
  212. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/debugging/symbolize_emscripten.inc +63 -0
  213. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/debugging/symbolize_unimplemented.inc +40 -0
  214. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/debugging/symbolize_win32.inc +99 -0
  215. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/flags/commandlineflag.h +220 -0
  216. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/flags/config.h +68 -0
  217. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/flags/declare.h +77 -0
  218. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/flags/flag.h +307 -0
  219. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/flags/internal/commandlineflag.h +68 -0
  220. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/flags/internal/flag.h +969 -0
  221. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/flags/internal/parse.h +70 -0
  222. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/flags/internal/path_util.h +62 -0
  223. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/flags/internal/private_handle_accessor.h +64 -0
  224. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/flags/internal/program_name.h +50 -0
  225. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/flags/internal/registry.h +98 -0
  226. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/flags/internal/sequence_lock.h +187 -0
  227. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/flags/internal/usage.h +106 -0
  228. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/flags/marshalling.h +335 -0
  229. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/flags/parse.h +130 -0
  230. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/flags/reflection.h +90 -0
  231. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/flags/usage.h +43 -0
  232. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/flags/usage_config.h +135 -0
  233. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/functional/any_invocable.h +335 -0
  234. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/functional/bind_back.h +79 -0
  235. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/functional/bind_front.h +200 -0
  236. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/functional/function_ref.h +249 -0
  237. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/functional/internal/any_invocable.h +787 -0
  238. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/functional/internal/back_binder.h +95 -0
  239. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/functional/internal/front_binder.h +93 -0
  240. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/functional/internal/function_ref.h +151 -0
  241. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/functional/overload.h +72 -0
  242. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/hash/hash.h +466 -0
  243. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/hash/hash_testing.h +382 -0
  244. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/hash/internal/city.cc +337 -0
  245. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/hash/internal/city.h +78 -0
  246. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/hash/internal/hash.cc +430 -0
  247. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/hash/internal/hash.h +1619 -0
  248. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/hash/internal/spy_hash_state.h +289 -0
  249. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/hash/internal/weakly_mixed_integer.h +38 -0
  250. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/log/absl_check.h +117 -0
  251. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/log/absl_log.h +115 -0
  252. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/log/absl_vlog_is_on.h +93 -0
  253. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/log/check.h +210 -0
  254. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/log/check_test_impl.inc +1035 -0
  255. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/log/die_if_null.cc +34 -0
  256. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/log/die_if_null.h +97 -0
  257. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/log/flags.h +43 -0
  258. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/log/globals.cc +178 -0
  259. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/log/globals.h +230 -0
  260. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/log/initialize.h +45 -0
  261. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/log/internal/append_truncated.h +75 -0
  262. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/log/internal/check_impl.h +151 -0
  263. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/log/internal/check_op.cc +147 -0
  264. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/log/internal/check_op.h +565 -0
  265. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/log/internal/conditions.cc +85 -0
  266. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/log/internal/conditions.h +247 -0
  267. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/log/internal/config.h +45 -0
  268. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/log/internal/container.h +312 -0
  269. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/log/internal/flags.h +59 -0
  270. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/log/internal/fnmatch.cc +73 -0
  271. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/log/internal/fnmatch.h +35 -0
  272. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/log/internal/globals.cc +145 -0
  273. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/log/internal/globals.h +101 -0
  274. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/log/internal/log_format.cc +205 -0
  275. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/log/internal/log_format.h +78 -0
  276. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/log/internal/log_impl.h +280 -0
  277. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/log/internal/log_message.cc +788 -0
  278. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/log/internal/log_message.h +469 -0
  279. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/log/internal/log_sink_set.cc +296 -0
  280. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/log/internal/log_sink_set.h +54 -0
  281. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/log/internal/nullguard.cc +35 -0
  282. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/log/internal/nullguard.h +88 -0
  283. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/log/internal/nullstream.h +128 -0
  284. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/log/internal/proto.cc +231 -0
  285. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/log/internal/proto.h +298 -0
  286. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/log/internal/strip.h +99 -0
  287. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/log/internal/structured.h +160 -0
  288. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/log/internal/structured_proto.cc +115 -0
  289. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/log/internal/structured_proto.h +108 -0
  290. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/log/internal/test_actions.h +90 -0
  291. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/log/internal/test_helpers.h +71 -0
  292. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/log/internal/test_matchers.h +94 -0
  293. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/log/internal/vlog_config.cc +347 -0
  294. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/log/internal/vlog_config.h +164 -0
  295. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/log/internal/voidify.h +50 -0
  296. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/log/log.h +378 -0
  297. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/log/log_basic_test_impl.inc +654 -0
  298. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/log/log_entry.cc +263 -0
  299. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/log/log_entry.h +223 -0
  300. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/log/log_sink.cc +23 -0
  301. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/log/log_sink.h +71 -0
  302. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/log/log_sink_registry.h +64 -0
  303. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/log/log_streamer.h +208 -0
  304. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/log/scoped_mock_log.h +203 -0
  305. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/log/structured.h +75 -0
  306. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/log/vlog_is_on.h +72 -0
  307. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/memory/memory.h +328 -0
  308. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/meta/internal/constexpr_testing.h +73 -0
  309. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/meta/internal/requires.h +67 -0
  310. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/meta/type_traits.h +646 -0
  311. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/numeric/bits.h +262 -0
  312. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/numeric/int128.cc +344 -0
  313. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/numeric/int128.h +1224 -0
  314. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/numeric/int128_have_intrinsic.inc +303 -0
  315. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/numeric/int128_no_intrinsic.inc +347 -0
  316. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/numeric/internal/bits.h +394 -0
  317. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/numeric/internal/representation.h +55 -0
  318. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/profiling/hashtable.h +40 -0
  319. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/profiling/internal/exponential_biased.cc +93 -0
  320. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/profiling/internal/exponential_biased.h +130 -0
  321. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/profiling/internal/periodic_sampler.h +211 -0
  322. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/profiling/internal/profile_builder.h +161 -0
  323. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/profiling/internal/sample_recorder.h +253 -0
  324. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/random/bernoulli_distribution.h +202 -0
  325. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/random/beta_distribution.h +429 -0
  326. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/random/bit_gen_ref.h +160 -0
  327. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/random/discrete_distribution.h +249 -0
  328. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/random/distributions.h +450 -0
  329. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/random/exponential_distribution.h +166 -0
  330. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/random/gaussian_distribution.h +276 -0
  331. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/random/internal/chi_square.h +89 -0
  332. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/random/internal/distribution_caller.h +83 -0
  333. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/random/internal/distribution_test_util.h +113 -0
  334. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/random/internal/entropy_pool.h +35 -0
  335. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/random/internal/explicit_seed_seq.h +92 -0
  336. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/random/internal/fast_uniform_bits.h +271 -0
  337. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/random/internal/fastmath.h +57 -0
  338. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/random/internal/generate_real.h +144 -0
  339. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/random/internal/iostream_state_saver.h +248 -0
  340. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/random/internal/mock_helpers.h +134 -0
  341. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/random/internal/mock_overload_set.h +122 -0
  342. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/random/internal/mock_validators.h +98 -0
  343. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/random/internal/nanobenchmark.h +172 -0
  344. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/random/internal/nonsecure_base.h +160 -0
  345. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/random/internal/pcg_engine.h +287 -0
  346. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/random/internal/platform.h +158 -0
  347. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/random/internal/randen.h +96 -0
  348. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/random/internal/randen_detect.h +33 -0
  349. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/random/internal/randen_engine.h +265 -0
  350. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/random/internal/randen_hwaes.h +50 -0
  351. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/random/internal/randen_slow.h +40 -0
  352. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/random/internal/randen_traits.h +88 -0
  353. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/random/internal/salted_seed_seq.h +166 -0
  354. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/random/internal/seed_material.h +105 -0
  355. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/random/internal/sequence_urbg.h +60 -0
  356. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/random/internal/traits.h +170 -0
  357. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/random/internal/uniform_helper.h +244 -0
  358. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/random/internal/wide_multiply.h +95 -0
  359. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/random/log_uniform_int_distribution.h +253 -0
  360. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/random/mock_distributions.h +269 -0
  361. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/random/mocking_access.h +74 -0
  362. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/random/mocking_bit_gen.h +227 -0
  363. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/random/poisson_distribution.h +262 -0
  364. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/random/random.h +224 -0
  365. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/random/seed_gen_exception.h +55 -0
  366. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/random/seed_sequences.h +112 -0
  367. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/random/uniform_int_distribution.h +276 -0
  368. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/random/uniform_real_distribution.h +204 -0
  369. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/random/zipf_distribution.h +273 -0
  370. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/status/internal/status_internal.cc +296 -0
  371. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/status/internal/status_internal.h +157 -0
  372. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/status/internal/status_matchers.h +260 -0
  373. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/status/internal/statusor_internal.h +657 -0
  374. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/status/status.cc +413 -0
  375. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/status/status.h +1174 -0
  376. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/status/status_builder.h +978 -0
  377. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/status/status_macros.h +484 -0
  378. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/status/status_matchers.h +167 -0
  379. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/status/status_payload_printer.cc +36 -0
  380. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/status/status_payload_printer.h +53 -0
  381. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/status/statusor.cc +106 -0
  382. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/status/statusor.h +776 -0
  383. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/strings/ascii.cc +296 -0
  384. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/strings/ascii.h +288 -0
  385. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/strings/charconv.cc +1442 -0
  386. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/strings/charconv.h +123 -0
  387. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/strings/charset.h +163 -0
  388. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/strings/cord.cc +1601 -0
  389. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/strings/cord.h +1773 -0
  390. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/strings/cord_analysis.cc +196 -0
  391. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/strings/cord_analysis.h +63 -0
  392. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/strings/cord_buffer.h +574 -0
  393. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/strings/cord_test_helpers.h +122 -0
  394. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/strings/cordz_test_helpers.h +152 -0
  395. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/strings/escaping.cc +1183 -0
  396. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/strings/escaping.h +195 -0
  397. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/strings/has_absl_stringify.h +64 -0
  398. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/strings/has_ostream_operator.h +42 -0
  399. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/strings/internal/append_and_overwrite.h +93 -0
  400. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/strings/internal/charconv_bigint.cc +357 -0
  401. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/strings/internal/charconv_bigint.h +433 -0
  402. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/strings/internal/charconv_parse.cc +504 -0
  403. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/strings/internal/charconv_parse.h +99 -0
  404. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/strings/internal/cord_data_edge.h +63 -0
  405. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/strings/internal/cord_internal.cc +70 -0
  406. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/strings/internal/cord_internal.h +942 -0
  407. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree.cc +1237 -0
  408. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree.h +944 -0
  409. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree_navigator.cc +187 -0
  410. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree_navigator.h +267 -0
  411. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree_reader.cc +69 -0
  412. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree_reader.h +212 -0
  413. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/strings/internal/cord_rep_consume.cc +64 -0
  414. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/strings/internal/cord_rep_consume.h +47 -0
  415. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/strings/internal/cord_rep_crc.cc +56 -0
  416. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/strings/internal/cord_rep_crc.h +103 -0
  417. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/strings/internal/cord_rep_flat.h +195 -0
  418. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/strings/internal/cord_rep_test_util.h +205 -0
  419. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/strings/internal/cordz_functions.cc +102 -0
  420. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/strings/internal/cordz_functions.h +87 -0
  421. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/strings/internal/cordz_handle.cc +165 -0
  422. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/strings/internal/cordz_handle.h +98 -0
  423. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/strings/internal/cordz_info.cc +424 -0
  424. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/strings/internal/cordz_info.h +295 -0
  425. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/strings/internal/cordz_sample_token.h +97 -0
  426. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/strings/internal/cordz_statistics.h +88 -0
  427. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/strings/internal/cordz_update_scope.h +71 -0
  428. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/strings/internal/cordz_update_tracker.h +123 -0
  429. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/strings/internal/damerau_levenshtein_distance.cc +99 -0
  430. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/strings/internal/damerau_levenshtein_distance.h +35 -0
  431. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/strings/internal/escaping.cc +68 -0
  432. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/strings/internal/escaping.h +35 -0
  433. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/strings/internal/escaping_test_common.h +133 -0
  434. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/strings/internal/generic_printer.h +115 -0
  435. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/strings/internal/generic_printer_internal.h +444 -0
  436. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/strings/internal/memutil.cc +48 -0
  437. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/strings/internal/memutil.h +40 -0
  438. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/strings/internal/numbers_test_common.h +184 -0
  439. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/strings/internal/ostringstream.cc +43 -0
  440. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/strings/internal/ostringstream.h +114 -0
  441. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/strings/internal/pow10_helper.h +40 -0
  442. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/strings/internal/resize_uninitialized.h +114 -0
  443. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/strings/internal/stl_type_traits.h +248 -0
  444. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/strings/internal/str_format/arg.cc +615 -0
  445. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/strings/internal/str_format/arg.h +653 -0
  446. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/strings/internal/str_format/bind.cc +275 -0
  447. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/strings/internal/str_format/bind.h +237 -0
  448. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/strings/internal/str_format/checker.h +98 -0
  449. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/strings/internal/str_format/constexpr_parser.h +357 -0
  450. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/strings/internal/str_format/extension.cc +53 -0
  451. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/strings/internal/str_format/extension.h +456 -0
  452. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/strings/internal/str_format/float_conversion.cc +2148 -0
  453. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/strings/internal/str_format/float_conversion.h +37 -0
  454. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/strings/internal/str_format/output.cc +74 -0
  455. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/strings/internal/str_format/output.h +97 -0
  456. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/strings/internal/str_format/parser.cc +140 -0
  457. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/strings/internal/str_format/parser.h +271 -0
  458. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/strings/internal/str_join_internal.h +340 -0
  459. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/strings/internal/str_split_internal.h +524 -0
  460. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/strings/internal/string_constant.h +67 -0
  461. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/strings/internal/stringify_sink.cc +28 -0
  462. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/strings/internal/stringify_sink.h +69 -0
  463. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/strings/internal/stringify_stream.h +119 -0
  464. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/strings/internal/utf8.cc +148 -0
  465. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/strings/internal/utf8.h +64 -0
  466. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/strings/match.cc +133 -0
  467. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/strings/match.h +129 -0
  468. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/strings/numbers.cc +1636 -0
  469. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/strings/numbers.h +363 -0
  470. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/strings/resize_and_overwrite.h +198 -0
  471. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/strings/str_cat.cc +247 -0
  472. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/strings/str_cat.h +668 -0
  473. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/strings/str_format.h +887 -0
  474. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/strings/str_join.h +301 -0
  475. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/strings/str_replace.cc +91 -0
  476. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/strings/str_replace.h +222 -0
  477. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/strings/str_split.cc +144 -0
  478. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/strings/str_split.h +587 -0
  479. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/strings/string_view.h +60 -0
  480. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/strings/strip.h +99 -0
  481. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/strings/substitute.cc +187 -0
  482. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/strings/substitute.h +769 -0
  483. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/synchronization/barrier.cc +52 -0
  484. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/synchronization/barrier.h +79 -0
  485. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/synchronization/blocking_counter.cc +73 -0
  486. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/synchronization/blocking_counter.h +107 -0
  487. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/synchronization/internal/create_thread_identity.cc +173 -0
  488. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/synchronization/internal/create_thread_identity.h +56 -0
  489. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/synchronization/internal/futex.h +177 -0
  490. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/synchronization/internal/futex_waiter.cc +107 -0
  491. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/synchronization/internal/futex_waiter.h +63 -0
  492. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/synchronization/internal/graphcycles.cc +714 -0
  493. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/synchronization/internal/graphcycles.h +146 -0
  494. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/synchronization/internal/kernel_timeout.cc +220 -0
  495. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/synchronization/internal/kernel_timeout.h +178 -0
  496. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/synchronization/internal/per_thread_sem.cc +106 -0
  497. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/synchronization/internal/per_thread_sem.h +124 -0
  498. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/synchronization/internal/pthread_waiter.cc +163 -0
  499. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/synchronization/internal/pthread_waiter.h +60 -0
  500. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/synchronization/internal/sem_waiter.cc +118 -0
  501. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/synchronization/internal/sem_waiter.h +65 -0
  502. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/synchronization/internal/stdcpp_waiter.cc +87 -0
  503. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/synchronization/internal/stdcpp_waiter.h +56 -0
  504. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/synchronization/internal/thread_pool.h +96 -0
  505. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/synchronization/internal/waiter.h +69 -0
  506. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/synchronization/internal/waiter_base.cc +38 -0
  507. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/synchronization/internal/waiter_base.h +90 -0
  508. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/synchronization/internal/win32_waiter.cc +147 -0
  509. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/synchronization/internal/win32_waiter.h +72 -0
  510. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/synchronization/mutex.cc +2833 -0
  511. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/synchronization/mutex.h +1352 -0
  512. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/synchronization/notification.cc +85 -0
  513. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/synchronization/notification.h +133 -0
  514. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/time/civil_time.cc +200 -0
  515. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/time/civil_time.h +589 -0
  516. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/time/clock.cc +603 -0
  517. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/time/clock.h +81 -0
  518. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/time/clock_interface.h +93 -0
  519. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/time/duration.cc +918 -0
  520. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/time/format.cc +155 -0
  521. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/time/internal/cctz/include/cctz/civil_time.h +332 -0
  522. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/time/internal/cctz/include/cctz/civil_time_detail.h +644 -0
  523. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/time/internal/cctz/include/cctz/time_zone.h +460 -0
  524. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/time/internal/cctz/include/cctz/zone_info_source.h +102 -0
  525. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/time/internal/cctz/src/civil_time_detail.cc +94 -0
  526. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/time/internal/cctz/src/test_time_zone_names.h +33 -0
  527. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_fixed.cc +140 -0
  528. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_fixed.h +52 -0
  529. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_format.cc +1069 -0
  530. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_if.cc +47 -0
  531. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_if.h +80 -0
  532. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_impl.cc +115 -0
  533. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_impl.h +97 -0
  534. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_info.cc +1070 -0
  535. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_info.h +128 -0
  536. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_libc.cc +333 -0
  537. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_libc.h +60 -0
  538. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_lookup.cc +217 -0
  539. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_name_win.cc +185 -0
  540. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_name_win.h +37 -0
  541. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_posix.cc +159 -0
  542. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_posix.h +132 -0
  543. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/time/internal/cctz/src/tzfile.h +115 -0
  544. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/time/internal/cctz/src/zone_info_source.cc +116 -0
  545. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/time/internal/get_current_time_chrono.inc +31 -0
  546. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/time/internal/get_current_time_posix.inc +24 -0
  547. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/time/internal/test_util.h +33 -0
  548. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/time/simulated_clock.h +109 -0
  549. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/time/time.cc +507 -0
  550. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/time/time.h +1926 -0
  551. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/types/any.h +66 -0
  552. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/types/any_span.h +1067 -0
  553. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/types/compare.h +506 -0
  554. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/types/internal/any_span.h +477 -0
  555. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/types/internal/span.h +140 -0
  556. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/types/optional.h +68 -0
  557. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/types/optional_ref.h +295 -0
  558. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/types/source_location.cc +18 -0
  559. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/types/source_location.h +172 -0
  560. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/types/span.h +827 -0
  561. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/types/variant.h +139 -0
  562. data/ext/protovalidate/sys/third_party/abseil-cpp/absl/utility/utility.h +151 -0
  563. data/ext/protovalidate/sys/third_party/antlr4/LICENSE.txt +28 -0
  564. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/ANTLRErrorListener.cpp +10 -0
  565. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/ANTLRErrorListener.h +167 -0
  566. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/ANTLRErrorStrategy.cpp +10 -0
  567. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/ANTLRErrorStrategy.h +121 -0
  568. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/ANTLRFileStream.cpp +23 -0
  569. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/ANTLRFileStream.h +30 -0
  570. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/ANTLRInputStream.cpp +180 -0
  571. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/ANTLRInputStream.h +79 -0
  572. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/BailErrorStrategy.cpp +61 -0
  573. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/BailErrorStrategy.h +59 -0
  574. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/BaseErrorListener.cpp +25 -0
  575. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/BaseErrorListener.h +36 -0
  576. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/BufferedTokenStream.cpp +414 -0
  577. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/BufferedTokenStream.h +200 -0
  578. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/CharStream.cpp +11 -0
  579. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/CharStream.h +37 -0
  580. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/CommonToken.cpp +193 -0
  581. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/CommonToken.h +158 -0
  582. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/CommonTokenFactory.cpp +39 -0
  583. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/CommonTokenFactory.h +74 -0
  584. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/CommonTokenStream.cpp +78 -0
  585. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/CommonTokenStream.h +79 -0
  586. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/ConsoleErrorListener.cpp +15 -0
  587. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/ConsoleErrorListener.h +35 -0
  588. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/DefaultErrorStrategy.cpp +336 -0
  589. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/DefaultErrorStrategy.h +466 -0
  590. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/DiagnosticErrorListener.cpp +84 -0
  591. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/DiagnosticErrorListener.h +80 -0
  592. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/Exceptions.cpp +64 -0
  593. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/Exceptions.h +99 -0
  594. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/FailedPredicateException.cpp +52 -0
  595. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/FailedPredicateException.h +32 -0
  596. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/FlatHashMap.h +57 -0
  597. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/FlatHashSet.h +57 -0
  598. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/InputMismatchException.cpp +18 -0
  599. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/InputMismatchException.h +24 -0
  600. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/IntStream.cpp +12 -0
  601. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/IntStream.h +218 -0
  602. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/InterpreterRuleContext.cpp +19 -0
  603. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/InterpreterRuleContext.h +45 -0
  604. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/Lexer.cpp +294 -0
  605. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/Lexer.h +196 -0
  606. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/LexerInterpreter.cpp +60 -0
  607. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/LexerInterpreter.h +46 -0
  608. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/LexerNoViableAltException.cpp +36 -0
  609. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/LexerNoViableAltException.h +31 -0
  610. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/ListTokenSource.cpp +92 -0
  611. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/ListTokenSource.h +88 -0
  612. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/NoViableAltException.cpp +46 -0
  613. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/NoViableAltException.h +42 -0
  614. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/Parser.cpp +670 -0
  615. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/Parser.h +461 -0
  616. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/ParserInterpreter.cpp +294 -0
  617. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/ParserInterpreter.h +173 -0
  618. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/ParserRuleContext.cpp +138 -0
  619. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/ParserRuleContext.h +147 -0
  620. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/ProxyErrorListener.cpp +53 -0
  621. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/ProxyErrorListener.h +38 -0
  622. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/RecognitionException.cpp +65 -0
  623. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/RecognitionException.h +98 -0
  624. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/Recognizer.cpp +157 -0
  625. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/Recognizer.h +160 -0
  626. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/RuleContext.cpp +144 -0
  627. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/RuleContext.h +141 -0
  628. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/RuleContextWithAltNum.cpp +27 -0
  629. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/RuleContextWithAltNum.h +32 -0
  630. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/RuntimeMetaData.cpp +54 -0
  631. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/RuntimeMetaData.h +155 -0
  632. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/Token.cpp +9 -0
  633. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/Token.h +92 -0
  634. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/TokenFactory.h +30 -0
  635. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/TokenSource.cpp +9 -0
  636. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/TokenSource.h +85 -0
  637. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/TokenStream.cpp +11 -0
  638. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/TokenStream.h +137 -0
  639. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/TokenStreamRewriter.cpp +428 -0
  640. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/TokenStreamRewriter.h +295 -0
  641. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/UnbufferedCharStream.cpp +208 -0
  642. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/UnbufferedCharStream.h +117 -0
  643. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/UnbufferedTokenStream.cpp +270 -0
  644. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/UnbufferedTokenStream.h +115 -0
  645. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/Version.h +42 -0
  646. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/Vocabulary.cpp +64 -0
  647. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/Vocabulary.h +177 -0
  648. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/WritableToken.cpp +9 -0
  649. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/WritableToken.h +23 -0
  650. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/antlr4-common.h +101 -0
  651. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/antlr4-runtime.h +168 -0
  652. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/ATN.cpp +159 -0
  653. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/ATN.h +133 -0
  654. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/ATNConfig.cpp +106 -0
  655. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/ATNConfig.h +157 -0
  656. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/ATNConfigSet.cpp +233 -0
  657. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/ATNConfigSet.h +157 -0
  658. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/ATNDeserializationOptions.cpp +39 -0
  659. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/ATNDeserializationOptions.h +48 -0
  660. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/ATNDeserializer.cpp +628 -0
  661. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/ATNDeserializer.h +32 -0
  662. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/ATNSimulator.cpp +33 -0
  663. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/ATNSimulator.h +71 -0
  664. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/ATNState.cpp +56 -0
  665. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/ATNState.h +139 -0
  666. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/ATNStateType.cpp +33 -0
  667. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/ATNStateType.h +36 -0
  668. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/ATNType.h +20 -0
  669. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/ActionTransition.cpp +29 -0
  670. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/ActionTransition.h +35 -0
  671. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/AmbiguityInfo.cpp +16 -0
  672. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/AmbiguityInfo.h +68 -0
  673. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/ArrayPredictionContext.cpp +129 -0
  674. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/ArrayPredictionContext.h +51 -0
  675. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/AtomTransition.cpp +27 -0
  676. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/AtomTransition.h +33 -0
  677. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/BasicBlockStartState.h +24 -0
  678. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/BasicState.h +23 -0
  679. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/BlockEndState.h +26 -0
  680. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/BlockStartState.h +30 -0
  681. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/ContextSensitivityInfo.cpp +14 -0
  682. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/ContextSensitivityInfo.h +47 -0
  683. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/DecisionEventInfo.cpp +14 -0
  684. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/DecisionEventInfo.h +70 -0
  685. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/DecisionInfo.cpp +25 -0
  686. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/DecisionInfo.h +227 -0
  687. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/DecisionState.cpp +12 -0
  688. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/DecisionState.h +34 -0
  689. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/EpsilonTransition.cpp +31 -0
  690. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/EpsilonTransition.h +42 -0
  691. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/ErrorInfo.cpp +15 -0
  692. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/ErrorInfo.h +43 -0
  693. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/HashUtils.h +18 -0
  694. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/LL1Analyzer.cpp +189 -0
  695. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/LL1Analyzer.h +76 -0
  696. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/LexerATNConfig.cpp +67 -0
  697. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/LexerATNConfig.h +44 -0
  698. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/LexerATNSimulator.cpp +621 -0
  699. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/LexerATNSimulator.h +199 -0
  700. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/LexerAction.cpp +15 -0
  701. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/LexerAction.h +100 -0
  702. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/LexerActionExecutor.cpp +108 -0
  703. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/LexerActionExecutor.h +128 -0
  704. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/LexerActionType.h +57 -0
  705. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/LexerChannelAction.cpp +43 -0
  706. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/LexerChannelAction.h +59 -0
  707. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/LexerCustomAction.cpp +45 -0
  708. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/LexerCustomAction.h +75 -0
  709. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/LexerIndexedCustomAction.cpp +50 -0
  710. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/LexerIndexedCustomAction.h +76 -0
  711. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/LexerModeAction.cpp +43 -0
  712. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/LexerModeAction.h +57 -0
  713. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/LexerMoreAction.cpp +36 -0
  714. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/LexerMoreAction.h +53 -0
  715. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/LexerPopModeAction.cpp +36 -0
  716. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/LexerPopModeAction.h +53 -0
  717. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/LexerPushModeAction.cpp +43 -0
  718. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/LexerPushModeAction.h +57 -0
  719. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/LexerSkipAction.cpp +36 -0
  720. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/LexerSkipAction.h +51 -0
  721. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/LexerTypeAction.cpp +43 -0
  722. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/LexerTypeAction.h +51 -0
  723. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/LookaheadEventInfo.cpp +16 -0
  724. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/LookaheadEventInfo.h +42 -0
  725. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/LoopEndState.h +26 -0
  726. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/NotSetTransition.cpp +22 -0
  727. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/NotSetTransition.h +27 -0
  728. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/OrderedATNConfigSet.cpp +16 -0
  729. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/OrderedATNConfigSet.h +25 -0
  730. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/ParseInfo.cpp +102 -0
  731. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/ParseInfo.h +102 -0
  732. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/ParserATNSimulator.cpp +1413 -0
  733. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/ParserATNSimulator.h +911 -0
  734. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/ParserATNSimulatorOptions.h +50 -0
  735. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/PlusBlockStartState.h +29 -0
  736. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/PlusLoopbackState.h +25 -0
  737. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/PrecedencePredicateTransition.cpp +23 -0
  738. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/PrecedencePredicateTransition.h +35 -0
  739. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/PredicateEvalInfo.cpp +17 -0
  740. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/PredicateEvalInfo.h +62 -0
  741. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/PredicateTransition.cpp +24 -0
  742. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/PredicateTransition.h +50 -0
  743. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/PredictionContext.cpp +601 -0
  744. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/PredictionContext.h +225 -0
  745. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/PredictionContextCache.cpp +56 -0
  746. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/PredictionContextCache.h +63 -0
  747. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/PredictionContextMergeCache.cpp +167 -0
  748. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/PredictionContextMergeCache.h +101 -0
  749. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/PredictionContextMergeCacheOptions.h +71 -0
  750. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/PredictionContextType.h +21 -0
  751. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/PredictionMode.cpp +202 -0
  752. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/PredictionMode.h +436 -0
  753. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/ProfilingATNSimulator.cpp +179 -0
  754. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/ProfilingATNSimulator.h +60 -0
  755. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/RangeTransition.cpp +26 -0
  756. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/RangeTransition.h +31 -0
  757. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/RuleStartState.h +26 -0
  758. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/RuleStopState.h +27 -0
  759. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/RuleTransition.cpp +33 -0
  760. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/RuleTransition.h +42 -0
  761. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/SemanticContext.cpp +418 -0
  762. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/SemanticContext.h +237 -0
  763. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/SemanticContextType.h +23 -0
  764. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/SerializedATNView.h +101 -0
  765. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/SetTransition.cpp +28 -0
  766. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/SetTransition.h +38 -0
  767. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/SingletonPredictionContext.cpp +79 -0
  768. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/SingletonPredictionContext.h +43 -0
  769. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/StarBlockStartState.h +24 -0
  770. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/StarLoopEntryState.h +37 -0
  771. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/StarLoopbackState.cpp +19 -0
  772. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/StarLoopbackState.h +25 -0
  773. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/TokensStartState.h +24 -0
  774. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/Transition.cpp +36 -0
  775. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/Transition.h +65 -0
  776. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/TransitionType.cpp +27 -0
  777. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/TransitionType.h +33 -0
  778. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/WildcardTransition.cpp +21 -0
  779. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/atn/WildcardTransition.h +27 -0
  780. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/dfa/DFA.cpp +115 -0
  781. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/dfa/DFA.h +96 -0
  782. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/dfa/DFASerializer.cpp +60 -0
  783. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/dfa/DFASerializer.h +32 -0
  784. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/dfa/DFAState.cpp +59 -0
  785. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/dfa/DFAState.h +154 -0
  786. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/dfa/LexerDFASerializer.cpp +17 -0
  787. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/dfa/LexerDFASerializer.h +22 -0
  788. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/internal/Synchronization.cpp +100 -0
  789. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/internal/Synchronization.h +154 -0
  790. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/misc/InterpreterDataReader.cpp +124 -0
  791. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/misc/InterpreterDataReader.h +33 -0
  792. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/misc/Interval.cpp +61 -0
  793. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/misc/Interval.h +84 -0
  794. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/misc/IntervalSet.cpp +508 -0
  795. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/misc/IntervalSet.h +190 -0
  796. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/misc/MurmurHash.cpp +120 -0
  797. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/misc/MurmurHash.h +102 -0
  798. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/misc/Predicate.cpp +4 -0
  799. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/misc/Predicate.h +21 -0
  800. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/support/Any.cpp +8 -0
  801. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/support/Any.h +16 -0
  802. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/support/Arrays.cpp +43 -0
  803. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/support/Arrays.h +149 -0
  804. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/support/BitSet.h +76 -0
  805. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/support/CPPUtils.cpp +207 -0
  806. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/support/CPPUtils.h +65 -0
  807. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/support/Casts.h +34 -0
  808. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/support/Declarations.h +161 -0
  809. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/support/StringUtils.cpp +38 -0
  810. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/support/StringUtils.h +16 -0
  811. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/support/Unicode.h +28 -0
  812. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/support/Utf8.cpp +242 -0
  813. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/support/Utf8.h +54 -0
  814. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/tree/AbstractParseTreeVisitor.h +129 -0
  815. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/tree/ErrorNode.h +24 -0
  816. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/tree/ErrorNodeImpl.cpp +54 -0
  817. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/tree/ErrorNodeImpl.h +43 -0
  818. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/tree/IterativeParseTreeWalker.cpp +66 -0
  819. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/tree/IterativeParseTreeWalker.h +53 -0
  820. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/tree/ParseTree.cpp +12 -0
  821. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/tree/ParseTree.h +111 -0
  822. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/tree/ParseTreeListener.cpp +9 -0
  823. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/tree/ParseTreeListener.h +39 -0
  824. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/tree/ParseTreeProperty.h +50 -0
  825. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/tree/ParseTreeType.h +22 -0
  826. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/tree/ParseTreeVisitor.cpp +9 -0
  827. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/tree/ParseTreeVisitor.h +57 -0
  828. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/tree/ParseTreeWalker.cpp +48 -0
  829. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/tree/ParseTreeWalker.h +55 -0
  830. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/tree/TerminalNode.h +40 -0
  831. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/tree/TerminalNodeImpl.cpp +54 -0
  832. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/tree/TerminalNodeImpl.h +32 -0
  833. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/tree/Trees.cpp +241 -0
  834. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/tree/Trees.h +78 -0
  835. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/tree/pattern/Chunk.cpp +9 -0
  836. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/tree/pattern/Chunk.h +44 -0
  837. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/tree/pattern/ParseTreeMatch.cpp +69 -0
  838. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/tree/pattern/ParseTreeMatch.h +132 -0
  839. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/tree/pattern/ParseTreePattern.cpp +64 -0
  840. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/tree/pattern/ParseTreePattern.h +105 -0
  841. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/tree/pattern/ParseTreePatternMatcher.cpp +370 -0
  842. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/tree/pattern/ParseTreePatternMatcher.h +185 -0
  843. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/tree/pattern/RuleTagToken.cpp +77 -0
  844. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/tree/pattern/RuleTagToken.h +117 -0
  845. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/tree/pattern/TagChunk.cpp +39 -0
  846. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/tree/pattern/TagChunk.h +86 -0
  847. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/tree/pattern/TextChunk.cpp +28 -0
  848. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/tree/pattern/TextChunk.h +51 -0
  849. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/tree/pattern/TokenTagToken.cpp +36 -0
  850. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/tree/pattern/TokenTagToken.h +80 -0
  851. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/tree/xpath/XPath.cpp +154 -0
  852. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/tree/xpath/XPath.h +86 -0
  853. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/tree/xpath/XPathElement.cpp +31 -0
  854. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/tree/xpath/XPathElement.h +40 -0
  855. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/tree/xpath/XPathLexer.cpp +180 -0
  856. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/tree/xpath/XPathLexer.h +53 -0
  857. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/tree/xpath/XPathLexerErrorListener.cpp +13 -0
  858. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/tree/xpath/XPathLexerErrorListener.h +22 -0
  859. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/tree/xpath/XPathRuleAnywhereElement.cpp +20 -0
  860. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/tree/xpath/XPathRuleAnywhereElement.h +27 -0
  861. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/tree/xpath/XPathRuleElement.cpp +30 -0
  862. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/tree/xpath/XPathRuleElement.h +26 -0
  863. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/tree/xpath/XPathTokenAnywhereElement.cpp +20 -0
  864. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/tree/xpath/XPathTokenAnywhereElement.h +25 -0
  865. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/tree/xpath/XPathTokenElement.cpp +33 -0
  866. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/tree/xpath/XPathTokenElement.h +26 -0
  867. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/tree/xpath/XPathWildcardAnywhereElement.cpp +23 -0
  868. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/tree/xpath/XPathWildcardAnywhereElement.h +23 -0
  869. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/tree/xpath/XPathWildcardElement.cpp +24 -0
  870. data/ext/protovalidate/sys/third_party/antlr4/runtime/Cpp/runtime/src/tree/xpath/XPathWildcardElement.h +23 -0
  871. data/ext/protovalidate/sys/third_party/cel-cpp/LICENSE +202 -0
  872. data/ext/protovalidate/sys/third_party/cel-cpp/base/ast.h +20 -0
  873. data/ext/protovalidate/sys/third_party/cel-cpp/base/attribute.cc +330 -0
  874. data/ext/protovalidate/sys/third_party/cel-cpp/base/attribute.h +278 -0
  875. data/ext/protovalidate/sys/third_party/cel-cpp/base/attribute_set.h +108 -0
  876. data/ext/protovalidate/sys/third_party/cel-cpp/base/builtins.h +106 -0
  877. data/ext/protovalidate/sys/third_party/cel-cpp/base/function.h +20 -0
  878. data/ext/protovalidate/sys/third_party/cel-cpp/base/function_adapter.h +19 -0
  879. data/ext/protovalidate/sys/third_party/cel-cpp/base/function_descriptor.h +20 -0
  880. data/ext/protovalidate/sys/third_party/cel-cpp/base/function_result.h +70 -0
  881. data/ext/protovalidate/sys/third_party/cel-cpp/base/function_result_set.cc +28 -0
  882. data/ext/protovalidate/sys/third_party/cel-cpp/base/function_result_set.h +105 -0
  883. data/ext/protovalidate/sys/third_party/cel-cpp/base/internal/memory_manager_testing.h +54 -0
  884. data/ext/protovalidate/sys/third_party/cel-cpp/base/internal/message_wrapper.h +30 -0
  885. data/ext/protovalidate/sys/third_party/cel-cpp/base/internal/operators.h +91 -0
  886. data/ext/protovalidate/sys/third_party/cel-cpp/base/internal/unknown_set.cc +31 -0
  887. data/ext/protovalidate/sys/third_party/cel-cpp/base/internal/unknown_set.h +131 -0
  888. data/ext/protovalidate/sys/third_party/cel-cpp/base/kind.h +25 -0
  889. data/ext/protovalidate/sys/third_party/cel-cpp/base/operators.h +507 -0
  890. data/ext/protovalidate/sys/third_party/cel-cpp/base/type_provider.h +26 -0
  891. data/ext/protovalidate/sys/third_party/cel-cpp/checker/checker_options.h +110 -0
  892. data/ext/protovalidate/sys/third_party/cel-cpp/checker/internal/builtins_arena.cc +28 -0
  893. data/ext/protovalidate/sys/third_party/cel-cpp/checker/internal/builtins_arena.h +29 -0
  894. data/ext/protovalidate/sys/third_party/cel-cpp/checker/internal/field_path.h +77 -0
  895. data/ext/protovalidate/sys/third_party/cel-cpp/checker/internal/namespace_generator.h +120 -0
  896. data/ext/protovalidate/sys/third_party/cel-cpp/checker/internal/proto_type_mask.h +111 -0
  897. data/ext/protovalidate/sys/third_party/cel-cpp/checker/internal/proto_type_mask_registry.h +83 -0
  898. data/ext/protovalidate/sys/third_party/cel-cpp/checker/internal/test_ast_helpers.h +31 -0
  899. data/ext/protovalidate/sys/third_party/cel-cpp/checker/internal/type_check_env.h +249 -0
  900. data/ext/protovalidate/sys/third_party/cel-cpp/checker/internal/type_checker_builder_impl.h +170 -0
  901. data/ext/protovalidate/sys/third_party/cel-cpp/checker/internal/type_checker_impl.h +58 -0
  902. data/ext/protovalidate/sys/third_party/cel-cpp/checker/internal/type_inference_context.h +229 -0
  903. data/ext/protovalidate/sys/third_party/cel-cpp/checker/optional.h +30 -0
  904. data/ext/protovalidate/sys/third_party/cel-cpp/checker/standard_library.h +26 -0
  905. data/ext/protovalidate/sys/third_party/cel-cpp/checker/type_check_issue.cc +59 -0
  906. data/ext/protovalidate/sys/third_party/cel-cpp/checker/type_check_issue.h +69 -0
  907. data/ext/protovalidate/sys/third_party/cel-cpp/checker/type_checker.cc +36 -0
  908. data/ext/protovalidate/sys/third_party/cel-cpp/checker/type_checker.h +65 -0
  909. data/ext/protovalidate/sys/third_party/cel-cpp/checker/type_checker_builder.h +186 -0
  910. data/ext/protovalidate/sys/third_party/cel-cpp/checker/type_checker_builder_factory.h +59 -0
  911. data/ext/protovalidate/sys/third_party/cel-cpp/checker/type_checker_subset_factory.h +45 -0
  912. data/ext/protovalidate/sys/third_party/cel-cpp/checker/validation_result.cc +32 -0
  913. data/ext/protovalidate/sys/third_party/cel-cpp/checker/validation_result.h +117 -0
  914. data/ext/protovalidate/sys/third_party/cel-cpp/codelab/checked_expr_conversion_example.h +59 -0
  915. data/ext/protovalidate/sys/third_party/cel-cpp/codelab/exercise1.h +32 -0
  916. data/ext/protovalidate/sys/third_party/cel-cpp/codelab/exercise10.h +46 -0
  917. data/ext/protovalidate/sys/third_party/cel-cpp/codelab/exercise2.h +40 -0
  918. data/ext/protovalidate/sys/third_party/cel-cpp/codelab/exercise4.h +34 -0
  919. data/ext/protovalidate/sys/third_party/cel-cpp/codelab/network_functions.h +197 -0
  920. data/ext/protovalidate/sys/third_party/cel-cpp/common/allocator.h +606 -0
  921. data/ext/protovalidate/sys/third_party/cel-cpp/common/any.cc +38 -0
  922. data/ext/protovalidate/sys/third_party/cel-cpp/common/any.h +90 -0
  923. data/ext/protovalidate/sys/third_party/cel-cpp/common/arena.h +110 -0
  924. data/ext/protovalidate/sys/third_party/cel-cpp/common/arena_string.h +365 -0
  925. data/ext/protovalidate/sys/third_party/cel-cpp/common/arena_string_pool.h +86 -0
  926. data/ext/protovalidate/sys/third_party/cel-cpp/common/arena_string_view.h +239 -0
  927. data/ext/protovalidate/sys/third_party/cel-cpp/common/ast/constant_proto.cc +123 -0
  928. data/ext/protovalidate/sys/third_party/cel-cpp/common/ast/constant_proto.h +37 -0
  929. data/ext/protovalidate/sys/third_party/cel-cpp/common/ast/expr_proto.cc +514 -0
  930. data/ext/protovalidate/sys/third_party/cel-cpp/common/ast/expr_proto.h +32 -0
  931. data/ext/protovalidate/sys/third_party/cel-cpp/common/ast/metadata.cc +262 -0
  932. data/ext/protovalidate/sys/third_party/cel-cpp/common/ast/metadata.h +920 -0
  933. data/ext/protovalidate/sys/third_party/cel-cpp/common/ast/navigable_ast_internal.h +311 -0
  934. data/ext/protovalidate/sys/third_party/cel-cpp/common/ast/navigable_ast_kinds.cc +80 -0
  935. data/ext/protovalidate/sys/third_party/cel-cpp/common/ast/navigable_ast_kinds.h +74 -0
  936. data/ext/protovalidate/sys/third_party/cel-cpp/common/ast/source_info_proto.cc +90 -0
  937. data/ext/protovalidate/sys/third_party/cel-cpp/common/ast/source_info_proto.h +32 -0
  938. data/ext/protovalidate/sys/third_party/cel-cpp/common/ast.cc +98 -0
  939. data/ext/protovalidate/sys/third_party/cel-cpp/common/ast.h +157 -0
  940. data/ext/protovalidate/sys/third_party/cel-cpp/common/ast_proto.cc +547 -0
  941. data/ext/protovalidate/sys/third_party/cel-cpp/common/ast_proto.h +52 -0
  942. data/ext/protovalidate/sys/third_party/cel-cpp/common/ast_rewrite.cc +389 -0
  943. data/ext/protovalidate/sys/third_party/cel-cpp/common/ast_rewrite.h +146 -0
  944. data/ext/protovalidate/sys/third_party/cel-cpp/common/ast_traverse.cc +380 -0
  945. data/ext/protovalidate/sys/third_party/cel-cpp/common/ast_traverse.h +105 -0
  946. data/ext/protovalidate/sys/third_party/cel-cpp/common/ast_visitor.h +118 -0
  947. data/ext/protovalidate/sys/third_party/cel-cpp/common/ast_visitor_base.h +88 -0
  948. data/ext/protovalidate/sys/third_party/cel-cpp/common/casting.h +75 -0
  949. data/ext/protovalidate/sys/third_party/cel-cpp/common/constant.cc +101 -0
  950. data/ext/protovalidate/sys/third_party/cel-cpp/common/constant.h +491 -0
  951. data/ext/protovalidate/sys/third_party/cel-cpp/common/container.cc +171 -0
  952. data/ext/protovalidate/sys/third_party/cel-cpp/common/container.h +138 -0
  953. data/ext/protovalidate/sys/third_party/cel-cpp/common/data.h +120 -0
  954. data/ext/protovalidate/sys/third_party/cel-cpp/common/decl.cc +221 -0
  955. data/ext/protovalidate/sys/third_party/cel-cpp/common/decl.h +446 -0
  956. data/ext/protovalidate/sys/third_party/cel-cpp/common/decl_proto.h +50 -0
  957. data/ext/protovalidate/sys/third_party/cel-cpp/common/decl_proto_v1alpha1.h +55 -0
  958. data/ext/protovalidate/sys/third_party/cel-cpp/common/descriptor_pool_type_introspector.cc +244 -0
  959. data/ext/protovalidate/sys/third_party/cel-cpp/common/descriptor_pool_type_introspector.h +106 -0
  960. data/ext/protovalidate/sys/third_party/cel-cpp/common/expr.cc +320 -0
  961. data/ext/protovalidate/sys/third_party/cel-cpp/common/expr.h +1720 -0
  962. data/ext/protovalidate/sys/third_party/cel-cpp/common/expr_factory.h +402 -0
  963. data/ext/protovalidate/sys/third_party/cel-cpp/common/expr_printer.h +57 -0
  964. data/ext/protovalidate/sys/third_party/cel-cpp/common/format_type_name.h +30 -0
  965. data/ext/protovalidate/sys/third_party/cel-cpp/common/function_descriptor.cc +98 -0
  966. data/ext/protovalidate/sys/third_party/cel-cpp/common/function_descriptor.h +124 -0
  967. data/ext/protovalidate/sys/third_party/cel-cpp/common/internal/byte_string.cc +1074 -0
  968. data/ext/protovalidate/sys/third_party/cel-cpp/common/internal/byte_string.h +688 -0
  969. data/ext/protovalidate/sys/third_party/cel-cpp/common/internal/casting.h +237 -0
  970. data/ext/protovalidate/sys/third_party/cel-cpp/common/internal/metadata.h +41 -0
  971. data/ext/protovalidate/sys/third_party/cel-cpp/common/internal/reference_count.cc +118 -0
  972. data/ext/protovalidate/sys/third_party/cel-cpp/common/internal/reference_count.h +406 -0
  973. data/ext/protovalidate/sys/third_party/cel-cpp/common/internal/value_conversion.h +115 -0
  974. data/ext/protovalidate/sys/third_party/cel-cpp/common/json.h +35 -0
  975. data/ext/protovalidate/sys/third_party/cel-cpp/common/kind.cc +80 -0
  976. data/ext/protovalidate/sys/third_party/cel-cpp/common/kind.h +76 -0
  977. data/ext/protovalidate/sys/third_party/cel-cpp/common/legacy_value.cc +1324 -0
  978. data/ext/protovalidate/sys/third_party/cel-cpp/common/legacy_value.h +131 -0
  979. data/ext/protovalidate/sys/third_party/cel-cpp/common/memory.cc +83 -0
  980. data/ext/protovalidate/sys/third_party/cel-cpp/common/memory.h +1505 -0
  981. data/ext/protovalidate/sys/third_party/cel-cpp/common/memory_testing.h +71 -0
  982. data/ext/protovalidate/sys/third_party/cel-cpp/common/minimal_descriptor_database.h +32 -0
  983. data/ext/protovalidate/sys/third_party/cel-cpp/common/minimal_descriptor_pool.h +36 -0
  984. data/ext/protovalidate/sys/third_party/cel-cpp/common/native_type.h +26 -0
  985. data/ext/protovalidate/sys/third_party/cel-cpp/common/navigable_ast.cc +202 -0
  986. data/ext/protovalidate/sys/third_party/cel-cpp/common/navigable_ast.h +168 -0
  987. data/ext/protovalidate/sys/third_party/cel-cpp/common/operators.cc +233 -0
  988. data/ext/protovalidate/sys/third_party/cel-cpp/common/operators.h +87 -0
  989. data/ext/protovalidate/sys/third_party/cel-cpp/common/optional_ref.h +163 -0
  990. data/ext/protovalidate/sys/third_party/cel-cpp/common/reference.h +269 -0
  991. data/ext/protovalidate/sys/third_party/cel-cpp/common/reference_count.h +26 -0
  992. data/ext/protovalidate/sys/third_party/cel-cpp/common/signature.cc +640 -0
  993. data/ext/protovalidate/sys/third_party/cel-cpp/common/signature.h +101 -0
  994. data/ext/protovalidate/sys/third_party/cel-cpp/common/source.cc +679 -0
  995. data/ext/protovalidate/sys/third_party/cel-cpp/common/source.h +261 -0
  996. data/ext/protovalidate/sys/third_party/cel-cpp/common/standard_definitions.h +349 -0
  997. data/ext/protovalidate/sys/third_party/cel-cpp/common/type.cc +737 -0
  998. data/ext/protovalidate/sys/third_party/cel-cpp/common/type.h +1303 -0
  999. data/ext/protovalidate/sys/third_party/cel-cpp/common/type_introspector.cc +277 -0
  1000. data/ext/protovalidate/sys/third_party/cel-cpp/common/type_introspector.h +157 -0
  1001. data/ext/protovalidate/sys/third_party/cel-cpp/common/type_kind.h +113 -0
  1002. data/ext/protovalidate/sys/third_party/cel-cpp/common/type_proto.h +39 -0
  1003. data/ext/protovalidate/sys/third_party/cel-cpp/common/type_reflector.h +43 -0
  1004. data/ext/protovalidate/sys/third_party/cel-cpp/common/type_spec_resolver.cc +324 -0
  1005. data/ext/protovalidate/sys/third_party/cel-cpp/common/type_spec_resolver.h +46 -0
  1006. data/ext/protovalidate/sys/third_party/cel-cpp/common/type_testing.h +24 -0
  1007. data/ext/protovalidate/sys/third_party/cel-cpp/common/typeinfo.cc +73 -0
  1008. data/ext/protovalidate/sys/third_party/cel-cpp/common/typeinfo.h +221 -0
  1009. data/ext/protovalidate/sys/third_party/cel-cpp/common/types/any_type.h +74 -0
  1010. data/ext/protovalidate/sys/third_party/cel-cpp/common/types/basic_struct_type.cc +53 -0
  1011. data/ext/protovalidate/sys/third_party/cel-cpp/common/types/basic_struct_type.h +119 -0
  1012. data/ext/protovalidate/sys/third_party/cel-cpp/common/types/bool_type.h +73 -0
  1013. data/ext/protovalidate/sys/third_party/cel-cpp/common/types/bool_wrapper_type.h +79 -0
  1014. data/ext/protovalidate/sys/third_party/cel-cpp/common/types/bytes_type.h +73 -0
  1015. data/ext/protovalidate/sys/third_party/cel-cpp/common/types/bytes_wrapper_type.h +79 -0
  1016. data/ext/protovalidate/sys/third_party/cel-cpp/common/types/double_type.h +73 -0
  1017. data/ext/protovalidate/sys/third_party/cel-cpp/common/types/double_wrapper_type.h +79 -0
  1018. data/ext/protovalidate/sys/third_party/cel-cpp/common/types/duration_type.h +73 -0
  1019. data/ext/protovalidate/sys/third_party/cel-cpp/common/types/dyn_type.h +73 -0
  1020. data/ext/protovalidate/sys/third_party/cel-cpp/common/types/enum_type.cc +43 -0
  1021. data/ext/protovalidate/sys/third_party/cel-cpp/common/types/enum_type.h +128 -0
  1022. data/ext/protovalidate/sys/third_party/cel-cpp/common/types/error_type.h +75 -0
  1023. data/ext/protovalidate/sys/third_party/cel-cpp/common/types/function_type.cc +89 -0
  1024. data/ext/protovalidate/sys/third_party/cel-cpp/common/types/function_type.h +91 -0
  1025. data/ext/protovalidate/sys/third_party/cel-cpp/common/types/function_type_pool.cc +29 -0
  1026. data/ext/protovalidate/sys/third_party/cel-cpp/common/types/function_type_pool.h +102 -0
  1027. data/ext/protovalidate/sys/third_party/cel-cpp/common/types/int_type.h +72 -0
  1028. data/ext/protovalidate/sys/third_party/cel-cpp/common/types/int_wrapper_type.h +78 -0
  1029. data/ext/protovalidate/sys/third_party/cel-cpp/common/types/legacy_type_introspector.h +34 -0
  1030. data/ext/protovalidate/sys/third_party/cel-cpp/common/types/list_type.cc +77 -0
  1031. data/ext/protovalidate/sys/third_party/cel-cpp/common/types/list_type.h +115 -0
  1032. data/ext/protovalidate/sys/third_party/cel-cpp/common/types/list_type_pool.cc +29 -0
  1033. data/ext/protovalidate/sys/third_party/cel-cpp/common/types/list_type_pool.h +80 -0
  1034. data/ext/protovalidate/sys/third_party/cel-cpp/common/types/map_type.cc +122 -0
  1035. data/ext/protovalidate/sys/third_party/cel-cpp/common/types/map_type.h +124 -0
  1036. data/ext/protovalidate/sys/third_party/cel-cpp/common/types/map_type_pool.cc +30 -0
  1037. data/ext/protovalidate/sys/third_party/cel-cpp/common/types/map_type_pool.h +93 -0
  1038. data/ext/protovalidate/sys/third_party/cel-cpp/common/types/message_type.cc +95 -0
  1039. data/ext/protovalidate/sys/third_party/cel-cpp/common/types/message_type.h +209 -0
  1040. data/ext/protovalidate/sys/third_party/cel-cpp/common/types/null_type.h +73 -0
  1041. data/ext/protovalidate/sys/third_party/cel-cpp/common/types/opaque_type.cc +109 -0
  1042. data/ext/protovalidate/sys/third_party/cel-cpp/common/types/opaque_type.h +118 -0
  1043. data/ext/protovalidate/sys/third_party/cel-cpp/common/types/opaque_type_pool.cc +33 -0
  1044. data/ext/protovalidate/sys/third_party/cel-cpp/common/types/opaque_type_pool.h +99 -0
  1045. data/ext/protovalidate/sys/third_party/cel-cpp/common/types/optional_type.cc +68 -0
  1046. data/ext/protovalidate/sys/third_party/cel-cpp/common/types/optional_type.h +114 -0
  1047. data/ext/protovalidate/sys/third_party/cel-cpp/common/types/string_type.h +73 -0
  1048. data/ext/protovalidate/sys/third_party/cel-cpp/common/types/string_wrapper_type.h +86 -0
  1049. data/ext/protovalidate/sys/third_party/cel-cpp/common/types/struct_type.cc +87 -0
  1050. data/ext/protovalidate/sys/third_party/cel-cpp/common/types/struct_type.h +158 -0
  1051. data/ext/protovalidate/sys/third_party/cel-cpp/common/types/timestamp_type.h +73 -0
  1052. data/ext/protovalidate/sys/third_party/cel-cpp/common/types/type_param_type.h +78 -0
  1053. data/ext/protovalidate/sys/third_party/cel-cpp/common/types/type_pool.cc +96 -0
  1054. data/ext/protovalidate/sys/third_party/cel-cpp/common/types/type_pool.h +99 -0
  1055. data/ext/protovalidate/sys/third_party/cel-cpp/common/types/type_type.cc +74 -0
  1056. data/ext/protovalidate/sys/third_party/cel-cpp/common/types/type_type.h +92 -0
  1057. data/ext/protovalidate/sys/third_party/cel-cpp/common/types/type_type_pool.cc +26 -0
  1058. data/ext/protovalidate/sys/third_party/cel-cpp/common/types/type_type_pool.h +86 -0
  1059. data/ext/protovalidate/sys/third_party/cel-cpp/common/types/types.h +99 -0
  1060. data/ext/protovalidate/sys/third_party/cel-cpp/common/types/uint_type.h +73 -0
  1061. data/ext/protovalidate/sys/third_party/cel-cpp/common/types/uint_wrapper_type.h +79 -0
  1062. data/ext/protovalidate/sys/third_party/cel-cpp/common/types/unknown_type.h +74 -0
  1063. data/ext/protovalidate/sys/third_party/cel-cpp/common/unknown.h +27 -0
  1064. data/ext/protovalidate/sys/third_party/cel-cpp/common/value.cc +2791 -0
  1065. data/ext/protovalidate/sys/third_party/cel-cpp/common/value.h +2947 -0
  1066. data/ext/protovalidate/sys/third_party/cel-cpp/common/value_kind.h +104 -0
  1067. data/ext/protovalidate/sys/third_party/cel-cpp/common/value_testing.h +307 -0
  1068. data/ext/protovalidate/sys/third_party/cel-cpp/common/values/bool_value.cc +97 -0
  1069. data/ext/protovalidate/sys/third_party/cel-cpp/common/values/bool_value.h +111 -0
  1070. data/ext/protovalidate/sys/third_party/cel-cpp/common/values/bytes_value.cc +194 -0
  1071. data/ext/protovalidate/sys/third_party/cel-cpp/common/values/bytes_value.h +338 -0
  1072. data/ext/protovalidate/sys/third_party/cel-cpp/common/values/bytes_value_input_stream.h +133 -0
  1073. data/ext/protovalidate/sys/third_party/cel-cpp/common/values/bytes_value_output_stream.h +176 -0
  1074. data/ext/protovalidate/sys/third_party/cel-cpp/common/values/custom_list_value.cc +614 -0
  1075. data/ext/protovalidate/sys/third_party/cel-cpp/common/values/custom_list_value.h +423 -0
  1076. data/ext/protovalidate/sys/third_party/cel-cpp/common/values/custom_map_value.cc +823 -0
  1077. data/ext/protovalidate/sys/third_party/cel-cpp/common/values/custom_map_value.h +469 -0
  1078. data/ext/protovalidate/sys/third_party/cel-cpp/common/values/custom_struct_value.cc +385 -0
  1079. data/ext/protovalidate/sys/third_party/cel-cpp/common/values/custom_struct_value.h +459 -0
  1080. data/ext/protovalidate/sys/third_party/cel-cpp/common/values/custom_value.h +84 -0
  1081. data/ext/protovalidate/sys/third_party/cel-cpp/common/values/double_value.cc +137 -0
  1082. data/ext/protovalidate/sys/third_party/cel-cpp/common/values/double_value.h +101 -0
  1083. data/ext/protovalidate/sys/third_party/cel-cpp/common/values/duration_value.cc +105 -0
  1084. data/ext/protovalidate/sys/third_party/cel-cpp/common/values/duration_value.h +147 -0
  1085. data/ext/protovalidate/sys/third_party/cel-cpp/common/values/enum_value.h +49 -0
  1086. data/ext/protovalidate/sys/third_party/cel-cpp/common/values/error_value.cc +194 -0
  1087. data/ext/protovalidate/sys/third_party/cel-cpp/common/values/error_value.h +276 -0
  1088. data/ext/protovalidate/sys/third_party/cel-cpp/common/values/int_value.cc +111 -0
  1089. data/ext/protovalidate/sys/third_party/cel-cpp/common/values/int_value.h +117 -0
  1090. data/ext/protovalidate/sys/third_party/cel-cpp/common/values/legacy_list_value.cc +76 -0
  1091. data/ext/protovalidate/sys/third_party/cel-cpp/common/values/legacy_list_value.h +167 -0
  1092. data/ext/protovalidate/sys/third_party/cel-cpp/common/values/legacy_map_value.cc +76 -0
  1093. data/ext/protovalidate/sys/third_party/cel-cpp/common/values/legacy_map_value.h +185 -0
  1094. data/ext/protovalidate/sys/third_party/cel-cpp/common/values/legacy_struct_value.cc +43 -0
  1095. data/ext/protovalidate/sys/third_party/cel-cpp/common/values/legacy_struct_value.h +183 -0
  1096. data/ext/protovalidate/sys/third_party/cel-cpp/common/values/list_value.cc +304 -0
  1097. data/ext/protovalidate/sys/third_party/cel-cpp/common/values/list_value.h +284 -0
  1098. data/ext/protovalidate/sys/third_party/cel-cpp/common/values/list_value_builder.h +110 -0
  1099. data/ext/protovalidate/sys/third_party/cel-cpp/common/values/list_value_variant.h +214 -0
  1100. data/ext/protovalidate/sys/third_party/cel-cpp/common/values/map_value.cc +378 -0
  1101. data/ext/protovalidate/sys/third_party/cel-cpp/common/values/map_value.h +323 -0
  1102. data/ext/protovalidate/sys/third_party/cel-cpp/common/values/map_value_builder.h +110 -0
  1103. data/ext/protovalidate/sys/third_party/cel-cpp/common/values/map_value_variant.h +212 -0
  1104. data/ext/protovalidate/sys/third_party/cel-cpp/common/values/message_value.cc +306 -0
  1105. data/ext/protovalidate/sys/third_party/cel-cpp/common/values/message_value.h +268 -0
  1106. data/ext/protovalidate/sys/third_party/cel-cpp/common/values/null_value.cc +78 -0
  1107. data/ext/protovalidate/sys/third_party/cel-cpp/common/values/null_value.h +96 -0
  1108. data/ext/protovalidate/sys/third_party/cel-cpp/common/values/opaque_value.cc +194 -0
  1109. data/ext/protovalidate/sys/third_party/cel-cpp/common/values/opaque_value.h +338 -0
  1110. data/ext/protovalidate/sys/third_party/cel-cpp/common/values/optional_value.cc +435 -0
  1111. data/ext/protovalidate/sys/third_party/cel-cpp/common/values/optional_value.h +207 -0
  1112. data/ext/protovalidate/sys/third_party/cel-cpp/common/values/parsed_json_list_value.cc +486 -0
  1113. data/ext/protovalidate/sys/third_party/cel-cpp/common/values/parsed_json_list_value.h +229 -0
  1114. data/ext/protovalidate/sys/third_party/cel-cpp/common/values/parsed_json_map_value.cc +439 -0
  1115. data/ext/protovalidate/sys/third_party/cel-cpp/common/values/parsed_json_map_value.h +250 -0
  1116. data/ext/protovalidate/sys/third_party/cel-cpp/common/values/parsed_json_value.cc +103 -0
  1117. data/ext/protovalidate/sys/third_party/cel-cpp/common/values/parsed_json_value.h +40 -0
  1118. data/ext/protovalidate/sys/third_party/cel-cpp/common/values/parsed_map_field_value.cc +583 -0
  1119. data/ext/protovalidate/sys/third_party/cel-cpp/common/values/parsed_map_field_value.h +242 -0
  1120. data/ext/protovalidate/sys/third_party/cel-cpp/common/values/parsed_message_value.cc +411 -0
  1121. data/ext/protovalidate/sys/third_party/cel-cpp/common/values/parsed_message_value.h +249 -0
  1122. data/ext/protovalidate/sys/third_party/cel-cpp/common/values/parsed_repeated_field_value.cc +365 -0
  1123. data/ext/protovalidate/sys/third_party/cel-cpp/common/values/parsed_repeated_field_value.h +220 -0
  1124. data/ext/protovalidate/sys/third_party/cel-cpp/common/values/string_value.cc +1518 -0
  1125. data/ext/protovalidate/sys/third_party/cel-cpp/common/values/string_value.h +489 -0
  1126. data/ext/protovalidate/sys/third_party/cel-cpp/common/values/struct_value.cc +390 -0
  1127. data/ext/protovalidate/sys/third_party/cel-cpp/common/values/struct_value.h +373 -0
  1128. data/ext/protovalidate/sys/third_party/cel-cpp/common/values/struct_value_builder.cc +1552 -0
  1129. data/ext/protovalidate/sys/third_party/cel-cpp/common/values/struct_value_builder.h +35 -0
  1130. data/ext/protovalidate/sys/third_party/cel-cpp/common/values/struct_value_variant.h +205 -0
  1131. data/ext/protovalidate/sys/third_party/cel-cpp/common/values/timestamp_value.cc +105 -0
  1132. data/ext/protovalidate/sys/third_party/cel-cpp/common/values/timestamp_value.h +146 -0
  1133. data/ext/protovalidate/sys/third_party/cel-cpp/common/values/type_value.cc +72 -0
  1134. data/ext/protovalidate/sys/third_party/cel-cpp/common/values/type_value.h +108 -0
  1135. data/ext/protovalidate/sys/third_party/cel-cpp/common/values/uint_value.cc +110 -0
  1136. data/ext/protovalidate/sys/third_party/cel-cpp/common/values/uint_value.h +119 -0
  1137. data/ext/protovalidate/sys/third_party/cel-cpp/common/values/unknown_value.cc +66 -0
  1138. data/ext/protovalidate/sys/third_party/cel-cpp/common/values/unknown_value.h +121 -0
  1139. data/ext/protovalidate/sys/third_party/cel-cpp/common/values/value_builder.cc +1432 -0
  1140. data/ext/protovalidate/sys/third_party/cel-cpp/common/values/value_builder.h +36 -0
  1141. data/ext/protovalidate/sys/third_party/cel-cpp/common/values/value_variant.cc +537 -0
  1142. data/ext/protovalidate/sys/third_party/cel-cpp/common/values/value_variant.h +831 -0
  1143. data/ext/protovalidate/sys/third_party/cel-cpp/common/values/values.h +351 -0
  1144. data/ext/protovalidate/sys/third_party/cel-cpp/compiler/compiler.h +195 -0
  1145. data/ext/protovalidate/sys/third_party/cel-cpp/compiler/compiler_factory.h +70 -0
  1146. data/ext/protovalidate/sys/third_party/cel-cpp/compiler/compiler_library_subset_factory.h +80 -0
  1147. data/ext/protovalidate/sys/third_party/cel-cpp/compiler/optional.h +28 -0
  1148. data/ext/protovalidate/sys/third_party/cel-cpp/compiler/standard_library.h +27 -0
  1149. data/ext/protovalidate/sys/third_party/cel-cpp/env/config.h +173 -0
  1150. data/ext/protovalidate/sys/third_party/cel-cpp/env/env.h +76 -0
  1151. data/ext/protovalidate/sys/third_party/cel-cpp/env/env_runtime.h +85 -0
  1152. data/ext/protovalidate/sys/third_party/cel-cpp/env/env_std_extensions.h +42 -0
  1153. data/ext/protovalidate/sys/third_party/cel-cpp/env/env_yaml.h +74 -0
  1154. data/ext/protovalidate/sys/third_party/cel-cpp/env/internal/ext_registry.h +74 -0
  1155. data/ext/protovalidate/sys/third_party/cel-cpp/env/internal/runtime_ext_registry.h +84 -0
  1156. data/ext/protovalidate/sys/third_party/cel-cpp/env/runtime_std_extensions.h +46 -0
  1157. data/ext/protovalidate/sys/third_party/cel-cpp/env/type_info.h +42 -0
  1158. data/ext/protovalidate/sys/third_party/cel-cpp/eval/compiler/cel_expression_builder_flat_impl.cc +111 -0
  1159. data/ext/protovalidate/sys/third_party/cel-cpp/eval/compiler/cel_expression_builder_flat_impl.h +108 -0
  1160. data/ext/protovalidate/sys/third_party/cel-cpp/eval/compiler/check_ast_extensions.cc +58 -0
  1161. data/ext/protovalidate/sys/third_party/cel-cpp/eval/compiler/check_ast_extensions.h +34 -0
  1162. data/ext/protovalidate/sys/third_party/cel-cpp/eval/compiler/comprehension_vulnerability_check.cc +275 -0
  1163. data/ext/protovalidate/sys/third_party/cel-cpp/eval/compiler/comprehension_vulnerability_check.h +51 -0
  1164. data/ext/protovalidate/sys/third_party/cel-cpp/eval/compiler/constant_folding.cc +280 -0
  1165. data/ext/protovalidate/sys/third_party/cel-cpp/eval/compiler/constant_folding.h +42 -0
  1166. data/ext/protovalidate/sys/third_party/cel-cpp/eval/compiler/flat_expr_builder.cc +2667 -0
  1167. data/ext/protovalidate/sys/third_party/cel-cpp/eval/compiler/flat_expr_builder.h +104 -0
  1168. data/ext/protovalidate/sys/third_party/cel-cpp/eval/compiler/flat_expr_builder_extensions.cc +474 -0
  1169. data/ext/protovalidate/sys/third_party/cel-cpp/eval/compiler/flat_expr_builder_extensions.h +481 -0
  1170. data/ext/protovalidate/sys/third_party/cel-cpp/eval/compiler/instrumentation.h +60 -0
  1171. data/ext/protovalidate/sys/third_party/cel-cpp/eval/compiler/qualified_reference_resolver.cc +359 -0
  1172. data/ext/protovalidate/sys/third_party/cel-cpp/eval/compiler/qualified_reference_resolver.h +53 -0
  1173. data/ext/protovalidate/sys/third_party/cel-cpp/eval/compiler/regex_precompilation_optimization.cc +274 -0
  1174. data/ext/protovalidate/sys/third_party/cel-cpp/eval/compiler/regex_precompilation_optimization.h +29 -0
  1175. data/ext/protovalidate/sys/third_party/cel-cpp/eval/compiler/resolver.cc +222 -0
  1176. data/ext/protovalidate/sys/third_party/cel-cpp/eval/compiler/resolver.h +127 -0
  1177. data/ext/protovalidate/sys/third_party/cel-cpp/eval/eval/attribute_trail.cc +28 -0
  1178. data/ext/protovalidate/sys/third_party/cel-cpp/eval/eval/attribute_trail.h +65 -0
  1179. data/ext/protovalidate/sys/third_party/cel-cpp/eval/eval/attribute_utility.cc +260 -0
  1180. data/ext/protovalidate/sys/third_party/cel-cpp/eval/eval/attribute_utility.h +179 -0
  1181. data/ext/protovalidate/sys/third_party/cel-cpp/eval/eval/cel_expression_flat_impl.cc +147 -0
  1182. data/ext/protovalidate/sys/third_party/cel-cpp/eval/eval/cel_expression_flat_impl.h +175 -0
  1183. data/ext/protovalidate/sys/third_party/cel-cpp/eval/eval/compiler_constant_step.cc +37 -0
  1184. data/ext/protovalidate/sys/third_party/cel-cpp/eval/eval/compiler_constant_step.h +76 -0
  1185. data/ext/protovalidate/sys/third_party/cel-cpp/eval/eval/comprehension_slots.h +153 -0
  1186. data/ext/protovalidate/sys/third_party/cel-cpp/eval/eval/comprehension_step.cc +685 -0
  1187. data/ext/protovalidate/sys/third_party/cel-cpp/eval/eval/comprehension_step.h +119 -0
  1188. data/ext/protovalidate/sys/third_party/cel-cpp/eval/eval/const_value_step.h +31 -0
  1189. data/ext/protovalidate/sys/third_party/cel-cpp/eval/eval/container_access_step.cc +370 -0
  1190. data/ext/protovalidate/sys/third_party/cel-cpp/eval/eval/container_access_step.h +26 -0
  1191. data/ext/protovalidate/sys/third_party/cel-cpp/eval/eval/create_list_step.cc +283 -0
  1192. data/ext/protovalidate/sys/third_party/cel-cpp/eval/eval/create_list_step.h +40 -0
  1193. data/ext/protovalidate/sys/third_party/cel-cpp/eval/eval/create_map_step.cc +289 -0
  1194. data/ext/protovalidate/sys/third_party/cel-cpp/eval/eval/create_map_step.h +59 -0
  1195. data/ext/protovalidate/sys/third_party/cel-cpp/eval/eval/create_struct_step.cc +270 -0
  1196. data/ext/protovalidate/sys/third_party/cel-cpp/eval/eval/create_struct_step.h +44 -0
  1197. data/ext/protovalidate/sys/third_party/cel-cpp/eval/eval/direct_expression_step.cc +34 -0
  1198. data/ext/protovalidate/sys/third_party/cel-cpp/eval/eval/direct_expression_step.h +99 -0
  1199. data/ext/protovalidate/sys/third_party/cel-cpp/eval/eval/equality_steps.cc +293 -0
  1200. data/ext/protovalidate/sys/third_party/cel-cpp/eval/eval/equality_steps.h +45 -0
  1201. data/ext/protovalidate/sys/third_party/cel-cpp/eval/eval/evaluator_core.cc +178 -0
  1202. data/ext/protovalidate/sys/third_party/cel-cpp/eval/eval/evaluator_core.h +516 -0
  1203. data/ext/protovalidate/sys/third_party/cel-cpp/eval/eval/evaluator_stack.cc +92 -0
  1204. data/ext/protovalidate/sys/third_party/cel-cpp/eval/eval/evaluator_stack.h +327 -0
  1205. data/ext/protovalidate/sys/third_party/cel-cpp/eval/eval/expression_step_base.h +12 -0
  1206. data/ext/protovalidate/sys/third_party/cel-cpp/eval/eval/function_step.cc +529 -0
  1207. data/ext/protovalidate/sys/third_party/cel-cpp/eval/eval/function_step.h +48 -0
  1208. data/ext/protovalidate/sys/third_party/cel-cpp/eval/eval/ident_step.cc +174 -0
  1209. data/ext/protovalidate/sys/third_party/cel-cpp/eval/eval/ident_step.h +31 -0
  1210. data/ext/protovalidate/sys/third_party/cel-cpp/eval/eval/iterator_stack.h +77 -0
  1211. data/ext/protovalidate/sys/third_party/cel-cpp/eval/eval/jump_step.cc +172 -0
  1212. data/ext/protovalidate/sys/third_party/cel-cpp/eval/eval/jump_step.h +74 -0
  1213. data/ext/protovalidate/sys/third_party/cel-cpp/eval/eval/lazy_init_step.cc +236 -0
  1214. data/ext/protovalidate/sys/third_party/cel-cpp/eval/eval/lazy_init_step.h +87 -0
  1215. data/ext/protovalidate/sys/third_party/cel-cpp/eval/eval/logic_step.cc +487 -0
  1216. data/ext/protovalidate/sys/third_party/cel-cpp/eval/eval/logic_step.h +49 -0
  1217. data/ext/protovalidate/sys/third_party/cel-cpp/eval/eval/optional_or_step.cc +305 -0
  1218. data/ext/protovalidate/sys/third_party/cel-cpp/eval/eval/optional_or_step.h +51 -0
  1219. data/ext/protovalidate/sys/third_party/cel-cpp/eval/eval/regex_match_step.cc +135 -0
  1220. data/ext/protovalidate/sys/third_party/cel-cpp/eval/eval/regex_match_step.h +37 -0
  1221. data/ext/protovalidate/sys/third_party/cel-cpp/eval/eval/select_step.cc +581 -0
  1222. data/ext/protovalidate/sys/third_party/cel-cpp/eval/eval/select_step.h +33 -0
  1223. data/ext/protovalidate/sys/third_party/cel-cpp/eval/eval/shadowable_value_step.cc +98 -0
  1224. data/ext/protovalidate/sys/third_party/cel-cpp/eval/eval/shadowable_value_step.h +26 -0
  1225. data/ext/protovalidate/sys/third_party/cel-cpp/eval/eval/ternary_step.cc +194 -0
  1226. data/ext/protovalidate/sys/third_party/cel-cpp/eval/eval/ternary_step.h +26 -0
  1227. data/ext/protovalidate/sys/third_party/cel-cpp/eval/eval/trace_step.h +73 -0
  1228. data/ext/protovalidate/sys/third_party/cel-cpp/eval/internal/adapter_activation_impl.cc +87 -0
  1229. data/ext/protovalidate/sys/third_party/cel-cpp/eval/internal/adapter_activation_impl.h +68 -0
  1230. data/ext/protovalidate/sys/third_party/cel-cpp/eval/internal/cel_value_equal.cc +242 -0
  1231. data/ext/protovalidate/sys/third_party/cel-cpp/eval/internal/cel_value_equal.h +34 -0
  1232. data/ext/protovalidate/sys/third_party/cel-cpp/eval/internal/errors.cc +64 -0
  1233. data/ext/protovalidate/sys/third_party/cel-cpp/eval/internal/errors.h +54 -0
  1234. data/ext/protovalidate/sys/third_party/cel-cpp/eval/internal/interop.h +20 -0
  1235. data/ext/protovalidate/sys/third_party/cel-cpp/eval/public/activation.cc +119 -0
  1236. data/ext/protovalidate/sys/third_party/cel-cpp/eval/public/activation.h +170 -0
  1237. data/ext/protovalidate/sys/third_party/cel-cpp/eval/public/activation_bind_helper.h +60 -0
  1238. data/ext/protovalidate/sys/third_party/cel-cpp/eval/public/ast_rewrite.h +175 -0
  1239. data/ext/protovalidate/sys/third_party/cel-cpp/eval/public/ast_traverse.h +110 -0
  1240. data/ext/protovalidate/sys/third_party/cel-cpp/eval/public/ast_visitor.h +185 -0
  1241. data/ext/protovalidate/sys/third_party/cel-cpp/eval/public/ast_visitor_base.h +109 -0
  1242. data/ext/protovalidate/sys/third_party/cel-cpp/eval/public/base_activation.h +75 -0
  1243. data/ext/protovalidate/sys/third_party/cel-cpp/eval/public/builtin_func_registrar.cc +65 -0
  1244. data/ext/protovalidate/sys/third_party/cel-cpp/eval/public/builtin_func_registrar.h +30 -0
  1245. data/ext/protovalidate/sys/third_party/cel-cpp/eval/public/cel_attribute.cc +90 -0
  1246. data/ext/protovalidate/sys/third_party/cel-cpp/eval/public/cel_attribute.h +64 -0
  1247. data/ext/protovalidate/sys/third_party/cel-cpp/eval/public/cel_builtins.h +19 -0
  1248. data/ext/protovalidate/sys/third_party/cel-cpp/eval/public/cel_expr_builder_factory.cc +146 -0
  1249. data/ext/protovalidate/sys/third_party/cel-cpp/eval/public/cel_expr_builder_factory.h +43 -0
  1250. data/ext/protovalidate/sys/third_party/cel-cpp/eval/public/cel_expression.h +144 -0
  1251. data/ext/protovalidate/sys/third_party/cel-cpp/eval/public/cel_function.cc +76 -0
  1252. data/ext/protovalidate/sys/third_party/cel-cpp/eval/public/cel_function.h +80 -0
  1253. data/ext/protovalidate/sys/third_party/cel-cpp/eval/public/cel_function_adapter.h +121 -0
  1254. data/ext/protovalidate/sys/third_party/cel-cpp/eval/public/cel_function_adapter_impl.h +407 -0
  1255. data/ext/protovalidate/sys/third_party/cel-cpp/eval/public/cel_function_registry.cc +122 -0
  1256. data/ext/protovalidate/sys/third_party/cel-cpp/eval/public/cel_function_registry.h +146 -0
  1257. data/ext/protovalidate/sys/third_party/cel-cpp/eval/public/cel_number.cc +31 -0
  1258. data/ext/protovalidate/sys/third_party/cel-cpp/eval/public/cel_number.h +36 -0
  1259. data/ext/protovalidate/sys/third_party/cel-cpp/eval/public/cel_options.cc +51 -0
  1260. data/ext/protovalidate/sys/third_party/cel-cpp/eval/public/cel_options.h +233 -0
  1261. data/ext/protovalidate/sys/third_party/cel-cpp/eval/public/cel_type_registry.cc +64 -0
  1262. data/ext/protovalidate/sys/third_party/cel-cpp/eval/public/cel_type_registry.h +145 -0
  1263. data/ext/protovalidate/sys/third_party/cel-cpp/eval/public/cel_value.cc +412 -0
  1264. data/ext/protovalidate/sys/third_party/cel-cpp/eval/public/cel_value.h +770 -0
  1265. data/ext/protovalidate/sys/third_party/cel-cpp/eval/public/cel_value_internal.h +103 -0
  1266. data/ext/protovalidate/sys/third_party/cel-cpp/eval/public/cel_value_producer.h +25 -0
  1267. data/ext/protovalidate/sys/third_party/cel-cpp/eval/public/comparison_functions.h +36 -0
  1268. data/ext/protovalidate/sys/third_party/cel-cpp/eval/public/container_function_registrar.h +36 -0
  1269. data/ext/protovalidate/sys/third_party/cel-cpp/eval/public/containers/container_backed_list_impl.h +44 -0
  1270. data/ext/protovalidate/sys/third_party/cel-cpp/eval/public/containers/container_backed_map_impl.cc +131 -0
  1271. data/ext/protovalidate/sys/third_party/cel-cpp/eval/public/containers/container_backed_map_impl.h +70 -0
  1272. data/ext/protovalidate/sys/third_party/cel-cpp/eval/public/containers/field_access.cc +85 -0
  1273. data/ext/protovalidate/sys/third_party/cel-cpp/eval/public/containers/field_access.h +70 -0
  1274. data/ext/protovalidate/sys/third_party/cel-cpp/eval/public/containers/field_backed_list_impl.h +33 -0
  1275. data/ext/protovalidate/sys/third_party/cel-cpp/eval/public/containers/field_backed_map_impl.h +35 -0
  1276. data/ext/protovalidate/sys/third_party/cel-cpp/eval/public/containers/internal_field_backed_list_impl.cc +36 -0
  1277. data/ext/protovalidate/sys/third_party/cel-cpp/eval/public/containers/internal_field_backed_list_impl.h +59 -0
  1278. data/ext/protovalidate/sys/third_party/cel-cpp/eval/public/containers/internal_field_backed_map_impl.cc +298 -0
  1279. data/ext/protovalidate/sys/third_party/cel-cpp/eval/public/containers/internal_field_backed_map_impl.h +77 -0
  1280. data/ext/protovalidate/sys/third_party/cel-cpp/eval/public/equality_function_registrar.h +44 -0
  1281. data/ext/protovalidate/sys/third_party/cel-cpp/eval/public/extension_func_registrar.h +20 -0
  1282. data/ext/protovalidate/sys/third_party/cel-cpp/eval/public/logical_function_registrar.h +36 -0
  1283. data/ext/protovalidate/sys/third_party/cel-cpp/eval/public/message_wrapper.h +139 -0
  1284. data/ext/protovalidate/sys/third_party/cel-cpp/eval/public/portable_cel_function_adapter.h +72 -0
  1285. data/ext/protovalidate/sys/third_party/cel-cpp/eval/public/set_util.h +43 -0
  1286. data/ext/protovalidate/sys/third_party/cel-cpp/eval/public/source_position.h +65 -0
  1287. data/ext/protovalidate/sys/third_party/cel-cpp/eval/public/string_extension_func_registrar.cc +29 -0
  1288. data/ext/protovalidate/sys/third_party/cel-cpp/eval/public/string_extension_func_registrar.h +31 -0
  1289. data/ext/protovalidate/sys/third_party/cel-cpp/eval/public/structs/cel_proto_descriptor_pool_builder.h +40 -0
  1290. data/ext/protovalidate/sys/third_party/cel-cpp/eval/public/structs/cel_proto_wrap_util.cc +1479 -0
  1291. data/ext/protovalidate/sys/third_party/cel-cpp/eval/public/structs/cel_proto_wrap_util.h +45 -0
  1292. data/ext/protovalidate/sys/third_party/cel-cpp/eval/public/structs/cel_proto_wrapper.cc +60 -0
  1293. data/ext/protovalidate/sys/third_party/cel-cpp/eval/public/structs/cel_proto_wrapper.h +53 -0
  1294. data/ext/protovalidate/sys/third_party/cel-cpp/eval/public/structs/field_access_impl.cc +746 -0
  1295. data/ext/protovalidate/sys/third_party/cel-cpp/eval/public/structs/field_access_impl.h +80 -0
  1296. data/ext/protovalidate/sys/third_party/cel-cpp/eval/public/structs/legacy_type_adapter.h +177 -0
  1297. data/ext/protovalidate/sys/third_party/cel-cpp/eval/public/structs/legacy_type_info_apis.h +108 -0
  1298. data/ext/protovalidate/sys/third_party/cel-cpp/eval/public/structs/legacy_type_provider.cc +232 -0
  1299. data/ext/protovalidate/sys/third_party/cel-cpp/eval/public/structs/legacy_type_provider.h +79 -0
  1300. data/ext/protovalidate/sys/third_party/cel-cpp/eval/public/structs/proto_message_type_adapter.cc +708 -0
  1301. data/ext/protovalidate/sys/third_party/cel-cpp/eval/public/structs/proto_message_type_adapter.h +137 -0
  1302. data/ext/protovalidate/sys/third_party/cel-cpp/eval/public/structs/protobuf_descriptor_type_provider.cc +70 -0
  1303. data/ext/protovalidate/sys/third_party/cel-cpp/eval/public/structs/protobuf_descriptor_type_provider.h +67 -0
  1304. data/ext/protovalidate/sys/third_party/cel-cpp/eval/public/structs/protobuf_value_factory.h +36 -0
  1305. data/ext/protovalidate/sys/third_party/cel-cpp/eval/public/structs/trivial_legacy_type_info.h +54 -0
  1306. data/ext/protovalidate/sys/third_party/cel-cpp/eval/public/transform_utility.h +39 -0
  1307. data/ext/protovalidate/sys/third_party/cel-cpp/eval/public/unknown_attribute_set.h +20 -0
  1308. data/ext/protovalidate/sys/third_party/cel-cpp/eval/public/unknown_function_result_set.cc +1 -0
  1309. data/ext/protovalidate/sys/third_party/cel-cpp/eval/public/unknown_function_result_set.h +27 -0
  1310. data/ext/protovalidate/sys/third_party/cel-cpp/eval/public/unknown_set.h +22 -0
  1311. data/ext/protovalidate/sys/third_party/cel-cpp/eval/public/value_export_util.h +28 -0
  1312. data/ext/protovalidate/sys/third_party/cel-cpp/extensions/bindings_ext.h +46 -0
  1313. data/ext/protovalidate/sys/third_party/cel-cpp/extensions/comprehensions_v2.h +39 -0
  1314. data/ext/protovalidate/sys/third_party/cel-cpp/extensions/comprehensions_v2_functions.h +35 -0
  1315. data/ext/protovalidate/sys/third_party/cel-cpp/extensions/comprehensions_v2_macros.h +34 -0
  1316. data/ext/protovalidate/sys/third_party/cel-cpp/extensions/encoders.h +45 -0
  1317. data/ext/protovalidate/sys/third_party/cel-cpp/extensions/formatting.cc +570 -0
  1318. data/ext/protovalidate/sys/third_party/cel-cpp/extensions/formatting.h +39 -0
  1319. data/ext/protovalidate/sys/third_party/cel-cpp/extensions/lists_functions.h +138 -0
  1320. data/ext/protovalidate/sys/third_party/cel-cpp/extensions/math_ext.h +39 -0
  1321. data/ext/protovalidate/sys/third_party/cel-cpp/extensions/math_ext_decls.h +33 -0
  1322. data/ext/protovalidate/sys/third_party/cel-cpp/extensions/math_ext_macros.h +38 -0
  1323. data/ext/protovalidate/sys/third_party/cel-cpp/extensions/proto_ext.h +42 -0
  1324. data/ext/protovalidate/sys/third_party/cel-cpp/extensions/protobuf/ast_converters.h +56 -0
  1325. data/ext/protovalidate/sys/third_party/cel-cpp/extensions/protobuf/bind_proto_to_activation.h +38 -0
  1326. data/ext/protovalidate/sys/third_party/cel-cpp/extensions/protobuf/enum_adapter.h +30 -0
  1327. data/ext/protovalidate/sys/third_party/cel-cpp/extensions/protobuf/internal/map_reflection.cc +132 -0
  1328. data/ext/protovalidate/sys/third_party/cel-cpp/extensions/protobuf/internal/map_reflection.h +67 -0
  1329. data/ext/protovalidate/sys/third_party/cel-cpp/extensions/protobuf/internal/qualify.cc +457 -0
  1330. data/ext/protovalidate/sys/third_party/cel-cpp/extensions/protobuf/internal/qualify.h +117 -0
  1331. data/ext/protovalidate/sys/third_party/cel-cpp/extensions/protobuf/memory_manager.cc +37 -0
  1332. data/ext/protovalidate/sys/third_party/cel-cpp/extensions/protobuf/memory_manager.h +56 -0
  1333. data/ext/protovalidate/sys/third_party/cel-cpp/extensions/protobuf/runtime_adapter.h +51 -0
  1334. data/ext/protovalidate/sys/third_party/cel-cpp/extensions/protobuf/value.h +98 -0
  1335. data/ext/protovalidate/sys/third_party/cel-cpp/extensions/protobuf/value_testing.h +78 -0
  1336. data/ext/protovalidate/sys/third_party/cel-cpp/extensions/regex_ext.h +131 -0
  1337. data/ext/protovalidate/sys/third_party/cel-cpp/extensions/regex_functions.h +52 -0
  1338. data/ext/protovalidate/sys/third_party/cel-cpp/extensions/select_optimization.cc +958 -0
  1339. data/ext/protovalidate/sys/third_party/cel-cpp/extensions/select_optimization.h +90 -0
  1340. data/ext/protovalidate/sys/third_party/cel-cpp/extensions/sets_functions.h +45 -0
  1341. data/ext/protovalidate/sys/third_party/cel-cpp/extensions/strings.cc +432 -0
  1342. data/ext/protovalidate/sys/third_party/cel-cpp/extensions/strings.h +73 -0
  1343. data/ext/protovalidate/sys/third_party/cel-cpp/internal/align.h +95 -0
  1344. data/ext/protovalidate/sys/third_party/cel-cpp/internal/benchmark.h +20 -0
  1345. data/ext/protovalidate/sys/third_party/cel-cpp/internal/casts.h +50 -0
  1346. data/ext/protovalidate/sys/third_party/cel-cpp/internal/empty_descriptors.cc +73 -0
  1347. data/ext/protovalidate/sys/third_party/cel-cpp/internal/empty_descriptors.h +31 -0
  1348. data/ext/protovalidate/sys/third_party/cel-cpp/internal/equals_text_proto.h +65 -0
  1349. data/ext/protovalidate/sys/third_party/cel-cpp/internal/exceptions.h +35 -0
  1350. data/ext/protovalidate/sys/third_party/cel-cpp/internal/json.cc +2041 -0
  1351. data/ext/protovalidate/sys/third_party/cel-cpp/internal/json.h +141 -0
  1352. data/ext/protovalidate/sys/third_party/cel-cpp/internal/lexis.cc +79 -0
  1353. data/ext/protovalidate/sys/third_party/cel-cpp/internal/lexis.h +32 -0
  1354. data/ext/protovalidate/sys/third_party/cel-cpp/internal/manual.h +91 -0
  1355. data/ext/protovalidate/sys/third_party/cel-cpp/internal/message_equality.cc +1490 -0
  1356. data/ext/protovalidate/sys/third_party/cel-cpp/internal/message_equality.h +54 -0
  1357. data/ext/protovalidate/sys/third_party/cel-cpp/internal/message_type_name.h +56 -0
  1358. data/ext/protovalidate/sys/third_party/cel-cpp/internal/minimal_descriptor_database.h +32 -0
  1359. data/ext/protovalidate/sys/third_party/cel-cpp/internal/minimal_descriptor_pool.h +40 -0
  1360. data/ext/protovalidate/sys/third_party/cel-cpp/internal/names.h +26 -0
  1361. data/ext/protovalidate/sys/third_party/cel-cpp/internal/new.cc +142 -0
  1362. data/ext/protovalidate/sys/third_party/cel-cpp/internal/new.h +61 -0
  1363. data/ext/protovalidate/sys/third_party/cel-cpp/internal/noop_delete.h +53 -0
  1364. data/ext/protovalidate/sys/third_party/cel-cpp/internal/number.h +299 -0
  1365. data/ext/protovalidate/sys/third_party/cel-cpp/internal/overflow.cc +339 -0
  1366. data/ext/protovalidate/sys/third_party/cel-cpp/internal/overflow.h +178 -0
  1367. data/ext/protovalidate/sys/third_party/cel-cpp/internal/parse_text_proto.h +121 -0
  1368. data/ext/protovalidate/sys/third_party/cel-cpp/internal/proto_file_util.h +73 -0
  1369. data/ext/protovalidate/sys/third_party/cel-cpp/internal/proto_matchers.h +140 -0
  1370. data/ext/protovalidate/sys/third_party/cel-cpp/internal/proto_time_encoding.cc +103 -0
  1371. data/ext/protovalidate/sys/third_party/cel-cpp/internal/proto_time_encoding.h +49 -0
  1372. data/ext/protovalidate/sys/third_party/cel-cpp/internal/proto_util.h +87 -0
  1373. data/ext/protovalidate/sys/third_party/cel-cpp/internal/protobuf_runtime_version.h +32 -0
  1374. data/ext/protovalidate/sys/third_party/cel-cpp/internal/re2_options.h +61 -0
  1375. data/ext/protovalidate/sys/third_party/cel-cpp/internal/runfiles.h +36 -0
  1376. data/ext/protovalidate/sys/third_party/cel-cpp/internal/status_builder.h +114 -0
  1377. data/ext/protovalidate/sys/third_party/cel-cpp/internal/status_macros.h +152 -0
  1378. data/ext/protovalidate/sys/third_party/cel-cpp/internal/string_pool.cc +79 -0
  1379. data/ext/protovalidate/sys/third_party/cel-cpp/internal/string_pool.h +59 -0
  1380. data/ext/protovalidate/sys/third_party/cel-cpp/internal/strings.cc +693 -0
  1381. data/ext/protovalidate/sys/third_party/cel-cpp/internal/strings.h +90 -0
  1382. data/ext/protovalidate/sys/third_party/cel-cpp/internal/testing.h +44 -0
  1383. data/ext/protovalidate/sys/third_party/cel-cpp/internal/testing_descriptor_pool.h +35 -0
  1384. data/ext/protovalidate/sys/third_party/cel-cpp/internal/testing_message_factory.h +31 -0
  1385. data/ext/protovalidate/sys/third_party/cel-cpp/internal/time.cc +198 -0
  1386. data/ext/protovalidate/sys/third_party/cel-cpp/internal/time.h +65 -0
  1387. data/ext/protovalidate/sys/third_party/cel-cpp/internal/to_address.h +68 -0
  1388. data/ext/protovalidate/sys/third_party/cel-cpp/internal/unicode.h +28 -0
  1389. data/ext/protovalidate/sys/third_party/cel-cpp/internal/utf8.cc +526 -0
  1390. data/ext/protovalidate/sys/third_party/cel-cpp/internal/utf8.h +82 -0
  1391. data/ext/protovalidate/sys/third_party/cel-cpp/internal/well_known_types.cc +2181 -0
  1392. data/ext/protovalidate/sys/third_party/cel-cpp/internal/well_known_types.h +1593 -0
  1393. data/ext/protovalidate/sys/third_party/cel-cpp/parser/internal/ast_factory.cc +320 -0
  1394. data/ext/protovalidate/sys/third_party/cel-cpp/parser/internal/ast_factory.h +174 -0
  1395. data/ext/protovalidate/sys/third_party/cel-cpp/parser/internal/ast_factory_interface.h +130 -0
  1396. data/ext/protovalidate/sys/third_party/cel-cpp/parser/internal/lexer.cc +711 -0
  1397. data/ext/protovalidate/sys/third_party/cel-cpp/parser/internal/lexer.h +286 -0
  1398. data/ext/protovalidate/sys/third_party/cel-cpp/parser/internal/options.h +29 -0
  1399. data/ext/protovalidate/sys/third_party/cel-cpp/parser/internal/pratt_parser.cc +226 -0
  1400. data/ext/protovalidate/sys/third_party/cel-cpp/parser/internal/pratt_parser.h +110 -0
  1401. data/ext/protovalidate/sys/third_party/cel-cpp/parser/internal/pratt_parser_worker.cc +261 -0
  1402. data/ext/protovalidate/sys/third_party/cel-cpp/parser/internal/pratt_parser_worker.h +1143 -0
  1403. data/ext/protovalidate/sys/third_party/cel-cpp/parser/macro.cc +561 -0
  1404. data/ext/protovalidate/sys/third_party/cel-cpp/parser/macro.h +229 -0
  1405. data/ext/protovalidate/sys/third_party/cel-cpp/parser/macro_expr_factory.cc +128 -0
  1406. data/ext/protovalidate/sys/third_party/cel-cpp/parser/macro_expr_factory.h +333 -0
  1407. data/ext/protovalidate/sys/third_party/cel-cpp/parser/macro_registry.cc +87 -0
  1408. data/ext/protovalidate/sys/third_party/cel-cpp/parser/macro_registry.h +59 -0
  1409. data/ext/protovalidate/sys/third_party/cel-cpp/parser/options.h +115 -0
  1410. data/ext/protovalidate/sys/third_party/cel-cpp/parser/parser.cc +1995 -0
  1411. data/ext/protovalidate/sys/third_party/cel-cpp/parser/parser.h +102 -0
  1412. data/ext/protovalidate/sys/third_party/cel-cpp/parser/parser_interface.h +160 -0
  1413. data/ext/protovalidate/sys/third_party/cel-cpp/parser/parser_subset_factory.h +41 -0
  1414. data/ext/protovalidate/sys/third_party/cel-cpp/parser/source_factory.h +47 -0
  1415. data/ext/protovalidate/sys/third_party/cel-cpp/parser/standard_macros.h +31 -0
  1416. data/ext/protovalidate/sys/third_party/cel-cpp/policy/cel_policy.h +333 -0
  1417. data/ext/protovalidate/sys/third_party/cel-cpp/policy/cel_policy_parse_context.h +65 -0
  1418. data/ext/protovalidate/sys/third_party/cel-cpp/policy/cel_policy_parse_result.h +105 -0
  1419. data/ext/protovalidate/sys/third_party/cel-cpp/policy/cel_policy_parser.h +40 -0
  1420. data/ext/protovalidate/sys/third_party/cel-cpp/policy/cel_policy_validation_result.h +84 -0
  1421. data/ext/protovalidate/sys/third_party/cel-cpp/policy/compiler.h +50 -0
  1422. data/ext/protovalidate/sys/third_party/cel-cpp/policy/internal/issue_reporter.h +57 -0
  1423. data/ext/protovalidate/sys/third_party/cel-cpp/policy/internal/optimizer_expr_factory.h +419 -0
  1424. data/ext/protovalidate/sys/third_party/cel-cpp/policy/internal/yaml_string_element_scanner.h +40 -0
  1425. data/ext/protovalidate/sys/third_party/cel-cpp/policy/test_util.h +33 -0
  1426. data/ext/protovalidate/sys/third_party/cel-cpp/policy/yaml_policy_parser.h +135 -0
  1427. data/ext/protovalidate/sys/third_party/cel-cpp/runtime/activation.cc +141 -0
  1428. data/ext/protovalidate/sys/third_party/cel-cpp/runtime/activation.h +184 -0
  1429. data/ext/protovalidate/sys/third_party/cel-cpp/runtime/activation_interface.h +109 -0
  1430. data/ext/protovalidate/sys/third_party/cel-cpp/runtime/bind_proto_to_activation.h +174 -0
  1431. data/ext/protovalidate/sys/third_party/cel-cpp/runtime/comprehension_vulnerability_check.h +35 -0
  1432. data/ext/protovalidate/sys/third_party/cel-cpp/runtime/constant_folding.h +69 -0
  1433. data/ext/protovalidate/sys/third_party/cel-cpp/runtime/embedder_context.h +147 -0
  1434. data/ext/protovalidate/sys/third_party/cel-cpp/runtime/function.h +115 -0
  1435. data/ext/protovalidate/sys/third_party/cel-cpp/runtime/function_adapter.h +830 -0
  1436. data/ext/protovalidate/sys/third_party/cel-cpp/runtime/function_overload_reference.h +34 -0
  1437. data/ext/protovalidate/sys/third_party/cel-cpp/runtime/function_provider.h +46 -0
  1438. data/ext/protovalidate/sys/third_party/cel-cpp/runtime/function_registry.cc +263 -0
  1439. data/ext/protovalidate/sys/third_party/cel-cpp/runtime/function_registry.h +160 -0
  1440. data/ext/protovalidate/sys/third_party/cel-cpp/runtime/internal/activation_attribute_matcher_access.cc +61 -0
  1441. data/ext/protovalidate/sys/third_party/cel-cpp/runtime/internal/activation_attribute_matcher_access.h +60 -0
  1442. data/ext/protovalidate/sys/third_party/cel-cpp/runtime/internal/attribute_matcher.h +48 -0
  1443. data/ext/protovalidate/sys/third_party/cel-cpp/runtime/internal/convert_constant.cc +78 -0
  1444. data/ext/protovalidate/sys/third_party/cel-cpp/runtime/internal/convert_constant.h +39 -0
  1445. data/ext/protovalidate/sys/third_party/cel-cpp/runtime/internal/errors.cc +69 -0
  1446. data/ext/protovalidate/sys/third_party/cel-cpp/runtime/internal/errors.h +71 -0
  1447. data/ext/protovalidate/sys/third_party/cel-cpp/runtime/internal/function_adapter.h +232 -0
  1448. data/ext/protovalidate/sys/third_party/cel-cpp/runtime/internal/issue_collector.h +64 -0
  1449. data/ext/protovalidate/sys/third_party/cel-cpp/runtime/internal/legacy_runtime_type_provider.h +37 -0
  1450. data/ext/protovalidate/sys/third_party/cel-cpp/runtime/internal/runtime_env.cc +73 -0
  1451. data/ext/protovalidate/sys/third_party/cel-cpp/runtime/internal/runtime_env.h +134 -0
  1452. data/ext/protovalidate/sys/third_party/cel-cpp/runtime/internal/runtime_env_testing.h +60 -0
  1453. data/ext/protovalidate/sys/third_party/cel-cpp/runtime/internal/runtime_friend_access.h +45 -0
  1454. data/ext/protovalidate/sys/third_party/cel-cpp/runtime/internal/runtime_impl.cc +159 -0
  1455. data/ext/protovalidate/sys/third_party/cel-cpp/runtime/internal/runtime_impl.h +125 -0
  1456. data/ext/protovalidate/sys/third_party/cel-cpp/runtime/internal/runtime_type_provider.cc +96 -0
  1457. data/ext/protovalidate/sys/third_party/cel-cpp/runtime/internal/runtime_type_provider.h +66 -0
  1458. data/ext/protovalidate/sys/third_party/cel-cpp/runtime/optional_types.h +152 -0
  1459. data/ext/protovalidate/sys/third_party/cel-cpp/runtime/reference_resolver.h +46 -0
  1460. data/ext/protovalidate/sys/third_party/cel-cpp/runtime/regex_precompilation.h +32 -0
  1461. data/ext/protovalidate/sys/third_party/cel-cpp/runtime/register_function_helper.h +99 -0
  1462. data/ext/protovalidate/sys/third_party/cel-cpp/runtime/runtime.h +229 -0
  1463. data/ext/protovalidate/sys/third_party/cel-cpp/runtime/runtime_builder.h +101 -0
  1464. data/ext/protovalidate/sys/third_party/cel-cpp/runtime/runtime_builder_factory.h +65 -0
  1465. data/ext/protovalidate/sys/third_party/cel-cpp/runtime/runtime_issue.h +88 -0
  1466. data/ext/protovalidate/sys/third_party/cel-cpp/runtime/runtime_options.h +209 -0
  1467. data/ext/protovalidate/sys/third_party/cel-cpp/runtime/standard/arithmetic_functions.cc +233 -0
  1468. data/ext/protovalidate/sys/third_party/cel-cpp/runtime/standard/arithmetic_functions.h +35 -0
  1469. data/ext/protovalidate/sys/third_party/cel-cpp/runtime/standard/comparison_functions.cc +272 -0
  1470. data/ext/protovalidate/sys/third_party/cel-cpp/runtime/standard/comparison_functions.h +36 -0
  1471. data/ext/protovalidate/sys/third_party/cel-cpp/runtime/standard/container_functions.cc +136 -0
  1472. data/ext/protovalidate/sys/third_party/cel-cpp/runtime/standard/container_functions.h +36 -0
  1473. data/ext/protovalidate/sys/third_party/cel-cpp/runtime/standard/container_membership_functions.cc +331 -0
  1474. data/ext/protovalidate/sys/third_party/cel-cpp/runtime/standard/container_membership_functions.h +34 -0
  1475. data/ext/protovalidate/sys/third_party/cel-cpp/runtime/standard/equality_functions.cc +612 -0
  1476. data/ext/protovalidate/sys/third_party/cel-cpp/runtime/standard/equality_functions.h +60 -0
  1477. data/ext/protovalidate/sys/third_party/cel-cpp/runtime/standard/logical_functions.cc +66 -0
  1478. data/ext/protovalidate/sys/third_party/cel-cpp/runtime/standard/logical_functions.h +36 -0
  1479. data/ext/protovalidate/sys/third_party/cel-cpp/runtime/standard/regex_functions.cc +56 -0
  1480. data/ext/protovalidate/sys/third_party/cel-cpp/runtime/standard/regex_functions.h +38 -0
  1481. data/ext/protovalidate/sys/third_party/cel-cpp/runtime/standard/string_functions.cc +140 -0
  1482. data/ext/protovalidate/sys/third_party/cel-cpp/runtime/standard/string_functions.h +34 -0
  1483. data/ext/protovalidate/sys/third_party/cel-cpp/runtime/standard/time_functions.cc +499 -0
  1484. data/ext/protovalidate/sys/third_party/cel-cpp/runtime/standard/time_functions.h +56 -0
  1485. data/ext/protovalidate/sys/third_party/cel-cpp/runtime/standard/type_conversion_functions.cc +470 -0
  1486. data/ext/protovalidate/sys/third_party/cel-cpp/runtime/standard/type_conversion_functions.h +34 -0
  1487. data/ext/protovalidate/sys/third_party/cel-cpp/runtime/standard_functions.h +33 -0
  1488. data/ext/protovalidate/sys/third_party/cel-cpp/runtime/standard_runtime_builder_factory.h +43 -0
  1489. data/ext/protovalidate/sys/third_party/cel-cpp/runtime/type_registry.cc +84 -0
  1490. data/ext/protovalidate/sys/third_party/cel-cpp/runtime/type_registry.h +155 -0
  1491. data/ext/protovalidate/sys/third_party/cel-cpp/tools/branch_coverage.h +68 -0
  1492. data/ext/protovalidate/sys/third_party/cel-cpp/tools/cel_field_extractor.h +70 -0
  1493. data/ext/protovalidate/sys/third_party/cel-cpp/tools/cel_unparser.h +60 -0
  1494. data/ext/protovalidate/sys/third_party/cel-cpp/tools/descriptor_pool_builder.h +93 -0
  1495. data/ext/protovalidate/sys/third_party/cel-cpp/tools/flatbuffers_backed_impl.h +58 -0
  1496. data/ext/protovalidate/sys/third_party/cel-cpp/tools/navigable_ast.h +169 -0
  1497. data/ext/protovalidate/sys/third_party/cel-cpp/tools/proto_to_predicate.h +48 -0
  1498. data/ext/protovalidate/sys/third_party/cel-cpp/validator/ast_depth_validator.h +27 -0
  1499. data/ext/protovalidate/sys/third_party/cel-cpp/validator/comprehension_nesting_validator.h +31 -0
  1500. data/ext/protovalidate/sys/third_party/cel-cpp/validator/homogeneous_literal_validator.h +38 -0
  1501. data/ext/protovalidate/sys/third_party/cel-cpp/validator/regex_validator.h +53 -0
  1502. data/ext/protovalidate/sys/third_party/cel-cpp/validator/timestamp_literal_validator.h +29 -0
  1503. data/ext/protovalidate/sys/third_party/cel-cpp/validator/validator.cc +85 -0
  1504. data/ext/protovalidate/sys/third_party/cel-cpp/validator/validator.h +151 -0
  1505. data/ext/protovalidate/sys/third_party/protobuf/LICENSE +32 -0
  1506. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/any.cc +65 -0
  1507. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/any.h +161 -0
  1508. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/any.pb.cc +528 -0
  1509. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/any.pb.h +516 -0
  1510. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/any_lite.cc +95 -0
  1511. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/api.pb.cc +1959 -0
  1512. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/api.pb.h +1985 -0
  1513. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/arena.cc +1004 -0
  1514. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/arena.h +1238 -0
  1515. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/arena_align.cc +21 -0
  1516. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/arena_align.h +199 -0
  1517. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/arena_allocation_policy.h +102 -0
  1518. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/arena_cleanup.h +108 -0
  1519. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/arena_test_util.h +91 -0
  1520. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/arenastring.cc +290 -0
  1521. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/arenastring.h +545 -0
  1522. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/arenaz_sampler.cc +227 -0
  1523. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/arenaz_sampler.h +238 -0
  1524. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/compiler/annotation_test_util.h +105 -0
  1525. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/compiler/code_generator.h +256 -0
  1526. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/compiler/code_generator_lite.h +77 -0
  1527. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/compiler/command_line_interface.h +517 -0
  1528. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/compiler/command_line_interface_tester.h +162 -0
  1529. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/compiler/importer.cc +594 -0
  1530. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/compiler/importer.h +338 -0
  1531. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/compiler/mock_code_generator.h +144 -0
  1532. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/compiler/notices.h +242 -0
  1533. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/compiler/package_info.h +40 -0
  1534. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/compiler/parser.cc +2716 -0
  1535. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/compiler/parser.h +642 -0
  1536. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/compiler/plugin.h +73 -0
  1537. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/compiler/plugin.pb.h +2320 -0
  1538. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/compiler/retention.h +70 -0
  1539. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/compiler/scc.h +155 -0
  1540. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/compiler/subprocess.h +91 -0
  1541. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/compiler/versions.h +78 -0
  1542. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/compiler/zip_writer.h +45 -0
  1543. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/cpp_edition_defaults.h +12 -0
  1544. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/cpp_features.pb.cc +539 -0
  1545. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/cpp_features.pb.h +630 -0
  1546. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/descriptor.cc +10801 -0
  1547. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/descriptor.h +3417 -0
  1548. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/descriptor.pb.cc +18982 -0
  1549. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/descriptor.pb.h +23170 -0
  1550. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/descriptor_database.cc +1102 -0
  1551. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/descriptor_database.h +423 -0
  1552. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/descriptor_legacy.h +32 -0
  1553. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/descriptor_lite.h +110 -0
  1554. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/descriptor_test_utils.h +129 -0
  1555. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/descriptor_visitor.h +187 -0
  1556. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/duration.pb.cc +481 -0
  1557. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/duration.pb.h +367 -0
  1558. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/dynamic_message.cc +1104 -0
  1559. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/dynamic_message.h +217 -0
  1560. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/empty.pb.cc +285 -0
  1561. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/empty.pb.h +245 -0
  1562. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/endian.h +192 -0
  1563. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/explicitly_constructed.h +71 -0
  1564. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/extension_set.cc +1925 -0
  1565. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/extension_set.h +1886 -0
  1566. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/extension_set_heavy.cc +459 -0
  1567. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/extension_set_inl.h +274 -0
  1568. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/feature_resolver.cc +637 -0
  1569. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/feature_resolver.h +108 -0
  1570. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/field_access_listener.h +166 -0
  1571. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/field_mask.pb.cc +472 -0
  1572. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/field_mask.pb.h +396 -0
  1573. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/field_with_arena.h +110 -0
  1574. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/generated_enum_reflection.h +187 -0
  1575. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/generated_enum_util.cc +223 -0
  1576. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/generated_enum_util.h +185 -0
  1577. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/generated_message_bases.cc +88 -0
  1578. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/generated_message_bases.h +68 -0
  1579. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/generated_message_reflection.cc +4185 -0
  1580. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/generated_message_reflection.h +372 -0
  1581. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/generated_message_tctable_decl.h +615 -0
  1582. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/generated_message_tctable_full.cc +105 -0
  1583. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/generated_message_tctable_gen.cc +960 -0
  1584. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/generated_message_tctable_gen.h +193 -0
  1585. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/generated_message_tctable_impl.h +1229 -0
  1586. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/generated_message_tctable_lite.cc +3308 -0
  1587. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/generated_message_util.cc +434 -0
  1588. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/generated_message_util.h +445 -0
  1589. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/has_bits.h +138 -0
  1590. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/implicit_weak_message.cc +139 -0
  1591. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/implicit_weak_message.h +266 -0
  1592. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/inlined_string_field.cc +144 -0
  1593. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/inlined_string_field.h +379 -0
  1594. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/internal_feature_helper.cc +28 -0
  1595. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/internal_feature_helper.h +130 -0
  1596. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/internal_metadata_locator.h +291 -0
  1597. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/internal_visibility.h +55 -0
  1598. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/internal_visibility_for_testing.h +27 -0
  1599. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/io/coded_stream.cc +1045 -0
  1600. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/io/coded_stream.h +1885 -0
  1601. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/io/gzip_stream.cc +333 -0
  1602. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/io/gzip_stream.h +189 -0
  1603. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/io/io_win32.cc +450 -0
  1604. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/io/io_win32.h +118 -0
  1605. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/io/package_info.h +30 -0
  1606. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/io/printer.cc +842 -0
  1607. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/io/printer.h +1183 -0
  1608. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/io/strtod.cc +260 -0
  1609. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/io/strtod.h +57 -0
  1610. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/io/test_zero_copy_stream.h +185 -0
  1611. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/io/tokenizer.cc +1262 -0
  1612. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/io/tokenizer.h +441 -0
  1613. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/io/zero_copy_sink.cc +45 -0
  1614. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/io/zero_copy_sink.h +59 -0
  1615. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/io/zero_copy_stream.cc +128 -0
  1616. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/io/zero_copy_stream.h +269 -0
  1617. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/io/zero_copy_stream_impl.cc +354 -0
  1618. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/io/zero_copy_stream_impl.h +319 -0
  1619. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/io/zero_copy_stream_impl_lite.cc +699 -0
  1620. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/io/zero_copy_stream_impl_lite.h +533 -0
  1621. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/json/internal/descriptor_traits.h +510 -0
  1622. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/json/internal/lexer.cc +512 -0
  1623. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/json/internal/lexer.h +341 -0
  1624. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/json/internal/message_path.cc +46 -0
  1625. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/json/internal/message_path.h +61 -0
  1626. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/json/internal/parser.cc +1437 -0
  1627. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/json/internal/parser.h +37 -0
  1628. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/json/internal/parser_traits.h +400 -0
  1629. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/json/internal/unparser.cc +915 -0
  1630. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/json/internal/unparser.h +38 -0
  1631. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/json/internal/unparser_traits.h +414 -0
  1632. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/json/internal/untyped_message.cc +577 -0
  1633. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/json/internal/untyped_message.h +246 -0
  1634. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/json/internal/writer.cc +307 -0
  1635. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/json/internal/writer.h +214 -0
  1636. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/json/internal/zero_copy_buffered_stream.cc +152 -0
  1637. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/json/internal/zero_copy_buffered_stream.h +338 -0
  1638. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/json/json.cc +137 -0
  1639. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/json/json.h +200 -0
  1640. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/map.cc +297 -0
  1641. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/map.h +1787 -0
  1642. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/map_entry.h +139 -0
  1643. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/map_field.cc +597 -0
  1644. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/map_field.h +925 -0
  1645. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/map_field_lite.h +124 -0
  1646. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/map_test.inc +4427 -0
  1647. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/map_test_util.h +617 -0
  1648. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/map_type_handler.h +374 -0
  1649. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/message.cc +745 -0
  1650. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/message.h +1936 -0
  1651. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/message_lite.cc +807 -0
  1652. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/message_lite.h +1861 -0
  1653. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/message_unittest.inc +2302 -0
  1654. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/message_unittest_legacy_apis.inc +98 -0
  1655. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/metadata.h +13 -0
  1656. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/metadata_lite.h +271 -0
  1657. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/micro_string.cc +376 -0
  1658. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/micro_string.h +649 -0
  1659. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/os_macros_restore.inc +97 -0
  1660. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/os_macros_undef.inc +166 -0
  1661. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/package_info.h +43 -0
  1662. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/parse_context.cc +850 -0
  1663. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/parse_context.h +1883 -0
  1664. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/port.cc +131 -0
  1665. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/port.h +908 -0
  1666. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/port_def.inc +820 -0
  1667. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/port_undef.inc +97 -0
  1668. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/proto3_lite_unittest.inc +127 -0
  1669. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/raw_ptr.cc +29 -0
  1670. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/raw_ptr.h +64 -0
  1671. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/reflection.h +603 -0
  1672. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/reflection_internal.h +313 -0
  1673. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/reflection_mode.cc +36 -0
  1674. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/reflection_mode.h +144 -0
  1675. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/reflection_ops.cc +456 -0
  1676. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/reflection_ops.h +67 -0
  1677. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/reflection_tester.h +127 -0
  1678. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/reflection_visit_field_info.h +1378 -0
  1679. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/reflection_visit_fields.h +511 -0
  1680. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/repeated_field.cc +76 -0
  1681. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/repeated_field.h +1814 -0
  1682. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/repeated_field_proxy.h +697 -0
  1683. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/repeated_field_proxy_iterator.h +236 -0
  1684. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/repeated_field_proxy_traits.h +100 -0
  1685. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/repeated_field_reflection_unittest.inc +687 -0
  1686. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/repeated_ptr_field.cc +251 -0
  1687. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h +2706 -0
  1688. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/runtime_version.h +27 -0
  1689. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/serial_arena.h +447 -0
  1690. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/service.cc +22 -0
  1691. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/service.h +271 -0
  1692. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/source_context.pb.cc +463 -0
  1693. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/source_context.pb.h +376 -0
  1694. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/string_block.h +181 -0
  1695. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/string_member_robber.h +17 -0
  1696. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/struct.pb.cc +1663 -0
  1697. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/struct.pb.h +1426 -0
  1698. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/stubs/callback.h +584 -0
  1699. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/stubs/common.cc +121 -0
  1700. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/stubs/common.h +94 -0
  1701. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/stubs/platform_macros.h +115 -0
  1702. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/stubs/port.h +228 -0
  1703. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/stubs/status_macros.h +72 -0
  1704. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/symbol_checker.cc +219 -0
  1705. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/symbol_checker.h +142 -0
  1706. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/test_textproto.h +54 -0
  1707. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/test_util.h +3897 -0
  1708. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/test_util2.h +70 -0
  1709. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/test_util_lite.h +86 -0
  1710. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/text_format.cc +3324 -0
  1711. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/text_format.h +925 -0
  1712. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/thread_safe_arena.h +297 -0
  1713. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/timestamp.pb.cc +481 -0
  1714. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/timestamp.pb.h +367 -0
  1715. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/type.pb.cc +3129 -0
  1716. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/type.pb.h +3343 -0
  1717. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/unknown_field_set.cc +351 -0
  1718. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/unknown_field_set.h +464 -0
  1719. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/util/delimited_message_util.cc +107 -0
  1720. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/util/delimited_message_util.h +85 -0
  1721. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/util/field_comparator.cc +237 -0
  1722. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/util/field_comparator.h +256 -0
  1723. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/util/field_mask_util.cc +754 -0
  1724. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/util/field_mask_util.h +242 -0
  1725. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/util/internal_timeval.h +28 -0
  1726. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/util/json_util.h +34 -0
  1727. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/util/message_differencer.cc +2372 -0
  1728. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/util/message_differencer.h +1002 -0
  1729. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/util/package_info.h +23 -0
  1730. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/util/python/field_mask_util_clif_aux.h +32 -0
  1731. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/util/time_util.cc +563 -0
  1732. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/util/time_util.h +297 -0
  1733. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/util/type_resolver.h +56 -0
  1734. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/util/type_resolver_util.cc +436 -0
  1735. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/util/type_resolver_util.h +45 -0
  1736. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/varint_shuffle.h +165 -0
  1737. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/wire_format.cc +1785 -0
  1738. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/wire_format.h +374 -0
  1739. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/wire_format_lite.cc +901 -0
  1740. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/wire_format_lite.h +1720 -0
  1741. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/wire_format_unittest.h +1726 -0
  1742. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/wrappers.pb.cc +3203 -0
  1743. data/ext/protovalidate/sys/third_party/protobuf/src/google/protobuf/wrappers.pb.h +2317 -0
  1744. data/ext/protovalidate/sys/third_party/protobuf/third_party/utf8_range/utf8_range.c +207 -0
  1745. data/ext/protovalidate/sys/third_party/protobuf/third_party/utf8_range/utf8_range.h +23 -0
  1746. data/ext/protovalidate/sys/third_party/protobuf/third_party/utf8_range/utf8_range_neon.inc +117 -0
  1747. data/ext/protovalidate/sys/third_party/protobuf/third_party/utf8_range/utf8_range_sse.inc +272 -0
  1748. data/ext/protovalidate/sys/third_party/protobuf/third_party/utf8_range/utf8_validity.h +30 -0
  1749. data/ext/protovalidate/sys/third_party/protovalidate-cc/LICENSE +201 -0
  1750. data/ext/protovalidate/sys/third_party/protovalidate-cc/buf/validate/internal/cel_rules.h +116 -0
  1751. data/ext/protovalidate/sys/third_party/protovalidate-cc/buf/validate/internal/cel_validation_rules.cc +166 -0
  1752. data/ext/protovalidate/sys/third_party/protovalidate-cc/buf/validate/internal/cel_validation_rules.h +72 -0
  1753. data/ext/protovalidate/sys/third_party/protovalidate-cc/buf/validate/internal/extra_func.cc +482 -0
  1754. data/ext/protovalidate/sys/third_party/protovalidate-cc/buf/validate/internal/extra_func.h +31 -0
  1755. data/ext/protovalidate/sys/third_party/protovalidate-cc/buf/validate/internal/field_rules.cc +388 -0
  1756. data/ext/protovalidate/sys/third_party/protovalidate-cc/buf/validate/internal/field_rules.h +92 -0
  1757. data/ext/protovalidate/sys/third_party/protovalidate-cc/buf/validate/internal/lib/ipv4.cc +69 -0
  1758. data/ext/protovalidate/sys/third_party/protovalidate-cc/buf/validate/internal/lib/ipv4.h +58 -0
  1759. data/ext/protovalidate/sys/third_party/protovalidate-cc/buf/validate/internal/lib/ipv6.cc +143 -0
  1760. data/ext/protovalidate/sys/third_party/protovalidate-cc/buf/validate/internal/lib/ipv6.h +51 -0
  1761. data/ext/protovalidate/sys/third_party/protovalidate-cc/buf/validate/internal/lib/parser_common.h +256 -0
  1762. data/ext/protovalidate/sys/third_party/protovalidate-cc/buf/validate/internal/lib/uri.cc +469 -0
  1763. data/ext/protovalidate/sys/third_party/protovalidate-cc/buf/validate/internal/lib/uri.h +25 -0
  1764. data/ext/protovalidate/sys/third_party/protovalidate-cc/buf/validate/internal/message_factory.cc +31 -0
  1765. data/ext/protovalidate/sys/third_party/protovalidate-cc/buf/validate/internal/message_factory.h +43 -0
  1766. data/ext/protovalidate/sys/third_party/protovalidate-cc/buf/validate/internal/message_rules.cc +114 -0
  1767. data/ext/protovalidate/sys/third_party/protovalidate-cc/buf/validate/internal/message_rules.h +39 -0
  1768. data/ext/protovalidate/sys/third_party/protovalidate-cc/buf/validate/internal/proto_field.h +155 -0
  1769. data/ext/protovalidate/sys/third_party/protovalidate-cc/buf/validate/internal/rules.cc +437 -0
  1770. data/ext/protovalidate/sys/third_party/protovalidate-cc/buf/validate/internal/rules.h +221 -0
  1771. data/ext/protovalidate/sys/third_party/protovalidate-cc/buf/validate/internal/validation_rules.h +153 -0
  1772. data/ext/protovalidate/sys/third_party/protovalidate-cc/buf/validate/validator.cc +190 -0
  1773. data/ext/protovalidate/sys/third_party/protovalidate-cc/buf/validate/validator.h +156 -0
  1774. data/ext/protovalidate/sys/third_party/re2/LICENSE +27 -0
  1775. data/ext/protovalidate/sys/third_party/re2/re2/bitmap256.cc +43 -0
  1776. data/ext/protovalidate/sys/third_party/re2/re2/bitmap256.h +88 -0
  1777. data/ext/protovalidate/sys/third_party/re2/re2/bitstate.cc +389 -0
  1778. data/ext/protovalidate/sys/third_party/re2/re2/compile.cc +1265 -0
  1779. data/ext/protovalidate/sys/third_party/re2/re2/dfa.cc +2135 -0
  1780. data/ext/protovalidate/sys/third_party/re2/re2/filtered_re2.cc +138 -0
  1781. data/ext/protovalidate/sys/third_party/re2/re2/filtered_re2.h +115 -0
  1782. data/ext/protovalidate/sys/third_party/re2/re2/mimics_pcre.cc +196 -0
  1783. data/ext/protovalidate/sys/third_party/re2/re2/nfa.cc +714 -0
  1784. data/ext/protovalidate/sys/third_party/re2/re2/onepass.cc +623 -0
  1785. data/ext/protovalidate/sys/third_party/re2/re2/parse.cc +2529 -0
  1786. data/ext/protovalidate/sys/third_party/re2/re2/perl_groups.cc +119 -0
  1787. data/ext/protovalidate/sys/third_party/re2/re2/pod_array.h +55 -0
  1788. data/ext/protovalidate/sys/third_party/re2/re2/prefilter.cc +711 -0
  1789. data/ext/protovalidate/sys/third_party/re2/re2/prefilter.h +168 -0
  1790. data/ext/protovalidate/sys/third_party/re2/re2/prefilter_tree.cc +376 -0
  1791. data/ext/protovalidate/sys/third_party/re2/re2/prefilter_tree.h +153 -0
  1792. data/ext/protovalidate/sys/third_party/re2/re2/prog.cc +1181 -0
  1793. data/ext/protovalidate/sys/third_party/re2/re2/prog.h +493 -0
  1794. data/ext/protovalidate/sys/third_party/re2/re2/re2.cc +1355 -0
  1795. data/ext/protovalidate/sys/third_party/re2/re2/re2.h +1074 -0
  1796. data/ext/protovalidate/sys/third_party/re2/re2/regexp.cc +1004 -0
  1797. data/ext/protovalidate/sys/third_party/re2/re2/regexp.h +693 -0
  1798. data/ext/protovalidate/sys/third_party/re2/re2/set.cc +185 -0
  1799. data/ext/protovalidate/sys/third_party/re2/re2/set.h +91 -0
  1800. data/ext/protovalidate/sys/third_party/re2/re2/simplify.cc +689 -0
  1801. data/ext/protovalidate/sys/third_party/re2/re2/sparse_array.h +394 -0
  1802. data/ext/protovalidate/sys/third_party/re2/re2/sparse_set.h +266 -0
  1803. data/ext/protovalidate/sys/third_party/re2/re2/stringpiece.h +18 -0
  1804. data/ext/protovalidate/sys/third_party/re2/re2/tostring.cc +351 -0
  1805. data/ext/protovalidate/sys/third_party/re2/re2/unicode_casefold.cc +604 -0
  1806. data/ext/protovalidate/sys/third_party/re2/re2/unicode_casefold.h +77 -0
  1807. data/ext/protovalidate/sys/third_party/re2/re2/unicode_groups.cc +6517 -0
  1808. data/ext/protovalidate/sys/third_party/re2/re2/unicode_groups.h +66 -0
  1809. data/ext/protovalidate/sys/third_party/re2/re2/walker-inl.h +249 -0
  1810. data/ext/protovalidate/sys/third_party/re2/util/malloc_counter.h +19 -0
  1811. data/ext/protovalidate/sys/third_party/re2/util/pcre.h +671 -0
  1812. data/ext/protovalidate/sys/third_party/re2/util/rune.cc +260 -0
  1813. data/ext/protovalidate/sys/third_party/re2/util/strutil.cc +26 -0
  1814. data/ext/protovalidate/sys/third_party/re2/util/strutil.h +16 -0
  1815. data/ext/protovalidate/sys/third_party/re2/util/utf.h +44 -0
  1816. data/ext/protovalidate/sys/versions.json +15 -0
  1817. data/lib/buf/validate/validate_pb.rb +55 -0
  1818. data/lib/protovalidate/errors.rb +32 -0
  1819. data/lib/protovalidate/native.rb +30 -0
  1820. data/lib/protovalidate/validator.rb +96 -0
  1821. data/lib/protovalidate/version.rb +10 -0
  1822. data/lib/protovalidate/violation.rb +115 -0
  1823. data/lib/protovalidate.rb +48 -0
  1824. data/sig/buf/validate/validate_pb.rbs +64 -0
  1825. data/sig/protovalidate/native.rbs +14 -0
  1826. data/sig/protovalidate.rbs +90 -0
  1827. metadata +1900 -0
@@ -0,0 +1,2706 @@
1
+ // Protocol Buffers - Google's data interchange format
2
+ // Copyright 2008 Google Inc. All rights reserved.
3
+ //
4
+ // Use of this source code is governed by a BSD-style
5
+ // license that can be found in the LICENSE file or at
6
+ // https://developers.google.com/open-source/licenses/bsd
7
+
8
+ // Author: kenton@google.com (Kenton Varda)
9
+ // Based on original Protocol Buffers design by
10
+ // Sanjay Ghemawat, Jeff Dean, and others.
11
+ //
12
+ // RepeatedField and RepeatedPtrField are used by generated protocol message
13
+ // classes to manipulate repeated fields. These classes are very similar to
14
+ // STL's vector, but include a number of optimizations found to be useful
15
+ // specifically in the case of Protocol Buffers. RepeatedPtrField is
16
+ // particularly different from STL vector as it manages ownership of the
17
+ // pointers that it contains.
18
+ //
19
+ // This header covers RepeatedPtrField.
20
+
21
+ #ifndef GOOGLE_PROTOBUF_REPEATED_PTR_FIELD_H__
22
+ #define GOOGLE_PROTOBUF_REPEATED_PTR_FIELD_H__
23
+
24
+ #include <algorithm>
25
+ #include <cstddef>
26
+ #include <cstdint>
27
+ #include <cstdlib>
28
+ #include <functional>
29
+ #include <iterator>
30
+ #include <limits>
31
+ #include <string>
32
+ #include <type_traits>
33
+ #include <utility>
34
+
35
+ #include "absl/base/attributes.h"
36
+ #include "absl/base/no_destructor.h"
37
+ #include "absl/base/optimization.h"
38
+ #include "absl/base/prefetch.h"
39
+ #include "absl/functional/function_ref.h"
40
+ #include "absl/log/absl_check.h"
41
+ #include "absl/strings/string_view.h"
42
+ #include "google/protobuf/arena.h"
43
+ #include "google/protobuf/arena_align.h"
44
+ #include "google/protobuf/field_with_arena.h"
45
+ #include "google/protobuf/internal_metadata_locator.h"
46
+ #include "google/protobuf/internal_visibility.h"
47
+ #include "google/protobuf/message_lite.h"
48
+ #include "google/protobuf/port.h"
49
+
50
+ // Must be included last.
51
+ #include "google/protobuf/port_def.inc"
52
+
53
+ #ifdef SWIG
54
+ #error "You cannot SWIG proto headers"
55
+ #endif
56
+
57
+ namespace google {
58
+ namespace protobuf {
59
+
60
+ class DynamicMessage;
61
+ class Message;
62
+ class Reflection;
63
+
64
+
65
+ template <typename T>
66
+ struct WeakRepeatedPtrField;
67
+
68
+ template <typename ElementType>
69
+ class RepeatedFieldProxy;
70
+
71
+ namespace internal {
72
+
73
+ class MergePartialFromCodedStreamHelper;
74
+ class SwapFieldHelper;
75
+ class MapFieldBase;
76
+
77
+ template <typename Element>
78
+ class RepeatedPtrIterator;
79
+ template <typename Element>
80
+ class RepeatedPtrOverPtrsIterator;
81
+ template <typename T>
82
+ class RepeatedPtrFieldBackInsertIterator;
83
+ template <typename T>
84
+ class AllocatedRepeatedPtrFieldBackInsertIterator;
85
+
86
+ class RepeatedPtrFieldTest;
87
+
88
+ template <typename Element>
89
+ auto ConvertToPtrIterator(RepeatedPtrIterator<Element> it);
90
+
91
+ // Swaps two non-overlapping blocks of memory of size `N`
92
+ template <size_t N>
93
+ inline void memswap(char* PROTOBUF_RESTRICT a, char* PROTOBUF_RESTRICT b) {
94
+ // `PROTOBUF_RESTRICT` tells compiler that blocks do not overlapping which
95
+ // allows it to generate optimized code for swap_ranges.
96
+ std::swap_ranges(a, a + N, b);
97
+ }
98
+
99
+ // A trait that tells offset of `T::resolver_`.
100
+ //
101
+ // Do not use this struct - it exists for internal use only.
102
+ template <typename T>
103
+ struct InternalMetadataResolverOffsetHelper {
104
+ static constexpr size_t value = offsetof(T, resolver_);
105
+ };
106
+
107
+ // Copies the object in the arena.
108
+ // Used in the slow path. Out-of-line for lower binary size cost.
109
+ PROTOBUF_EXPORT MessageLite* CloneSlow(Arena* arena, const MessageLite& value);
110
+ PROTOBUF_EXPORT std::string* CloneSlow(Arena* arena, const std::string& value);
111
+
112
+ enum class BoundsCheckMessageType {
113
+ kIndex,
114
+ kGe,
115
+ kLe,
116
+ };
117
+
118
+ // A utility function for logging that doesn't need any template types.
119
+ PROTOBUF_EXPORT void LogIndexOutOfBounds(int index, int size);
120
+
121
+ // A utility function for logging that doesn't need any template types. Same as
122
+ // LogIndexOutOfBounds, but aborts the program in all cases by logging to FATAL
123
+ // instead of DFATAL.
124
+ // TODO: Remove preserve_all and add no_return once experiment is
125
+ // complete.
126
+ [[noreturn]] PROTOBUF_PRESERVE_ALL PROTOBUF_EXPORT void
127
+ LogIndexOutOfBoundsAndAbort(
128
+ int64_t index, int64_t size,
129
+ BoundsCheckMessageType type = BoundsCheckMessageType::kIndex);
130
+ PROTOBUF_EXPORT inline void RuntimeAssertInBounds(int index, int size) {
131
+ if constexpr (GetBoundsCheckMode() == BoundsCheckMode::kAbort) {
132
+ if (ABSL_PREDICT_FALSE(index < 0 || index >= size)) {
133
+ // "No merge" attribute used to improve debuggability by telling the
134
+ // compiler not to merge these failure paths. Note that this is currently
135
+ // best-effort in clang/llvm.
136
+ PROTOBUF_NO_MERGE LogIndexOutOfBoundsAndAbort(index, size);
137
+ }
138
+ }
139
+ ABSL_DCHECK_GE(index, 0);
140
+ ABSL_DCHECK_LT(index, size);
141
+ }
142
+
143
+ PROTOBUF_EXPORT inline void RuntimeAssertInBoundsLE(int64_t value,
144
+ int64_t limit) {
145
+ if constexpr (GetBoundsCheckMode() == BoundsCheckMode::kAbort) {
146
+ if (ABSL_PREDICT_FALSE(value > limit)) {
147
+ PROTOBUF_NO_MERGE LogIndexOutOfBoundsAndAbort(
148
+ value, limit, BoundsCheckMessageType::kLe);
149
+ }
150
+ }
151
+
152
+ ABSL_DCHECK_LE(value, limit);
153
+ }
154
+
155
+ PROTOBUF_EXPORT inline void RuntimeAssertInBoundsGE(int64_t value,
156
+ int64_t limit) {
157
+ if constexpr (GetBoundsCheckMode() == BoundsCheckMode::kAbort) {
158
+ if (ABSL_PREDICT_FALSE(value < limit)) {
159
+ PROTOBUF_NO_MERGE LogIndexOutOfBoundsAndAbort(
160
+ value, limit, BoundsCheckMessageType::kGe);
161
+ }
162
+ }
163
+ ABSL_DCHECK_GE(value, limit);
164
+ }
165
+
166
+ // Defined further below.
167
+ template <typename Type>
168
+ class GenericTypeHandler;
169
+
170
+ using ElementNewFn = void(Arena*, void*& ptr);
171
+
172
+ // This is the common base class for RepeatedPtrFields. It deals only in void*
173
+ // pointers. Users should not use this interface directly.
174
+ //
175
+ // The methods of this interface correspond to the methods of RepeatedPtrField,
176
+ // but may have a template argument called TypeHandler. Its signature is:
177
+ // class TypeHandler {
178
+ // public:
179
+ // using Type = MyType;
180
+ //
181
+ // static Type*(*)(Arena*) GetNewFunc();
182
+ // static Type*(*)(Arena*) GetNewFromPrototypeFunc(const Type* prototype);
183
+ // static Arena* GetArena(Type* value);
184
+ //
185
+ // static Type* New(Arena* arena, Type&& value);
186
+ // static void Delete(Type*);
187
+ // static void Clear(Type*);
188
+ //
189
+ // // Only needs to be implemented if SpaceUsedExcludingSelf() is called.
190
+ // static int SpaceUsedLong(const Type&);
191
+ //
192
+ // static const Type& default_instance();
193
+ // };
194
+ class PROTOBUF_EXPORT RepeatedPtrFieldBase {
195
+ template <typename TypeHandler>
196
+ using Value = typename TypeHandler::Type;
197
+
198
+ static constexpr int kSSOCapacity = 1;
199
+
200
+ protected:
201
+ // We use the same TypeHandler for all Message types to deduplicate generated
202
+ // code.
203
+ template <typename TypeHandler>
204
+ using CommonHandler = typename std::conditional<
205
+ std::is_base_of<MessageLite, Value<TypeHandler>>::value,
206
+ GenericTypeHandler<MessageLite>, TypeHandler>::type;
207
+
208
+ constexpr RepeatedPtrFieldBase()
209
+ : tagged_rep_or_elem_(nullptr), current_size_(0) {}
210
+ constexpr explicit RepeatedPtrFieldBase(InternalMetadataOffset offset)
211
+ : tagged_rep_or_elem_(nullptr), current_size_(0), resolver_(offset) {}
212
+
213
+ RepeatedPtrFieldBase(const RepeatedPtrFieldBase&) = delete;
214
+ RepeatedPtrFieldBase& operator=(const RepeatedPtrFieldBase&) = delete;
215
+
216
+ ~RepeatedPtrFieldBase() {
217
+ #ifndef NDEBUG
218
+ // Try to trigger segfault / asan failure in non-opt builds if the arena
219
+ // lifetime has ended before the destructor. Note that `GetArena()` is
220
+ // not free, but this is debug-only.
221
+ const Arena* arena = GetArena();
222
+ if (arena != nullptr) (void)arena->SpaceAllocated();
223
+ #endif
224
+ }
225
+
226
+ bool empty() const { return current_size_ == 0; }
227
+ int size() const { return current_size_; }
228
+ // Returns the size of the buffer with pointers to elements.
229
+ //
230
+ // Note:
231
+ //
232
+ // * prefer `SizeAtCapacity()` to `size() == Capacity()`;
233
+ // * prefer `AllocatedSizeAtCapacity()` to `allocated_size() == Capacity()`.
234
+ int Capacity() const { return using_sso() ? kSSOCapacity : rep()->capacity; }
235
+
236
+ template <typename TypeHandler>
237
+ const Value<TypeHandler>& at(int index) const {
238
+ ABSL_CHECK_GE(index, 0);
239
+ ABSL_CHECK_LT(index, current_size_);
240
+ return *cast<TypeHandler>(element_at(index));
241
+ }
242
+
243
+ template <typename TypeHandler>
244
+ Value<TypeHandler>& at(int index) {
245
+ ABSL_CHECK_GE(index, 0);
246
+ ABSL_CHECK_LT(index, current_size_);
247
+ return *cast<TypeHandler>(element_at(index));
248
+ }
249
+
250
+ template <typename TypeHandler>
251
+ Value<TypeHandler>* Mutable(int index) {
252
+ RuntimeAssertInBounds(index, current_size_);
253
+ return cast<TypeHandler>(element_at(index));
254
+ }
255
+
256
+ template <typename TypeHandler>
257
+ Value<TypeHandler>* Add(Arena* arena) {
258
+ return cast<TypeHandler>(AddInternal(arena, TypeHandler::GetNewFunc()));
259
+ }
260
+
261
+ template <typename TypeHandler>
262
+ Value<TypeHandler>* Add(Arena* arena, Value<TypeHandler>&& value) {
263
+ if (ClearedCount() > 0) {
264
+ auto* result =
265
+ cast<TypeHandler>(element_at(ExchangeCurrentSize(current_size_ + 1)));
266
+ *result = std::move(value);
267
+ return result;
268
+ } else {
269
+ return cast<TypeHandler>(AddInternal(
270
+ arena, TypeHandler::GetNewWithMoveFunc(std::move(value))));
271
+ }
272
+ }
273
+
274
+ template <typename TypeHandler>
275
+ Value<TypeHandler>* Add(Arena* arena, const Value<TypeHandler>& value) {
276
+ if (ClearedCount() > 0) {
277
+ auto* result =
278
+ cast<TypeHandler>(element_at(ExchangeCurrentSize(current_size_ + 1)));
279
+ *result = value;
280
+ return result;
281
+ } else {
282
+ return cast<TypeHandler>(
283
+ AddInternal(arena, TypeHandler::GetNewWithCopyFunc(value)));
284
+ }
285
+ }
286
+
287
+ template <typename TypeHandler, typename... Args>
288
+ Value<TypeHandler>* Emplace(Arena* arena, Args&&... args) {
289
+ if (ClearedCount() > 0) {
290
+ auto* result =
291
+ cast<TypeHandler>(element_at(ExchangeCurrentSize(current_size_ + 1)));
292
+ // NOLINTNEXTLINE(google3-readability-redundant-string-conversions)
293
+ *result = Value<TypeHandler>(std::forward<Args>(args)...);
294
+ return result;
295
+ } else {
296
+ return cast<TypeHandler>(AddInternal(
297
+ arena,
298
+ TypeHandler::GetNewWithEmplaceFunc(std::forward<Args>(args)...)));
299
+ }
300
+ }
301
+
302
+ // Must be called from destructor.
303
+ //
304
+ // Pre-condition: NeedsDestroy() returns true.
305
+ template <typename TypeHandler>
306
+ void Destroy() {
307
+ ABSL_DCHECK(NeedsDestroy());
308
+ ABSL_DCHECK_EQ(GetArena(), nullptr);
309
+
310
+ using H = CommonHandler<TypeHandler>;
311
+ int n = allocated_size();
312
+ ABSL_DCHECK_LE(n, Capacity());
313
+ void** elems = elements();
314
+ for (int i = 0; i < n; i++) {
315
+ if (i + 5 < n) {
316
+ absl::PrefetchToLocalCacheNta(elems[i + 5]);
317
+ }
318
+ Delete<H>(elems[i]);
319
+ }
320
+ if (!using_sso()) {
321
+ internal::SizedDelete(rep(),
322
+ Capacity() * sizeof(elems[0]) + kRepHeaderSize);
323
+ }
324
+ }
325
+
326
+ inline bool NeedsDestroy() const {
327
+ // Either there is an allocated element in SSO buffer or there is an
328
+ // allocated Rep.
329
+ return tagged_rep_or_elem_ != nullptr;
330
+ }
331
+
332
+ // Pre-condition: NeedsDestroy() returns true.
333
+ void DestroyProtos();
334
+
335
+ public:
336
+ // The next few methods are public so that they can be called from generated
337
+ // code when implicit weak fields are used, but they should never be called by
338
+ // application code.
339
+
340
+ template <typename TypeHandler>
341
+ PROTOBUF_FUTURE_ADD_NODISCARD const Value<TypeHandler>& Get(int index) const {
342
+ if constexpr (GetBoundsCheckMode() == BoundsCheckMode::kReturnDefault) {
343
+ if (ABSL_PREDICT_FALSE(index < 0 || index >= current_size_)) {
344
+ // `default_instance()` is not supported for MessageLite and Message.
345
+ if constexpr (TypeHandler::has_default_instance()) {
346
+ LogIndexOutOfBounds(index, current_size_);
347
+ return TypeHandler::default_instance();
348
+ }
349
+ }
350
+ }
351
+ // We refactor this to a separate function instead of inlining it so we
352
+ // can measure the performance impact more easily.
353
+ RuntimeAssertInBounds(index, current_size_);
354
+ return *cast<TypeHandler>(element_at(index));
355
+ }
356
+
357
+ // Creates and adds an element using the given prototype, without introducing
358
+ // a link-time dependency on the concrete message type.
359
+ //
360
+ // Pre-condition: `prototype` must not be nullptr.
361
+ template <typename TypeHandler>
362
+ PROTOBUF_ALWAYS_INLINE Value<TypeHandler>* AddFromPrototype(
363
+ Arena* arena, const Value<TypeHandler>* prototype) {
364
+ using H = CommonHandler<TypeHandler>;
365
+ Value<TypeHandler>* result = cast<TypeHandler>(
366
+ AddInternal(arena, H::GetNewFromPrototypeFunc(prototype)));
367
+ return result;
368
+ }
369
+
370
+ // As above, but returns a callable that caches useful information that can be
371
+ // reused between add calls.
372
+ template <typename TypeHandler>
373
+ PROTOBUF_ALWAYS_INLINE auto GetAdderFromPrototype(
374
+ const Value<TypeHandler>* prototype) {
375
+ using H = CommonHandler<TypeHandler>;
376
+ auto func = H::GetNewFromPrototypeFunc(prototype);
377
+ return [this, func](Arena* arena) {
378
+ return cast<TypeHandler>(AddInternal(arena, func));
379
+ };
380
+ }
381
+
382
+ // Creates and adds an element using the given ClassData, without introducing
383
+ // a link-time dependency on the concrete message type. This is generally
384
+ // faster and should be preferred over the equivalent `AddFromPrototype()` if
385
+ // the caller already has or can get the `ClassData`, and especially if
386
+ // elements are added repeatedly.
387
+ //
388
+ // Pre-condition: `class_data` must not be nullptr.
389
+ template <typename TypeHandler>
390
+ PROTOBUF_ALWAYS_INLINE Value<TypeHandler>* AddFromClassData(
391
+ Arena* arena, const ClassData* class_data) {
392
+ using H = CommonHandler<TypeHandler>;
393
+ Value<TypeHandler>* result = cast<TypeHandler>(
394
+ AddInternal(arena, H::GetNewFromClassDataFunc(class_data)));
395
+ return result;
396
+ }
397
+
398
+ template <typename TypeHandler>
399
+ void Clear() {
400
+ const int n = current_size_;
401
+ ABSL_DCHECK_GE(n, 0);
402
+ if (n > 0) {
403
+ using H = CommonHandler<TypeHandler>;
404
+ ClearNonEmpty<H>();
405
+ }
406
+ }
407
+
408
+ template <typename T, typename CopyElementFn, typename CreateAndMergeFn>
409
+ void MergeFromInternal(const RepeatedPtrFieldBase& from, Arena* arena,
410
+ CopyElementFn&& copy_fn,
411
+ CreateAndMergeFn&& create_and_merge_fn);
412
+ template <typename T, typename CopyElementFn>
413
+ void MergeFromInternal(const RepeatedPtrFieldBase& from, Arena* arena,
414
+ CopyElementFn&& copy_fn);
415
+
416
+ // Appends all message values from `from` to this instance.
417
+ template <typename T>
418
+ void MergeFrom(const RepeatedPtrFieldBase& from, Arena* arena) {
419
+ static_assert(std::is_base_of<MessageLite, T>::value, "");
420
+ if constexpr (!std::is_base_of<Message, T>::value) {
421
+ // For LITE objects we use the generic MergeFrom to save on binary size.
422
+ return MergeFrom<MessageLite>(from, arena);
423
+ }
424
+ MergeFromConcreteMessage(from, arena, Arena::CopyConstruct<T>);
425
+ }
426
+
427
+ inline void InternalSwap(RepeatedPtrFieldBase* PROTOBUF_RESTRICT rhs) {
428
+ ABSL_DCHECK(this != rhs);
429
+
430
+ // Swap all fields except arena offset and arena pointer at once.
431
+ internal::memswap<
432
+ InternalMetadataResolverOffsetHelper<RepeatedPtrFieldBase>::value>(
433
+ reinterpret_cast<char*>(this), reinterpret_cast<char*>(rhs));
434
+ }
435
+
436
+ // Returns true if there are no preallocated elements in the array.
437
+ PROTOBUF_FUTURE_ADD_NODISCARD bool PrepareForParse() {
438
+ return allocated_size() == current_size_;
439
+ }
440
+
441
+ // Similar to `AddAllocated` but faster.
442
+ //
443
+ // Pre-condition: PrepareForParse() is true.
444
+ void AddAllocatedForParse(void* value, Arena* arena) {
445
+ ABSL_DCHECK(PrepareForParse());
446
+ if (ABSL_PREDICT_FALSE(SizeAtCapacity())) {
447
+ *InternalExtend(1, arena) = value;
448
+ ++rep()->allocated_size;
449
+ } else {
450
+ if (using_sso()) {
451
+ tagged_rep_or_elem_ = value;
452
+ } else {
453
+ rep()->elements[current_size_] = value;
454
+ ++rep()->allocated_size;
455
+ }
456
+ }
457
+ ExchangeCurrentSize(current_size_ + 1);
458
+ }
459
+
460
+ protected:
461
+ template <typename TypeHandler, typename AddOne>
462
+ void ResizeImpl(int new_size, AddOne add_one);
463
+
464
+ template <typename TypeHandler>
465
+ void RemoveLast() {
466
+ internal::RuntimeAssertInBoundsGE(current_size_, 1);
467
+ ExchangeCurrentSize(current_size_ - 1);
468
+ using H = CommonHandler<TypeHandler>;
469
+ H::Clear(cast<H>(element_at(current_size_)));
470
+ }
471
+
472
+ template <typename TypeHandler>
473
+ void CopyFrom(const RepeatedPtrFieldBase& other, Arena* arena) {
474
+ ABSL_DCHECK_EQ(arena, GetArena());
475
+ if (&other == this) return;
476
+ Clear<TypeHandler>();
477
+ if (other.empty()) return;
478
+ MergeFrom<typename TypeHandler::Type>(other, arena);
479
+ }
480
+
481
+ void CloseGap(int start, int num);
482
+
483
+ void ReserveWithArena(Arena* arena, int capacity);
484
+
485
+ template <typename TypeHandler>
486
+ static inline Value<TypeHandler>* copy(const Value<TypeHandler>* value) {
487
+ return cast<TypeHandler>(CloneSlow(nullptr, *value));
488
+ }
489
+
490
+ // Used for constructing iterators.
491
+ void* const* raw_data() const { return elements(); }
492
+ void** raw_mutable_data() { return elements(); }
493
+
494
+ template <typename TypeHandler>
495
+ Value<TypeHandler>** mutable_data() {
496
+ // TODO: Breaks C++ aliasing rules. We should probably remove this
497
+ // method entirely.
498
+ return reinterpret_cast<Value<TypeHandler>**>(raw_mutable_data());
499
+ }
500
+
501
+ template <typename TypeHandler>
502
+ const Value<TypeHandler>* const* data() const {
503
+ // TODO: Breaks C++ aliasing rules. We should probably remove this
504
+ // method entirely.
505
+ return reinterpret_cast<const Value<TypeHandler>* const*>(raw_data());
506
+ }
507
+
508
+ template <typename TypeHandler>
509
+ PROTOBUF_NDEBUG_INLINE void Swap(Arena* arena, RepeatedPtrFieldBase* other,
510
+ Arena* other_arena) {
511
+ ABSL_DCHECK_EQ(arena, GetArena());
512
+ ABSL_DCHECK_EQ(other_arena, other->GetArena());
513
+ if (internal::CanUseInternalSwap(arena, other_arena)) {
514
+ InternalSwap(other);
515
+ } else {
516
+ SwapFallback<TypeHandler>(arena, other, other_arena);
517
+ }
518
+ }
519
+
520
+ void SwapElements(int index1, int index2) {
521
+ internal::RuntimeAssertInBounds(index1, current_size_);
522
+ internal::RuntimeAssertInBounds(index2, current_size_);
523
+ using std::swap; // enable ADL with fallback
524
+ swap(element_at(index1), element_at(index2));
525
+ }
526
+
527
+ template <typename TypeHandler>
528
+ PROTOBUF_NOINLINE size_t SpaceUsedExcludingSelfLong() const {
529
+ size_t allocated_bytes =
530
+ using_sso()
531
+ ? 0
532
+ : static_cast<size_t>(Capacity()) * sizeof(void*) + kRepHeaderSize;
533
+ const int n = allocated_size();
534
+ void* const* elems = elements();
535
+ for (int i = 0; i < n; ++i) {
536
+ allocated_bytes +=
537
+ TypeHandler::SpaceUsedLong(*cast<TypeHandler>(elems[i]));
538
+ }
539
+ return allocated_bytes;
540
+ }
541
+
542
+ // Advanced memory management --------------------------------------
543
+
544
+ // Like Add(), but if there are no cleared objects to use, returns nullptr.
545
+ template <typename TypeHandler>
546
+ Value<TypeHandler>* AddFromCleared() {
547
+ if (current_size_ < allocated_size()) {
548
+ return cast<TypeHandler>(
549
+ element_at(ExchangeCurrentSize(current_size_ + 1)));
550
+ } else {
551
+ return nullptr;
552
+ }
553
+ }
554
+
555
+ template <typename TypeHandler>
556
+ void AddAllocated(Arena* arena, Value<TypeHandler>* value) {
557
+ ABSL_DCHECK_EQ(arena, GetArena());
558
+ ABSL_DCHECK_NE(value, nullptr);
559
+ Arena* element_arena = TypeHandler::GetArena(value);
560
+ if (arena != element_arena || AllocatedSizeAtCapacity()) {
561
+ AddAllocatedSlowWithCopy<TypeHandler>(value, element_arena, arena);
562
+ return;
563
+ }
564
+ // Fast path: underlying arena representation (tagged pointer) is equal to
565
+ // our arena pointer, and we can add to array without resizing it (at
566
+ // least one slot that is not allocated).
567
+ void** elems = elements();
568
+ if (current_size_ < allocated_size()) {
569
+ // Make space at [current] by moving first allocated element to end of
570
+ // allocated list.
571
+ elems[allocated_size()] = elems[current_size_];
572
+ }
573
+ elems[ExchangeCurrentSize(current_size_ + 1)] = value;
574
+ if (!using_sso()) ++rep()->allocated_size;
575
+ }
576
+
577
+ template <typename TypeHandler>
578
+ void UnsafeArenaAddAllocated(Arena* arena, Value<TypeHandler>* value) {
579
+ ABSL_DCHECK_EQ(arena, GetArena());
580
+ ABSL_DCHECK_NE(value, nullptr);
581
+ // Make room for the new pointer.
582
+ if (SizeAtCapacity()) {
583
+ // The array is completely full with no cleared objects, so grow it.
584
+ InternalExtend(1, arena);
585
+ ++rep()->allocated_size;
586
+ } else if (AllocatedSizeAtCapacity()) {
587
+ // There is no more space in the pointer array because it contains some
588
+ // cleared objects awaiting reuse. We don't want to grow the array in
589
+ // this case because otherwise a loop calling AddAllocated() followed by
590
+ // Clear() would leak memory.
591
+ if (arena == nullptr) {
592
+ using H = CommonHandler<TypeHandler>;
593
+ Delete<H>(element_at(current_size_));
594
+ }
595
+ } else if (current_size_ < allocated_size()) {
596
+ // We have some cleared objects. We don't care about their order, so we
597
+ // can just move the first one to the end to make space.
598
+ element_at(allocated_size()) = element_at(current_size_);
599
+ ++rep()->allocated_size;
600
+ } else {
601
+ // There are no cleared objects.
602
+ if (!using_sso()) ++rep()->allocated_size;
603
+ }
604
+
605
+ element_at(ExchangeCurrentSize(current_size_ + 1)) = value;
606
+ }
607
+
608
+ template <typename TypeHandler>
609
+ PROTOBUF_FUTURE_ADD_NODISCARD Value<TypeHandler>* ReleaseLast(Arena* arena) {
610
+ ABSL_DCHECK_EQ(arena, GetArena());
611
+ Value<TypeHandler>* result = UnsafeArenaReleaseLast<TypeHandler>();
612
+ // Now perform a copy if we're on an arena.
613
+
614
+ if (internal::DebugHardenForceCopyInRelease()) {
615
+ auto* new_result = copy<TypeHandler>(result);
616
+ if (arena == nullptr) delete result;
617
+ return new_result;
618
+ } else {
619
+ return (arena == nullptr) ? result : copy<TypeHandler>(result);
620
+ }
621
+ }
622
+
623
+ // Releases and returns the last element, but does not do out-of-arena copy.
624
+ // Instead, just returns the raw pointer to the contained element in the
625
+ // arena.
626
+ template <typename TypeHandler>
627
+ Value<TypeHandler>* UnsafeArenaReleaseLast() {
628
+ internal::RuntimeAssertInBounds(0, current_size_);
629
+ ExchangeCurrentSize(current_size_ - 1);
630
+ auto* result = cast<TypeHandler>(element_at(current_size_));
631
+ if (using_sso()) {
632
+ tagged_rep_or_elem_ = nullptr;
633
+ } else {
634
+ --rep()->allocated_size;
635
+ if (current_size_ < allocated_size()) {
636
+ // There are cleared elements on the end; replace the removed element
637
+ // with the last allocated element.
638
+ element_at(current_size_) = element_at(allocated_size());
639
+ }
640
+ }
641
+ return result;
642
+ }
643
+
644
+ int ClearedCount() const { return allocated_size() - current_size_; }
645
+
646
+ // Slowpath handles all cases, copying if necessary.
647
+ template <typename TypeHandler>
648
+ PROTOBUF_NOINLINE void AddAllocatedSlowWithCopy(
649
+ // Pass value_arena and my_arena to avoid duplicate virtual call (value)
650
+ // or load (mine).
651
+ Value<TypeHandler>* value, Arena* value_arena, Arena* my_arena) {
652
+ using H = CommonHandler<TypeHandler>;
653
+ ABSL_DCHECK_EQ(my_arena, GetArena());
654
+ ABSL_DCHECK_EQ(value_arena, TypeHandler::GetArena(value));
655
+ // Ensure that either the value is in the same arena, or if not, we do the
656
+ // appropriate thing: Own() it (if it's on heap and we're in an arena) or
657
+ // copy it to our arena/heap (otherwise).
658
+ if (my_arena != nullptr && value_arena == nullptr) {
659
+ my_arena->Own(value);
660
+ } else if (my_arena != value_arena) {
661
+ ABSL_DCHECK(value_arena != nullptr);
662
+ value = cast<TypeHandler>(CloneSlow(my_arena, *value));
663
+ }
664
+
665
+ UnsafeArenaAddAllocated<H>(my_arena, value);
666
+ }
667
+
668
+ template <typename TypeHandler>
669
+ PROTOBUF_NOINLINE void SwapFallbackWithTemp(Arena* arena,
670
+ RepeatedPtrFieldBase* other,
671
+ Arena* other_arena,
672
+ RepeatedPtrFieldBase& temp);
673
+
674
+ template <typename TypeHandler>
675
+ PROTOBUF_NOINLINE void SwapFallback(Arena* arena, RepeatedPtrFieldBase* other,
676
+ Arena* other_arena);
677
+
678
+ // Gets the Arena on which this RepeatedPtrField stores its elements.
679
+ inline Arena* GetArena() const {
680
+ return ResolveArena<&RepeatedPtrFieldBase::resolver_>(this);
681
+ }
682
+
683
+ private:
684
+ // Tests that need to access private methods.
685
+ friend class RepeatedPtrFieldTest;
686
+ friend class
687
+ RepeatedPtrFieldTest_UnsafeArenaAddAllocatedReleaseLastOnBaseField_Test;
688
+
689
+ using InternalArenaConstructable_ = void;
690
+ using DestructorSkippable_ = void;
691
+
692
+ // FieldWithArena needs to call our protected internal metadata offset
693
+ // constructors.
694
+ friend class internal::FieldWithArena<RepeatedPtrFieldBase>;
695
+
696
+ friend google::protobuf::Arena;
697
+
698
+ template <typename T>
699
+ friend class Arena::InternalHelper;
700
+
701
+ // ExtensionSet stores repeated message extensions as
702
+ // RepeatedPtrField<MessageLite>, but non-lite ExtensionSets need to implement
703
+ // SpaceUsedLong(), and thus need to call SpaceUsedExcludingSelfLong()
704
+ // reinterpreting MessageLite as Message. ExtensionSet also needs to make use
705
+ // of AddFromCleared(), which is not part of the public interface.
706
+ friend class ExtensionSet;
707
+
708
+ // The MapFieldBase implementation needs to call protected methods directly,
709
+ // reinterpreting pointers as being to Message instead of a specific Message
710
+ // subclass.
711
+ friend class MapFieldBase;
712
+ friend struct MapFieldTestPeer;
713
+
714
+ // The table-driven MergePartialFromCodedStream implementation needs to
715
+ // operate on RepeatedPtrField<MessageLite>.
716
+ friend class MergePartialFromCodedStreamHelper;
717
+
718
+ friend class AccessorHelper;
719
+
720
+ template <typename T>
721
+ friend struct google::protobuf::WeakRepeatedPtrField;
722
+
723
+ friend class internal::TcParser; // TODO: Remove this friend.
724
+
725
+ // Expose offset of `resolver_` without exposing the member itself. Used to
726
+ // optimize code size of `InternalSwap` method.
727
+ template <typename T>
728
+ friend struct InternalMetadataResolverOffsetHelper;
729
+
730
+ // The reflection implementation needs to call protected methods directly,
731
+ // reinterpreting pointers as being to Message instead of a specific Message
732
+ // subclass.
733
+ friend class google::protobuf::Reflection;
734
+ friend class internal::SwapFieldHelper;
735
+
736
+ friend class RustRepeatedMessageHelper;
737
+
738
+ // Concrete Arena enabled copy function used to copy messages instances.
739
+ // This follows the `Arena::CopyConstruct` signature so that the compiler
740
+ // can have the inlined call into the out of line copy function(s) simply pass
741
+ // the address of `Arena::CopyConstruct` 'as is'.
742
+ using CopyFn = void* (*)(Arena*, const void*);
743
+
744
+ struct Rep {
745
+ // The size of the elements array, in number of elements.
746
+ int capacity;
747
+ // The number of elements allocated in the elements array (including cleared
748
+ // elements). This is always >= current_size.
749
+ int allocated_size;
750
+ // Here we declare a huge array as a way of approximating C's "flexible
751
+ // array member" feature without relying on undefined behavior.
752
+ void* elements[(std::numeric_limits<int>::max() - 2 * sizeof(int)) /
753
+ sizeof(void*)];
754
+ };
755
+
756
+ static constexpr size_t kRepHeaderSize = offsetof(Rep, elements);
757
+
758
+ // Replaces current_size_ with new_size and returns the previous value of
759
+ // current_size_. This function is intended to be the only place where
760
+ // current_size_ is modified.
761
+ inline int ExchangeCurrentSize(int new_size) {
762
+ return std::exchange(current_size_, new_size);
763
+ }
764
+ inline bool SizeAtCapacity() const {
765
+ // Harden invariant size() <= allocated_size() <= Capacity().
766
+ ABSL_DCHECK_LE(size(), allocated_size());
767
+ ABSL_DCHECK_LE(allocated_size(), Capacity());
768
+ return current_size_ == Capacity();
769
+ }
770
+ inline bool AllocatedSizeAtCapacity() const {
771
+ // Harden invariant size() <= allocated_size() <= Capacity().
772
+ ABSL_DCHECK_LE(size(), allocated_size());
773
+ ABSL_DCHECK_LE(allocated_size(), Capacity());
774
+ return allocated_size() == Capacity();
775
+ }
776
+
777
+ void* const* elements() const {
778
+ return using_sso() ? &tagged_rep_or_elem_ : +rep()->elements;
779
+ }
780
+ void** elements() {
781
+ return using_sso() ? &tagged_rep_or_elem_ : +rep()->elements;
782
+ }
783
+
784
+ void*& element_at(int index) {
785
+ if (using_sso()) {
786
+ ABSL_DCHECK_EQ(index, 0);
787
+ return tagged_rep_or_elem_;
788
+ }
789
+ return rep()->elements[index];
790
+ }
791
+ const void* element_at(int index) const {
792
+ return const_cast<RepeatedPtrFieldBase*>(this)->element_at(index);
793
+ }
794
+
795
+ int allocated_size() const {
796
+ return using_sso() ? (tagged_rep_or_elem_ != nullptr ? 1 : 0)
797
+ : rep()->allocated_size;
798
+ }
799
+ Rep* rep() {
800
+ ABSL_DCHECK(!using_sso());
801
+ return reinterpret_cast<Rep*>(
802
+ reinterpret_cast<uintptr_t>(tagged_rep_or_elem_) - 1);
803
+ }
804
+ const Rep* rep() const {
805
+ return const_cast<RepeatedPtrFieldBase*>(this)->rep();
806
+ }
807
+
808
+ bool using_sso() const {
809
+ return (reinterpret_cast<uintptr_t>(tagged_rep_or_elem_) & 1) == 0;
810
+ }
811
+
812
+ template <typename TypeHandler>
813
+ static inline Value<TypeHandler>* cast(void* element) {
814
+ return reinterpret_cast<Value<TypeHandler>*>(element);
815
+ }
816
+ template <typename TypeHandler>
817
+ static inline const Value<TypeHandler>* cast(const void* element) {
818
+ return reinterpret_cast<const Value<TypeHandler>*>(element);
819
+ }
820
+
821
+ // REQUIRES: arena == nullptr
822
+ template <typename TypeHandler>
823
+ static inline void Delete(void* obj) {
824
+ TypeHandler::Delete(cast<TypeHandler>(obj));
825
+ }
826
+
827
+ // Out-of-line helper routine for Clear() once the inlined check has
828
+ // determined the container is non-empty
829
+ template <typename TypeHandler>
830
+ PROTOBUF_NOINLINE void ClearNonEmpty() {
831
+ const int n = current_size_;
832
+ void* const* elems = elements();
833
+ int i = 0;
834
+ ABSL_DCHECK_GT(n, 0);
835
+ // do/while loop to avoid initial test because we know n > 0
836
+ do {
837
+ TypeHandler::Clear(cast<TypeHandler>(elems[i++]));
838
+ } while (i < n);
839
+ ExchangeCurrentSize(0);
840
+ }
841
+
842
+ // Merges messages from `from` into available, cleared messages sitting in the
843
+ // range `[size(), allocated_size())`. Returns the number of message merged
844
+ // which is `ClearedCount(), from.size())`.
845
+ // Note that this function does explicitly NOT update `current_size_`.
846
+ // This function is out of line as it should be the slow path: this scenario
847
+ // only happens when a caller constructs and fills a repeated field, then
848
+ // shrinks it, and then merges additional messages into it.
849
+ int MergeIntoClearedMessages(const RepeatedPtrFieldBase& from);
850
+
851
+ // Appends all messages from `from` to this instance, using the
852
+ // provided `copy_fn` copy function to copy existing messages.
853
+ void MergeFromConcreteMessage(const RepeatedPtrFieldBase& from, Arena* arena,
854
+ CopyFn copy_fn);
855
+
856
+ // Extends capacity by at least |extend_amount|. Returns a pointer to the
857
+ // next available element slot.
858
+ //
859
+ // Pre-condition: |extend_amount| must be > 0.
860
+ void** InternalExtend(int extend_amount, Arena* arena);
861
+
862
+ // Ensures that capacity is at least `n` elements.
863
+ // Returns a pointer to the element directly beyond the last element.
864
+ inline void** InternalReserve(int n, Arena* arena) {
865
+ if (n <= Capacity()) {
866
+ void** elements = using_sso() ? &tagged_rep_or_elem_ : rep()->elements;
867
+ return elements + current_size_;
868
+ }
869
+ return InternalExtend(n - Capacity(), arena);
870
+ }
871
+
872
+ // Common implementation used by various Add* methods. `factory` is an object
873
+ // used to construct a new element unless there are spare cleared elements
874
+ // ready for reuse. Returns pointer to the new element.
875
+ void* AddInternal(Arena* arena, absl::FunctionRef<ElementNewFn> factory);
876
+
877
+ // A few notes on internal representation:
878
+ //
879
+ // We use an indirected approach, with struct Rep, to keep
880
+ // sizeof(RepeatedPtrFieldBase) small. An instance of Rep is allocated only
881
+ // when the repeated field is non-empty, and it is a dynamically-sized struct
882
+ // (the header is directly followed by elements[]). We place current_size_
883
+ // directly in the object to avoid cache misses due to the indirection,
884
+ // because this field is checked frequently. Placing all fields directly in
885
+ // the RepeatedPtrFieldBase instance would cost significant performance for
886
+ // memory-sensitive workloads.
887
+ void* tagged_rep_or_elem_;
888
+ int current_size_;
889
+ InternalMetadataResolver resolver_;
890
+ };
891
+
892
+ // Appends all message values from `from` to this instance using the abstract
893
+ // message interface. This overload is used in places like reflection and
894
+ // other locations where the underlying type is unavailable
895
+ template <>
896
+ void RepeatedPtrFieldBase::MergeFrom<MessageLite>(
897
+ const RepeatedPtrFieldBase& from, Arena* arena);
898
+
899
+ template <>
900
+ inline void RepeatedPtrFieldBase::MergeFrom<Message>(
901
+ const RepeatedPtrFieldBase& from, Arena* arena) {
902
+ return MergeFrom<MessageLite>(from, arena);
903
+ }
904
+
905
+ // Appends all `std::string` values from `from` to this instance.
906
+ template <>
907
+ PROTOBUF_EXPORT void RepeatedPtrFieldBase::MergeFrom<std::string>(
908
+ const RepeatedPtrFieldBase& from, Arena* arena);
909
+
910
+
911
+ inline void* RepeatedPtrFieldBase::AddInternal(
912
+ Arena* arena, absl::FunctionRef<ElementNewFn> factory) {
913
+ ABSL_DCHECK_EQ(arena, GetArena());
914
+ if (tagged_rep_or_elem_ == nullptr) {
915
+ ExchangeCurrentSize(1);
916
+ factory(arena, tagged_rep_or_elem_);
917
+ return tagged_rep_or_elem_;
918
+ }
919
+ absl::PrefetchToLocalCache(tagged_rep_or_elem_);
920
+ if (using_sso()) {
921
+ if (current_size_ == 0) {
922
+ ExchangeCurrentSize(1);
923
+ return tagged_rep_or_elem_;
924
+ }
925
+ void*& result = *InternalExtend(1, arena);
926
+ factory(arena, result);
927
+ Rep* r = rep();
928
+ r->allocated_size = 2;
929
+ ExchangeCurrentSize(2);
930
+ return result;
931
+ }
932
+ Rep* r = rep();
933
+ if (ABSL_PREDICT_FALSE(SizeAtCapacity())) {
934
+ InternalExtend(1, arena);
935
+ r = rep();
936
+ } else {
937
+ if (ClearedCount() > 0) {
938
+ return r->elements[ExchangeCurrentSize(current_size_ + 1)];
939
+ }
940
+ }
941
+ ++r->allocated_size;
942
+ void*& result = r->elements[ExchangeCurrentSize(current_size_ + 1)];
943
+ factory(arena, result);
944
+ return result;
945
+ }
946
+
947
+ // A container that holds a RepeatedPtrFieldBase and an arena pointer. This is
948
+ // used when constructing `RepeatedPtrFieldBase`s on the arena, and in
949
+ // `SwapFallback`.
950
+ using RepeatedPtrFieldWithArenaBase = FieldWithArena<RepeatedPtrFieldBase>;
951
+
952
+ template <>
953
+ struct FieldArenaRep<RepeatedPtrFieldBase> {
954
+ using Type = RepeatedPtrFieldWithArenaBase;
955
+
956
+ static inline RepeatedPtrFieldBase* Get(
957
+ RepeatedPtrFieldWithArenaBase* arena_rep) {
958
+ return &arena_rep->field();
959
+ }
960
+ };
961
+
962
+ template <>
963
+ struct FieldArenaRep<const RepeatedPtrFieldBase> {
964
+ using Type = const RepeatedPtrFieldWithArenaBase;
965
+
966
+ static inline const RepeatedPtrFieldBase* Get(
967
+ const RepeatedPtrFieldWithArenaBase* arena_rep) {
968
+ return &arena_rep->field();
969
+ }
970
+ };
971
+
972
+ template <typename TypeHandler>
973
+ PROTOBUF_NOINLINE void RepeatedPtrFieldBase::SwapFallbackWithTemp(
974
+ Arena* arena, RepeatedPtrFieldBase* other, Arena* other_arena,
975
+ RepeatedPtrFieldBase& temp) {
976
+ ABSL_DCHECK(!internal::CanUseInternalSwap(GetArena(), other->GetArena()));
977
+ ABSL_DCHECK_EQ(arena, GetArena());
978
+ ABSL_DCHECK_EQ(other_arena, other->GetArena());
979
+
980
+ // Copy semantics in this case. We try to improve efficiency by placing the
981
+ // temporary on |other|'s arena so that messages are copied twice rather
982
+ // than three times.
983
+ if (!this->empty()) {
984
+ temp.MergeFrom<typename TypeHandler::Type>(*this, other_arena);
985
+ }
986
+ this->CopyFrom<TypeHandler>(*other, arena);
987
+ other->InternalSwap(&temp);
988
+ }
989
+
990
+ template <typename TypeHandler>
991
+ PROTOBUF_NOINLINE void RepeatedPtrFieldBase::SwapFallback(
992
+ Arena* arena, RepeatedPtrFieldBase* other, Arena* other_arena) {
993
+ ABSL_DCHECK(!internal::CanUseInternalSwap(GetArena(), other->GetArena()));
994
+ ABSL_DCHECK_EQ(arena, GetArena());
995
+ ABSL_DCHECK_EQ(other_arena, other->GetArena());
996
+
997
+ // Copy semantics in this case. We try to improve efficiency by placing the
998
+ // temporary on |other|'s arena so that messages are copied twice rather
999
+ // than three times.
1000
+ if (other_arena != nullptr) {
1001
+ // We can't call the destructor of the temp container since it allocates
1002
+ // memory from an arena, and the destructor of FieldWithArena expects to be
1003
+ // called only when arena is nullptr.
1004
+ absl::NoDestructor<RepeatedPtrFieldWithArenaBase> temp_container(
1005
+ other_arena);
1006
+ RepeatedPtrFieldBase& temp = temp_container->field();
1007
+ SwapFallbackWithTemp<TypeHandler>(arena, other, other_arena, temp);
1008
+ return;
1009
+ }
1010
+
1011
+ RepeatedPtrFieldBase temp;
1012
+ SwapFallbackWithTemp<TypeHandler>(arena, other, other_arena, temp);
1013
+ if (temp.NeedsDestroy()) {
1014
+ temp.Destroy<TypeHandler>();
1015
+ }
1016
+ }
1017
+
1018
+ template <typename TypeHandler, typename AddOne>
1019
+ void RepeatedPtrFieldBase::ResizeImpl(int new_size, AddOne add_one) {
1020
+ internal::RuntimeAssertInBoundsGE(new_size, 0);
1021
+ int diff = new_size - size();
1022
+ if (diff > 0) {
1023
+ // We need to add.
1024
+ auto* arena = GetArena();
1025
+ ReserveWithArena(arena, new_size);
1026
+ for (; diff > 0; --diff) {
1027
+ add_one(arena);
1028
+ }
1029
+ } else {
1030
+ for (; diff < 0; ++diff) {
1031
+ RemoveLast<TypeHandler>();
1032
+ }
1033
+ }
1034
+ }
1035
+
1036
+ PROTOBUF_EXPORT void InternalOutOfLineDeleteMessageLite(MessageLite* message);
1037
+
1038
+ // Encapsulates the minimally required subset of T's properties in a
1039
+ // `RepeatedPtrField<T>` specialization so the type-agnostic
1040
+ // `RepeatedPtrFieldBase` could do its job without knowing T.
1041
+ //
1042
+ // This generic definition is for types derived from `MessageLite`. That is
1043
+ // statically asserted, but only where a non-conforming type would emit a
1044
+ // compile-time diagnostic that lacks proper guidance for fixing. Asserting
1045
+ // at the top level isn't possible, because some template argument types are not
1046
+ // yet fully defined at the instantiation point.
1047
+ //
1048
+ // Explicit specializations are provided for `std::string` and
1049
+ // `StringPieceField` further below.
1050
+ template <typename GenericType>
1051
+ class GenericTypeHandler {
1052
+ public:
1053
+ using Type = GenericType;
1054
+
1055
+ using CopyConstructReferenceType = const Type&;
1056
+
1057
+ // NOTE: Can't `static_assert(std::is_base_of_v<MessageLite, Type>)` here,
1058
+ // because the type is not yet fully defined at this point sometimes, so we
1059
+ // are forced to assert in every function that needs it.
1060
+
1061
+ static constexpr auto GetNewFunc() {
1062
+ return [](Arena* arena, void*& ptr) {
1063
+ ptr = Arena::DefaultConstruct<Type>(arena);
1064
+ };
1065
+ }
1066
+ static constexpr auto GetNewWithMoveFunc(
1067
+ Type&& from ABSL_ATTRIBUTE_LIFETIME_BOUND) {
1068
+ return [&from](Arena* arena, void*& ptr) {
1069
+ ptr = Arena::Create<Type>(arena, std::move(from));
1070
+ };
1071
+ }
1072
+ static constexpr auto GetNewWithCopyFunc(
1073
+ const Type& from ABSL_ATTRIBUTE_LIFETIME_BOUND) {
1074
+ return [&from](Arena* arena, void*& ptr) {
1075
+ ptr = Arena::Create<Type>(arena, from);
1076
+ };
1077
+ }
1078
+ template <typename... Args>
1079
+ static constexpr auto GetNewWithEmplaceFunc(Args&&... args) {
1080
+ return [&args...](Arena* arena, void*& ptr) {
1081
+ ptr = Arena::Create<Type>(arena, std::forward<Args>(args)...);
1082
+ };
1083
+ }
1084
+ static constexpr auto GetNewFromPrototypeFunc(
1085
+ const Type* prototype ABSL_ATTRIBUTE_LIFETIME_BOUND) {
1086
+ ABSL_DCHECK(prototype != nullptr);
1087
+ return [prototype](Arena* arena, void*& ptr) {
1088
+ ptr = GetClassData(*prototype)->New(arena);
1089
+ };
1090
+ }
1091
+ static constexpr auto GetNewFromClassDataFunc(
1092
+ const ClassData* class_data ABSL_ATTRIBUTE_LIFETIME_BOUND) {
1093
+ ABSL_DCHECK(class_data != nullptr);
1094
+ return [class_data](Arena* arena, void*& ptr) {
1095
+ ptr = class_data->New(arena);
1096
+ };
1097
+ }
1098
+
1099
+ static inline Arena* GetArena(Type* value) {
1100
+ return Arena::InternalGetArena(value);
1101
+ }
1102
+
1103
+ static inline void Delete(Type* value) {
1104
+ static_assert(std::is_base_of_v<MessageLite, Type>);
1105
+ // Using virtual destructor to reduce generated code size that would have
1106
+ // happened otherwise due to inlined `~Type()`.
1107
+ InternalOutOfLineDeleteMessageLite(value);
1108
+ }
1109
+ static inline void Clear(Type* value) {
1110
+ static_assert(std::is_base_of_v<MessageLite, Type>);
1111
+ value->Clear();
1112
+ }
1113
+ static inline size_t SpaceUsedLong(const Type& value) {
1114
+ // NOTE: For `SpaceUsedLong()`, we do need `Message`, not `MessageLite`.
1115
+ static_assert(std::is_base_of_v<Message, Type>);
1116
+ return value.SpaceUsedLong();
1117
+ }
1118
+
1119
+ static void CopyFrom(Type* elem, const Type& value) {
1120
+ elem->CheckTypeAndMergeFrom(value);
1121
+ }
1122
+
1123
+ static const Type& default_instance() {
1124
+ static_assert(has_default_instance());
1125
+ return *static_cast<const GenericType*>(
1126
+ MessageTraits<Type>::default_instance());
1127
+ }
1128
+ static constexpr bool has_default_instance() {
1129
+ return !std::is_same_v<Type, Message> && !std::is_same_v<Type, MessageLite>;
1130
+ }
1131
+
1132
+ static const Type& ForElementCallback(const Type* ptr) { return *ptr; }
1133
+ };
1134
+
1135
+ template <>
1136
+ class GenericTypeHandler<std::string> {
1137
+ public:
1138
+ using Type = std::string;
1139
+
1140
+ using CopyConstructReferenceType = absl::string_view;
1141
+
1142
+ static constexpr auto GetNewFunc() {
1143
+ return [](Arena* arena, void*& ptr) { ptr = Arena::Create<Type>(arena); };
1144
+ }
1145
+ static constexpr auto GetNewWithMoveFunc(
1146
+ Type&& from ABSL_ATTRIBUTE_LIFETIME_BOUND) {
1147
+ return [&from](Arena* arena, void*& ptr) {
1148
+ ptr = Arena::Create<Type>(arena, std::move(from));
1149
+ };
1150
+ }
1151
+ static constexpr auto GetNewWithCopyFunc(
1152
+ const Type& from ABSL_ATTRIBUTE_LIFETIME_BOUND) {
1153
+ return [&from](Arena* arena, void*& ptr) {
1154
+ ptr = Arena::Create<Type>(arena, from);
1155
+ };
1156
+ }
1157
+ template <typename... Args>
1158
+ static constexpr auto GetNewWithEmplaceFunc(Args&&... args) {
1159
+ return [&args...](Arena* arena, void*& ptr) {
1160
+ ptr = Arena::Create<Type>(arena, std::forward<Args>(args)...);
1161
+ };
1162
+ }
1163
+ static constexpr auto GetNewFromPrototypeFunc(const Type* /*prototype*/) {
1164
+ return GetNewFunc();
1165
+ }
1166
+
1167
+ static inline Arena* GetArena(Type*) { return nullptr; }
1168
+
1169
+ static inline void Delete(Type* value) { delete value; }
1170
+ static inline void Clear(Type* value) { value->clear(); }
1171
+ static inline void Merge(const Type& from, Type* to) { *to = from; }
1172
+ static size_t SpaceUsedLong(const Type& value) {
1173
+ return sizeof(value) + StringSpaceUsedExcludingSelfLong(value);
1174
+ }
1175
+
1176
+ static void CopyFrom(Type* elem, absl::string_view value) {
1177
+ elem->assign(value.data(), value.size());
1178
+ }
1179
+
1180
+ static const Type& default_instance() {
1181
+ return GetEmptyStringAlreadyInited();
1182
+ }
1183
+ static constexpr bool has_default_instance() { return true; }
1184
+
1185
+ static absl::string_view ForElementCallback(const std::string* ptr) {
1186
+ return *ptr;
1187
+ }
1188
+ };
1189
+
1190
+ template <>
1191
+ class GenericTypeHandler<absl::string_view>
1192
+ : public GenericTypeHandler<std::string> {};
1193
+
1194
+
1195
+ } // namespace internal
1196
+
1197
+ // RepeatedPtrField is like RepeatedField, but used for repeated strings or
1198
+ // Messages.
1199
+ template <typename Element>
1200
+ class ABSL_ATTRIBUTE_WARN_UNUSED RepeatedPtrField final
1201
+ : private internal::RepeatedPtrFieldBase {
1202
+ static_assert(!std::is_const<Element>::value,
1203
+ "We do not support const value types.");
1204
+ static_assert(!std::is_volatile<Element>::value,
1205
+ "We do not support volatile value types.");
1206
+ static_assert(!std::is_pointer<Element>::value,
1207
+ "We do not support pointer value types.");
1208
+ static_assert(!std::is_reference<Element>::value,
1209
+ "We do not support reference value types.");
1210
+ static constexpr PROTOBUF_ALWAYS_INLINE void StaticValidityCheck() {
1211
+ static_assert(
1212
+ std::disjunction<
1213
+ internal::is_supported_string_type<Element>,
1214
+ internal::is_supported_message_type<Element>>::value,
1215
+ "We only support string and Message types in RepeatedPtrField.");
1216
+ static_assert(alignof(Element) <= internal::ArenaAlignDefault::align,
1217
+ "Overaligned types are not supported");
1218
+ }
1219
+
1220
+ using CopyConstructReferenceType = typename internal::GenericTypeHandler<
1221
+ Element>::CopyConstructReferenceType;
1222
+
1223
+ public:
1224
+ using value_type = Element;
1225
+ using size_type = int;
1226
+ using difference_type = ptrdiff_t;
1227
+ using reference = Element&;
1228
+ using const_reference = const Element&;
1229
+ using pointer = Element*;
1230
+ using const_pointer = const Element*;
1231
+ using iterator = internal::RepeatedPtrIterator<Element>;
1232
+ using const_iterator = internal::RepeatedPtrIterator<const Element>;
1233
+ using reverse_iterator = std::reverse_iterator<iterator>;
1234
+ using const_reverse_iterator = std::reverse_iterator<const_iterator>;
1235
+ // Custom STL-like iterator that iterates over and returns the underlying
1236
+ // pointers to Element rather than Element itself.
1237
+ using pointer_iterator = internal::RepeatedPtrOverPtrsIterator<Element>;
1238
+ using const_pointer_iterator =
1239
+ internal::RepeatedPtrOverPtrsIterator<const Element>;
1240
+
1241
+ constexpr RepeatedPtrField();
1242
+
1243
+ // Arena enabled constructors: for internal use only.
1244
+ constexpr PROTOBUF_ALWAYS_INLINE RepeatedPtrField(
1245
+ internal::InternalVisibility, internal::InternalMetadataOffset offset)
1246
+ : RepeatedPtrField(offset) {}
1247
+ PROTOBUF_ALWAYS_INLINE RepeatedPtrField(
1248
+ internal::InternalVisibility, internal::InternalMetadataOffset offset,
1249
+ const RepeatedPtrField& rhs)
1250
+ : RepeatedPtrField(offset, rhs) {}
1251
+
1252
+ template <typename Iter,
1253
+ typename = typename std::enable_if<std::is_constructible<
1254
+ Element, decltype(*std::declval<Iter>())>::value>::type>
1255
+ RepeatedPtrField(Iter begin, Iter end);
1256
+
1257
+ PROTOBUF_ALWAYS_INLINE RepeatedPtrField(const RepeatedPtrField& rhs)
1258
+ : RepeatedPtrField(internal::InternalMetadataOffset(), rhs) {}
1259
+ RepeatedPtrField& operator=(const RepeatedPtrField& other)
1260
+ ABSL_ATTRIBUTE_LIFETIME_BOUND;
1261
+
1262
+ PROTOBUF_ALWAYS_INLINE RepeatedPtrField(RepeatedPtrField&& rhs) noexcept
1263
+ : RepeatedPtrField(internal::InternalMetadataOffset(), std::move(rhs)) {}
1264
+ RepeatedPtrField& operator=(RepeatedPtrField&& other) noexcept
1265
+ ABSL_ATTRIBUTE_LIFETIME_BOUND;
1266
+
1267
+ ~RepeatedPtrField();
1268
+
1269
+ PROTOBUF_FUTURE_ADD_NODISCARD bool empty() const;
1270
+ PROTOBUF_FUTURE_ADD_NODISCARD int size() const;
1271
+
1272
+ PROTOBUF_FUTURE_ADD_NODISCARD const_reference
1273
+ Get(int index) const ABSL_ATTRIBUTE_LIFETIME_BOUND;
1274
+ PROTOBUF_FUTURE_ADD_NODISCARD pointer Mutable(int index)
1275
+ ABSL_ATTRIBUTE_LIFETIME_BOUND;
1276
+
1277
+ // Unlike std::vector, adding an element to a RepeatedPtrField doesn't always
1278
+ // make a new element; it might re-use an element left over from when the
1279
+ // field was Clear()'d or resize()'d smaller. For this reason, Add() is the
1280
+ // fastest API for adding a new element.
1281
+ pointer Add() ABSL_ATTRIBUTE_LIFETIME_BOUND;
1282
+
1283
+ // `Add(std::move(value));` is equivalent to `*Add() = std::move(value);`
1284
+ // It will either move-construct to the end of this field, or swap value
1285
+ // with the new-or-recycled element at the end of this field. Note that
1286
+ // this operation is very slow if this RepeatedPtrField is not on the
1287
+ // same Arena, if any, as `value`.
1288
+ void Add(Element&& value);
1289
+
1290
+ // Copying to the end of this RepeatedPtrField is slowest of all; it can't
1291
+ // reliably copy-construct to the last element of this RepeatedPtrField, for
1292
+ // example (unlike std::vector).
1293
+ // We currently block this API. The right way to add to the end is to call
1294
+ // Add() and modify the element it points to.
1295
+ // If you must add an existing value, call `*Add() = value;`
1296
+ void Add(const Element& value) = delete;
1297
+
1298
+ // Append elements in the range [begin, end) after reserving
1299
+ // the appropriate number of elements.
1300
+ template <typename Iter>
1301
+ void Add(Iter begin, Iter end);
1302
+
1303
+ // If `new_size < size()`, truncate the container, destroying the removed
1304
+ // elements.
1305
+ // If `new_size > size()`, add value-initialized elements to reach the desired
1306
+ // size.
1307
+ void resize(size_type new_size);
1308
+
1309
+ // If `new_size < size()`, truncate the container, destroying the removed
1310
+ // elements.
1311
+ // If `new_size > size()`, add copies of `value` elements to reach the desired
1312
+ // size.
1313
+ void resize(size_type new_size, CopyConstructReferenceType value);
1314
+
1315
+ PROTOBUF_FUTURE_ADD_NODISCARD const_reference
1316
+ operator[](int index) const ABSL_ATTRIBUTE_LIFETIME_BOUND {
1317
+ return Get(index);
1318
+ }
1319
+ PROTOBUF_FUTURE_ADD_NODISCARD reference operator[](int index)
1320
+ ABSL_ATTRIBUTE_LIFETIME_BOUND {
1321
+ return *Mutable(index);
1322
+ }
1323
+
1324
+ PROTOBUF_FUTURE_ADD_NODISCARD const_reference
1325
+ at(int index) const ABSL_ATTRIBUTE_LIFETIME_BOUND;
1326
+ PROTOBUF_FUTURE_ADD_NODISCARD reference at(int index)
1327
+ ABSL_ATTRIBUTE_LIFETIME_BOUND;
1328
+
1329
+ // Removes the last element in the array.
1330
+ // Ownership of the element is retained by the array.
1331
+ void RemoveLast();
1332
+
1333
+ // Deletes elements with indices in the range [start .. start+num-1].
1334
+ // Caution: moves all elements with indices [start+num .. ].
1335
+ // Calling this routine inside a loop can cause quadratic behavior.
1336
+ void DeleteSubrange(int start, int num);
1337
+
1338
+ ABSL_ATTRIBUTE_REINITIALIZES void Clear();
1339
+
1340
+ // Appends the elements from `other` after this instance.
1341
+ // The end result length will be `other.size() + this->size()`.
1342
+ void MergeFrom(const RepeatedPtrField& other);
1343
+
1344
+ // Replaces the contents with a copy of the elements from `other`.
1345
+ ABSL_ATTRIBUTE_REINITIALIZES void CopyFrom(const RepeatedPtrField& other);
1346
+
1347
+ // Replaces the contents with RepeatedPtrField(begin, end).
1348
+ template <typename Iter>
1349
+ ABSL_ATTRIBUTE_REINITIALIZES void Assign(Iter begin, Iter end);
1350
+
1351
+ // Reserves space to expand the field to at least the given size. This only
1352
+ // resizes the pointer array; it doesn't allocate any objects. If the
1353
+ // array is grown, it will always be at least doubled in size.
1354
+ void Reserve(int new_size);
1355
+
1356
+ PROTOBUF_FUTURE_ADD_NODISCARD int Capacity() const;
1357
+
1358
+ // Gets the underlying array. This pointer is possibly invalidated by
1359
+ // any add or remove operation.
1360
+ PROTOBUF_FUTURE_ADD_NODISCARD Element** mutable_data()
1361
+ ABSL_ATTRIBUTE_LIFETIME_BOUND;
1362
+ PROTOBUF_FUTURE_ADD_NODISCARD const Element* const* data() const
1363
+ ABSL_ATTRIBUTE_LIFETIME_BOUND;
1364
+
1365
+ // Swaps entire contents with "other". If they are on separate arenas, then
1366
+ // copies data.
1367
+ void Swap(RepeatedPtrField* other);
1368
+
1369
+ // Swaps entire contents with "other". Caller should guarantee that either
1370
+ // both fields are on the same arena or both are on the heap. Swapping between
1371
+ // different arenas with this function is disallowed and is caught via
1372
+ // ABSL_DCHECK.
1373
+ void UnsafeArenaSwap(RepeatedPtrField* other);
1374
+
1375
+ // Swaps two elements.
1376
+ void SwapElements(int index1, int index2);
1377
+
1378
+ PROTOBUF_FUTURE_ADD_NODISCARD iterator begin() ABSL_ATTRIBUTE_LIFETIME_BOUND;
1379
+ PROTOBUF_FUTURE_ADD_NODISCARD const_iterator
1380
+ begin() const ABSL_ATTRIBUTE_LIFETIME_BOUND;
1381
+ PROTOBUF_FUTURE_ADD_NODISCARD const_iterator
1382
+ cbegin() const ABSL_ATTRIBUTE_LIFETIME_BOUND;
1383
+ PROTOBUF_FUTURE_ADD_NODISCARD iterator end() ABSL_ATTRIBUTE_LIFETIME_BOUND;
1384
+ PROTOBUF_FUTURE_ADD_NODISCARD const_iterator
1385
+ end() const ABSL_ATTRIBUTE_LIFETIME_BOUND;
1386
+ PROTOBUF_FUTURE_ADD_NODISCARD const_iterator
1387
+ cend() const ABSL_ATTRIBUTE_LIFETIME_BOUND;
1388
+
1389
+ PROTOBUF_FUTURE_ADD_NODISCARD reverse_iterator rbegin()
1390
+ ABSL_ATTRIBUTE_LIFETIME_BOUND {
1391
+ return reverse_iterator(end());
1392
+ }
1393
+ PROTOBUF_FUTURE_ADD_NODISCARD const_reverse_iterator
1394
+ rbegin() const ABSL_ATTRIBUTE_LIFETIME_BOUND {
1395
+ return const_reverse_iterator(end());
1396
+ }
1397
+ PROTOBUF_FUTURE_ADD_NODISCARD reverse_iterator rend()
1398
+ ABSL_ATTRIBUTE_LIFETIME_BOUND {
1399
+ return reverse_iterator(begin());
1400
+ }
1401
+ PROTOBUF_FUTURE_ADD_NODISCARD const_reverse_iterator
1402
+ rend() const ABSL_ATTRIBUTE_LIFETIME_BOUND {
1403
+ return const_reverse_iterator(begin());
1404
+ }
1405
+
1406
+ PROTOBUF_FUTURE_ADD_NODISCARD pointer_iterator pointer_begin()
1407
+ ABSL_ATTRIBUTE_LIFETIME_BOUND;
1408
+ PROTOBUF_FUTURE_ADD_NODISCARD const_pointer_iterator
1409
+ pointer_begin() const ABSL_ATTRIBUTE_LIFETIME_BOUND;
1410
+ PROTOBUF_FUTURE_ADD_NODISCARD pointer_iterator pointer_end()
1411
+ ABSL_ATTRIBUTE_LIFETIME_BOUND;
1412
+ PROTOBUF_FUTURE_ADD_NODISCARD const_pointer_iterator
1413
+ pointer_end() const ABSL_ATTRIBUTE_LIFETIME_BOUND;
1414
+
1415
+ // Returns (an estimate of) the number of bytes used by the repeated field,
1416
+ // excluding sizeof(*this).
1417
+ PROTOBUF_FUTURE_ADD_NODISCARD size_t SpaceUsedExcludingSelfLong() const;
1418
+
1419
+ PROTOBUF_FUTURE_ADD_NODISCARD int SpaceUsedExcludingSelf() const {
1420
+ return internal::ToIntSize(SpaceUsedExcludingSelfLong());
1421
+ }
1422
+
1423
+ // Advanced memory management --------------------------------------
1424
+ // When hardcore memory management becomes necessary -- as it sometimes
1425
+ // does here at Google -- the following methods may be useful.
1426
+
1427
+ // Adds an already-allocated object, passing ownership to the
1428
+ // RepeatedPtrField.
1429
+ //
1430
+ // Note that some special behavior occurs with respect to arenas:
1431
+ //
1432
+ // (i) if this field holds submessages, the new submessage will be copied if
1433
+ // the original is in an arena and this RepeatedPtrField is either in a
1434
+ // different arena, or on the heap.
1435
+ // (ii) if this field holds strings, the passed-in string *must* be
1436
+ // heap-allocated, not arena-allocated. There is no way to dynamically check
1437
+ // this at runtime, so User Beware.
1438
+ // Requires: value != nullptr
1439
+ void AddAllocated(Element* value);
1440
+
1441
+ // Removes and returns the last element, passing ownership to the caller.
1442
+ // Requires: size() > 0
1443
+ //
1444
+ // If this RepeatedPtrField is on an arena, an object copy is required to pass
1445
+ // ownership back to the user (for compatible semantics). Use
1446
+ // UnsafeArenaReleaseLast() if this behavior is undesired.
1447
+ PROTOBUF_FUTURE_ADD_NODISCARD Element* ReleaseLast();
1448
+
1449
+ // Adds an already-allocated object, skipping arena-ownership checks. The user
1450
+ // must guarantee that the given object is in the same arena as this
1451
+ // RepeatedPtrField.
1452
+ // It is also useful in legacy code that uses temporary ownership to avoid
1453
+ // copies. Example:
1454
+ // RepeatedPtrField<T> temp_field;
1455
+ // temp_field.UnsafeArenaAddAllocated(new T);
1456
+ // ... // Do something with temp_field
1457
+ // temp_field.UnsafeArenaExtractSubrange(0, temp_field.size(), nullptr);
1458
+ // If you put temp_field on the arena this fails, because the ownership
1459
+ // transfers to the arena at the "AddAllocated" call and is not released
1460
+ // anymore, causing a double delete. UnsafeArenaAddAllocated prevents this.
1461
+ // Requires: value != nullptr
1462
+ void UnsafeArenaAddAllocated(Element* value);
1463
+
1464
+ // Removes and returns the last element. Unlike ReleaseLast, the returned
1465
+ // pointer is always to the original object. This may be in an arena, in
1466
+ // which case it would have the arena's lifetime.
1467
+ // Requires: current_size_ > 0
1468
+ pointer UnsafeArenaReleaseLast();
1469
+
1470
+ // Extracts elements with indices in the range "[start .. start+num-1]".
1471
+ // The caller assumes ownership of the extracted elements and is responsible
1472
+ // for deleting them when they are no longer needed.
1473
+ // If "elements" is non-nullptr, then pointers to the extracted elements
1474
+ // are stored in "elements[0 .. num-1]" for the convenience of the caller.
1475
+ // If "elements" is nullptr, then the caller must use some other mechanism
1476
+ // to perform any further operations (like deletion) on these elements.
1477
+ // Caution: implementation also moves elements with indices [start+num ..].
1478
+ // Calling this routine inside a loop can cause quadratic behavior.
1479
+ //
1480
+ // Memory copying behavior is identical to ReleaseLast(), described above: if
1481
+ // this RepeatedPtrField is on an arena, an object copy is performed for each
1482
+ // returned element, so that all returned element pointers are to
1483
+ // heap-allocated copies. If this copy is not desired, the user should call
1484
+ // UnsafeArenaExtractSubrange().
1485
+ void ExtractSubrange(int start, int num, Element** elements);
1486
+
1487
+ // Identical to ExtractSubrange() described above, except that no object
1488
+ // copies are ever performed. Instead, the raw object pointers are returned.
1489
+ // Thus, if on an arena, the returned objects must not be freed, because they
1490
+ // will not be heap-allocated objects.
1491
+ void UnsafeArenaExtractSubrange(int start, int num, Element** elements);
1492
+
1493
+ // Removes the element referenced by position.
1494
+ //
1495
+ // Returns an iterator to the element immediately following the removed
1496
+ // element.
1497
+ //
1498
+ // Invalidates all iterators at or after the removed element, including end().
1499
+ iterator erase(const_iterator position) ABSL_ATTRIBUTE_LIFETIME_BOUND;
1500
+
1501
+ // Removes the elements in the range [first, last).
1502
+ //
1503
+ // Returns an iterator to the element immediately following the removed range.
1504
+ //
1505
+ // Invalidates all iterators at or after the removed range, including end().
1506
+ iterator erase(const_iterator first,
1507
+ const_iterator last) ABSL_ATTRIBUTE_LIFETIME_BOUND;
1508
+
1509
+ // Gets the arena on which this RepeatedPtrField stores its elements.
1510
+ PROTOBUF_FUTURE_ADD_NODISCARD inline Arena* GetArena();
1511
+
1512
+ // For internal use only.
1513
+ //
1514
+ // This is public due to it being called by generated code.
1515
+ void InternalSwap(RepeatedPtrField* PROTOBUF_RESTRICT other) {
1516
+ internal::RepeatedPtrFieldBase::InternalSwap(other);
1517
+ }
1518
+
1519
+ // For internal use only.
1520
+ //
1521
+ // Like `Add()`, but uses the given arena instead of calling `GetArena()`. It
1522
+ // is the responsibility of the caller to ensure that this arena is the same
1523
+ // as the arena returned from `GetArena()`.
1524
+ pointer InternalAddWithArena(internal::InternalVisibility,
1525
+ Arena* arena) ABSL_ATTRIBUTE_LIFETIME_BOUND;
1526
+
1527
+ // For internal use only.
1528
+ //
1529
+ // Like `Add(Element&&)`, but uses the given arena instead of calling
1530
+ // `GetArena()`. It is the responsibility of the caller to ensure that this
1531
+ // arena is the same as the arena returned from `GetArena()`.
1532
+ void InternalAddWithArena(internal::InternalVisibility, Arena* arena,
1533
+ Element&& value);
1534
+
1535
+ // For internal use only.
1536
+ //
1537
+ // Like `MergeFrom(const RepeatedPtrField& other)`, but uses the given arena
1538
+ // instead of calling `GetArena()`. It is the responsibility of the caller to
1539
+ // ensure that this arena is the same as the arena returned from `GetArena()`.
1540
+ void InternalMergeFromWithArena(internal::InternalVisibility, Arena* arena,
1541
+ const RepeatedPtrField& other);
1542
+
1543
+ private:
1544
+ using InternalArenaConstructable_ = void;
1545
+ using DestructorSkippable_ = void;
1546
+
1547
+ // Friended to allow calling `*WithArena` variants.
1548
+ template <typename T>
1549
+ friend class internal::RepeatedPtrFieldBackInsertIterator;
1550
+
1551
+ // Friended to allow calling `AddAllocated` from our private base class with
1552
+ // arena pointers, which may be cached in the iterator. This saves us needing
1553
+ // to call `GetArena()` on the `RepeatedPtrField` every insertion, which has 2
1554
+ // levels of indirection.
1555
+ template <typename T>
1556
+ friend class internal::AllocatedRepeatedPtrFieldBackInsertIterator;
1557
+
1558
+ friend class internal::RepeatedPtrFieldTest;
1559
+
1560
+ friend class Arena;
1561
+
1562
+ friend class internal::FieldWithArena<RepeatedPtrField<Element>>;
1563
+
1564
+ friend class DynamicMessage;
1565
+
1566
+ friend class google::protobuf::Reflection;
1567
+
1568
+ friend class google::protobuf::internal::ExtensionSet;
1569
+
1570
+ friend class internal::MapFieldBase;
1571
+
1572
+ friend class internal::TcParser;
1573
+
1574
+ template <typename ElementType>
1575
+ friend class RepeatedFieldProxy;
1576
+
1577
+ template <typename T>
1578
+ friend struct WeakRepeatedPtrField;
1579
+
1580
+ // The MapFieldBase implementation needs to be able to static_cast down to
1581
+ // `RepeatedPtrFieldBase`.
1582
+ friend internal::MapFieldBase;
1583
+
1584
+ // Note: RepeatedPtrField SHOULD NOT be subclassed by users.
1585
+ using TypeHandler = internal::GenericTypeHandler<Element>;
1586
+
1587
+ constexpr explicit RepeatedPtrField(internal::InternalMetadataOffset offset);
1588
+ RepeatedPtrField(internal::InternalMetadataOffset offset,
1589
+ const RepeatedPtrField& rhs);
1590
+ RepeatedPtrField(internal::InternalMetadataOffset offset,
1591
+ RepeatedPtrField&& rhs);
1592
+
1593
+
1594
+ pointer AddWithArena(Arena* arena) ABSL_ATTRIBUTE_LIFETIME_BOUND;
1595
+
1596
+ pointer AddWithArena(Arena* arena, Element&& value);
1597
+
1598
+ // Private-only. Copies `value` into a newly allocated element.
1599
+ pointer AddWithArena(Arena* arena, const Element& value);
1600
+
1601
+ template <typename Iter>
1602
+ void AddWithArena(Arena* arena, Iter begin, Iter end);
1603
+
1604
+ // Private-only. Constructs an element in-place from `args`.
1605
+ template <typename... Args>
1606
+ pointer EmplaceWithArena(Arena* arena, Args&&... args);
1607
+
1608
+ void AddAllocatedWithArena(Arena* arena, Element* value);
1609
+
1610
+ PROTOBUF_FUTURE_ADD_NODISCARD Element* ReleaseLastWithArena(Arena* arena);
1611
+
1612
+ void UnsafeArenaAddAllocatedWithArena(Arena* arena, Element* value);
1613
+
1614
+ void ExtractSubrangeWithArena(Arena* arena, int start, int num,
1615
+ Element** elements);
1616
+
1617
+ void AddAllocatedForParse(Element* p, Arena* arena) {
1618
+ return RepeatedPtrFieldBase::AddAllocatedForParse(p, arena);
1619
+ }
1620
+ };
1621
+
1622
+ // -------------------------------------------------------------------
1623
+
1624
+ template <typename Element>
1625
+ constexpr RepeatedPtrField<Element>::RepeatedPtrField()
1626
+ : RepeatedPtrFieldBase() {
1627
+ // We can't have `StaticValidityCheck` here because it requires Element to
1628
+ // be a complete type, and split `RepeatedPtrField`s call
1629
+ // `Arena::DefaultConstruct` with an incomplete `Element`, in particular when
1630
+ // constructing `RepeatedPtrField`s without arena offsets in arena.h.
1631
+ }
1632
+
1633
+ template <typename Element>
1634
+ constexpr PROTOBUF_ALWAYS_INLINE RepeatedPtrField<Element>::RepeatedPtrField(
1635
+ internal::InternalMetadataOffset offset)
1636
+ : RepeatedPtrFieldBase(offset) {
1637
+ // We can't have StaticValidityCheck here because that requires Element to be
1638
+ // a complete type, and in split repeated fields cases, we call
1639
+ // CreateMessage<RepeatedPtrField<T>> for incomplete Ts.
1640
+ }
1641
+
1642
+ template <typename Element>
1643
+ PROTOBUF_ALWAYS_INLINE RepeatedPtrField<Element>::RepeatedPtrField(
1644
+ internal::InternalMetadataOffset offset, const RepeatedPtrField& rhs)
1645
+ : RepeatedPtrFieldBase(offset) {
1646
+ StaticValidityCheck();
1647
+ MergeFrom(rhs);
1648
+ }
1649
+
1650
+ template <typename Element>
1651
+ template <typename Iter, typename>
1652
+ PROTOBUF_ALWAYS_INLINE RepeatedPtrField<Element>::RepeatedPtrField(Iter begin,
1653
+ Iter end) {
1654
+ StaticValidityCheck();
1655
+ Add(begin, end);
1656
+ }
1657
+
1658
+ template <typename Element>
1659
+ RepeatedPtrField<Element>::~RepeatedPtrField() {
1660
+ StaticValidityCheck();
1661
+ if (!NeedsDestroy()) return;
1662
+ if constexpr (std::is_base_of<MessageLite, Element>::value) {
1663
+ DestroyProtos();
1664
+ } else {
1665
+ Destroy<TypeHandler>();
1666
+ }
1667
+ }
1668
+
1669
+ template <typename Element>
1670
+ void RepeatedPtrField<Element>::resize(size_type new_size) {
1671
+ static_assert(!std::is_same_v<Element, Message>);
1672
+ static_assert(!std::is_same_v<Element, MessageLite>);
1673
+ ResizeImpl<TypeHandler>(new_size,
1674
+ [&](auto* arena) { return AddWithArena(arena); });
1675
+ }
1676
+
1677
+ template <typename Element>
1678
+ void RepeatedPtrField<Element>::resize(size_type new_size,
1679
+ CopyConstructReferenceType value) {
1680
+ const auto adder = [&] {
1681
+ if constexpr (std::is_base_of_v<MessageLite, Element>) {
1682
+ return GetAdderFromPrototype<TypeHandler>(&value);
1683
+ } else {
1684
+ return [this](auto* arena) { return AddWithArena(arena); };
1685
+ }
1686
+ }();
1687
+ ResizeImpl<TypeHandler>(new_size, [adder, &value](auto* arena) {
1688
+ TypeHandler::CopyFrom(adder(arena), value);
1689
+ });
1690
+ }
1691
+
1692
+ template <typename Element>
1693
+ inline RepeatedPtrField<Element>& RepeatedPtrField<Element>::operator=(
1694
+ const RepeatedPtrField& other) ABSL_ATTRIBUTE_LIFETIME_BOUND {
1695
+ if (this != &other) CopyFrom(other);
1696
+ return *this;
1697
+ }
1698
+
1699
+ template <typename Element>
1700
+ inline RepeatedPtrField<Element>::RepeatedPtrField(
1701
+ internal::InternalMetadataOffset offset, RepeatedPtrField&& rhs)
1702
+ : RepeatedPtrFieldBase(offset) {
1703
+ // We don't just call Swap(&rhs) here because it would perform 3 copies if rhs
1704
+ // is on a different arena.
1705
+ Arena* arena = GetArena();
1706
+ if (internal::CanMoveWithInternalSwap(arena, rhs.GetArena())) {
1707
+ InternalSwap(&rhs);
1708
+ } else {
1709
+ RepeatedPtrFieldBase::CopyFrom<TypeHandler>(rhs, arena);
1710
+ }
1711
+ }
1712
+
1713
+ template <typename Element>
1714
+ inline RepeatedPtrField<Element>& RepeatedPtrField<Element>::operator=(
1715
+ RepeatedPtrField&& other) noexcept ABSL_ATTRIBUTE_LIFETIME_BOUND {
1716
+ // We don't just call Swap(&other) here because it would perform 3 copies if
1717
+ // the two fields are on different arenas.
1718
+ if (this != &other) {
1719
+ Arena* arena = GetArena();
1720
+ Arena* other_arena = other.GetArena();
1721
+ if (internal::CanMoveWithInternalSwap(arena, other_arena)) {
1722
+ InternalSwap(&other);
1723
+ } else {
1724
+ RepeatedPtrFieldBase::CopyFrom<TypeHandler>(other, arena);
1725
+ }
1726
+ }
1727
+ return *this;
1728
+ }
1729
+
1730
+ template <typename Element>
1731
+ inline bool RepeatedPtrField<Element>::empty() const {
1732
+ return RepeatedPtrFieldBase::empty();
1733
+ }
1734
+
1735
+ template <typename Element>
1736
+ inline int RepeatedPtrField<Element>::size() const {
1737
+ return RepeatedPtrFieldBase::size();
1738
+ }
1739
+
1740
+ template <typename Element>
1741
+ inline const Element& RepeatedPtrField<Element>::Get(int index) const
1742
+ ABSL_ATTRIBUTE_LIFETIME_BOUND {
1743
+ return RepeatedPtrFieldBase::Get<TypeHandler>(index);
1744
+ }
1745
+
1746
+ template <typename Element>
1747
+ inline const Element& RepeatedPtrField<Element>::at(int index) const
1748
+ ABSL_ATTRIBUTE_LIFETIME_BOUND {
1749
+ return RepeatedPtrFieldBase::at<TypeHandler>(index);
1750
+ }
1751
+
1752
+ template <typename Element>
1753
+ inline Element& RepeatedPtrField<Element>::at(int index)
1754
+ ABSL_ATTRIBUTE_LIFETIME_BOUND {
1755
+ return RepeatedPtrFieldBase::at<TypeHandler>(index);
1756
+ }
1757
+
1758
+ template <typename Element>
1759
+ inline Element* RepeatedPtrField<Element>::Mutable(int index)
1760
+ ABSL_ATTRIBUTE_LIFETIME_BOUND {
1761
+ return RepeatedPtrFieldBase::Mutable<TypeHandler>(index);
1762
+ }
1763
+
1764
+ template <typename Element>
1765
+ PROTOBUF_NDEBUG_INLINE Element* RepeatedPtrField<Element>::Add()
1766
+ ABSL_ATTRIBUTE_LIFETIME_BOUND {
1767
+ return AddWithArena(GetArena());
1768
+ }
1769
+
1770
+ template <typename Element>
1771
+ PROTOBUF_NDEBUG_INLINE Element* RepeatedPtrField<Element>::InternalAddWithArena(
1772
+ internal::InternalVisibility, Arena* arena) ABSL_ATTRIBUTE_LIFETIME_BOUND {
1773
+ return AddWithArena(arena);
1774
+ }
1775
+
1776
+ template <typename Element>
1777
+ PROTOBUF_NDEBUG_INLINE Element* RepeatedPtrField<Element>::AddWithArena(
1778
+ Arena* arena) ABSL_ATTRIBUTE_LIFETIME_BOUND {
1779
+ return RepeatedPtrFieldBase::Add<TypeHandler>(arena);
1780
+ }
1781
+
1782
+ template <typename Element>
1783
+ PROTOBUF_NDEBUG_INLINE void RepeatedPtrField<Element>::Add(Element&& value) {
1784
+ AddWithArena(GetArena(), std::move(value));
1785
+ }
1786
+
1787
+ template <typename Element>
1788
+ PROTOBUF_NDEBUG_INLINE void RepeatedPtrField<Element>::InternalAddWithArena(
1789
+ internal::InternalVisibility, Arena* arena, Element&& value) {
1790
+ AddWithArena(arena, std::move(value));
1791
+ }
1792
+
1793
+ template <typename Element>
1794
+ PROTOBUF_NDEBUG_INLINE typename RepeatedPtrField<Element>::pointer
1795
+ RepeatedPtrField<Element>::AddWithArena(Arena* arena, Element&& value) {
1796
+ return RepeatedPtrFieldBase::Add<TypeHandler>(arena, std::move(value));
1797
+ }
1798
+
1799
+ template <typename Element>
1800
+ PROTOBUF_NDEBUG_INLINE typename RepeatedPtrField<Element>::pointer
1801
+ RepeatedPtrField<Element>::AddWithArena(Arena* arena, const Element& value) {
1802
+ return RepeatedPtrFieldBase::Add<TypeHandler>(arena, value);
1803
+ }
1804
+
1805
+ template <typename Element>
1806
+ template <typename... Args>
1807
+ PROTOBUF_NDEBUG_INLINE typename RepeatedPtrField<Element>::pointer
1808
+ RepeatedPtrField<Element>::EmplaceWithArena(Arena* arena, Args&&... args) {
1809
+ return RepeatedPtrFieldBase::Emplace<TypeHandler>(
1810
+ arena, std::forward<Args>(args)...);
1811
+ }
1812
+
1813
+ template <typename Element>
1814
+ template <typename Iter>
1815
+ PROTOBUF_NDEBUG_INLINE void RepeatedPtrField<Element>::Add(Iter begin,
1816
+ Iter end) {
1817
+ AddWithArena(GetArena(), std::move(begin), std::move(end));
1818
+ }
1819
+
1820
+ template <typename Element>
1821
+ template <typename Iter>
1822
+ PROTOBUF_NDEBUG_INLINE void RepeatedPtrField<Element>::AddWithArena(
1823
+ Arena* arena, Iter begin, Iter end) {
1824
+ if (std::is_base_of<
1825
+ std::forward_iterator_tag,
1826
+ typename std::iterator_traits<Iter>::iterator_category>::value) {
1827
+ int reserve = static_cast<int>(std::distance(begin, end));
1828
+ ReserveWithArena(arena, size() + reserve);
1829
+ }
1830
+ for (; begin != end; ++begin) {
1831
+ *AddWithArena(arena) = *begin;
1832
+ }
1833
+ }
1834
+
1835
+ template <typename Element>
1836
+ inline void RepeatedPtrField<Element>::RemoveLast() {
1837
+ RepeatedPtrFieldBase::RemoveLast<TypeHandler>();
1838
+ }
1839
+
1840
+ template <typename Element>
1841
+ inline void RepeatedPtrField<Element>::DeleteSubrange(int start, int num) {
1842
+ internal::RuntimeAssertInBoundsGE(start, 0);
1843
+ internal::RuntimeAssertInBoundsGE(num, 0);
1844
+ internal::RuntimeAssertInBoundsLE(static_cast<int64_t>(start) + num, size());
1845
+ void** subrange = raw_mutable_data() + start;
1846
+ if (GetArena() == nullptr) {
1847
+ for (int i = 0; i < num; ++i) {
1848
+ using H = CommonHandler<TypeHandler>;
1849
+ H::Delete(static_cast<Element*>(subrange[i]));
1850
+ }
1851
+ }
1852
+ UnsafeArenaExtractSubrange(start, num, nullptr);
1853
+ }
1854
+
1855
+ template <typename Element>
1856
+ inline void RepeatedPtrField<Element>::ExtractSubrange(int start, int num,
1857
+ Element** elements) {
1858
+ ExtractSubrangeWithArena(GetArena(), start, num, elements);
1859
+ }
1860
+
1861
+ template <typename Element>
1862
+ inline void RepeatedPtrField<Element>::ExtractSubrangeWithArena(
1863
+ Arena* arena, int start, int num, Element** elements) {
1864
+ ABSL_DCHECK_EQ(arena, GetArena());
1865
+ internal::RuntimeAssertInBoundsGE(start, 0);
1866
+ internal::RuntimeAssertInBoundsGE(num, 0);
1867
+ internal::RuntimeAssertInBoundsLE(static_cast<int64_t>(start) + num, size());
1868
+
1869
+ if (num == 0) return;
1870
+
1871
+ ABSL_DCHECK_NE(elements, nullptr)
1872
+ << "Releasing elements without transferring ownership is an unsafe "
1873
+ "operation. Use UnsafeArenaExtractSubrange.";
1874
+ if (elements != nullptr) {
1875
+ auto* extracted = data() + start;
1876
+ if (internal::DebugHardenForceCopyInRelease()) {
1877
+ // Always copy.
1878
+ for (int i = 0; i < num; ++i) {
1879
+ elements[i] = copy<TypeHandler>(extracted[i]);
1880
+ }
1881
+ if (arena == nullptr) {
1882
+ for (int i = 0; i < num; ++i) {
1883
+ delete extracted[i];
1884
+ }
1885
+ }
1886
+ } else {
1887
+ // If we're on an arena, we perform a copy for each element so that the
1888
+ // returned elements are heap-allocated. Otherwise, just forward it.
1889
+ if (arena != nullptr) {
1890
+ for (int i = 0; i < num; ++i) {
1891
+ elements[i] = copy<TypeHandler>(extracted[i]);
1892
+ }
1893
+ } else {
1894
+ memcpy(elements, extracted, num * sizeof(Element*));
1895
+ }
1896
+ }
1897
+ }
1898
+ CloseGap(start, num);
1899
+ }
1900
+
1901
+ template <typename Element>
1902
+ inline void RepeatedPtrField<Element>::UnsafeArenaExtractSubrange(
1903
+ int start, int num, Element** elements) {
1904
+ internal::RuntimeAssertInBoundsGE(start, 0);
1905
+ internal::RuntimeAssertInBoundsGE(num, 0);
1906
+ internal::RuntimeAssertInBoundsLE(static_cast<int64_t>(start) + num, size());
1907
+
1908
+ if (num > 0) {
1909
+ // Save the values of the removed elements if requested.
1910
+ if (elements != nullptr) {
1911
+ memcpy(elements, data() + start, num * sizeof(Element*));
1912
+ }
1913
+ CloseGap(start, num);
1914
+ }
1915
+ }
1916
+
1917
+ template <typename Element>
1918
+ inline void RepeatedPtrField<Element>::Clear() {
1919
+ RepeatedPtrFieldBase::Clear<TypeHandler>();
1920
+ }
1921
+
1922
+ template <typename Element>
1923
+ inline void RepeatedPtrField<Element>::MergeFrom(
1924
+ const RepeatedPtrField& other) {
1925
+ if (other.empty()) return;
1926
+ RepeatedPtrFieldBase::MergeFrom<Element>(other, GetArena());
1927
+ }
1928
+
1929
+ template <typename Element>
1930
+ inline void RepeatedPtrField<Element>::InternalMergeFromWithArena(
1931
+ internal::InternalVisibility, Arena* arena, const RepeatedPtrField& other) {
1932
+ if (other.empty()) return;
1933
+ RepeatedPtrFieldBase::MergeFrom<Element>(other, arena);
1934
+ }
1935
+
1936
+ template <typename Element>
1937
+ inline void RepeatedPtrField<Element>::CopyFrom(const RepeatedPtrField& other) {
1938
+ RepeatedPtrFieldBase::CopyFrom<TypeHandler>(other, GetArena());
1939
+ }
1940
+
1941
+ template <typename Element>
1942
+ template <typename Iter>
1943
+ inline void RepeatedPtrField<Element>::Assign(Iter begin, Iter end) {
1944
+ Clear();
1945
+ Add(begin, end);
1946
+ }
1947
+
1948
+ template <typename Element>
1949
+ inline typename RepeatedPtrField<Element>::iterator
1950
+ RepeatedPtrField<Element>::erase(const_iterator position)
1951
+ ABSL_ATTRIBUTE_LIFETIME_BOUND {
1952
+ return erase(position, position + 1);
1953
+ }
1954
+
1955
+ template <typename Element>
1956
+ inline typename RepeatedPtrField<Element>::iterator
1957
+ RepeatedPtrField<Element>::erase(const_iterator first, const_iterator last)
1958
+ ABSL_ATTRIBUTE_LIFETIME_BOUND {
1959
+ size_type pos_offset = static_cast<size_type>(std::distance(cbegin(), first));
1960
+ size_type last_offset = static_cast<size_type>(std::distance(cbegin(), last));
1961
+ DeleteSubrange(pos_offset, last_offset - pos_offset);
1962
+ return begin() + pos_offset;
1963
+ }
1964
+
1965
+ template <typename Element>
1966
+ inline Element** RepeatedPtrField<Element>::mutable_data()
1967
+ ABSL_ATTRIBUTE_LIFETIME_BOUND {
1968
+ return RepeatedPtrFieldBase::mutable_data<TypeHandler>();
1969
+ }
1970
+
1971
+ template <typename Element>
1972
+ inline const Element* const* RepeatedPtrField<Element>::data() const
1973
+ ABSL_ATTRIBUTE_LIFETIME_BOUND {
1974
+ return RepeatedPtrFieldBase::data<TypeHandler>();
1975
+ }
1976
+
1977
+ template <typename Element>
1978
+ inline void RepeatedPtrField<Element>::Swap(RepeatedPtrField* other) {
1979
+ if (this == other) return;
1980
+ RepeatedPtrFieldBase::Swap<TypeHandler>(GetArena(), other, other->GetArena());
1981
+ }
1982
+
1983
+ template <typename Element>
1984
+ inline void RepeatedPtrField<Element>::UnsafeArenaSwap(
1985
+ RepeatedPtrField* other) {
1986
+ if (this == other) return;
1987
+ ABSL_DCHECK_EQ(GetArena(), other->GetArena());
1988
+ RepeatedPtrFieldBase::InternalSwap(other);
1989
+ }
1990
+
1991
+ template <typename Element>
1992
+ inline void RepeatedPtrField<Element>::SwapElements(int index1, int index2) {
1993
+ RepeatedPtrFieldBase::SwapElements(index1, index2);
1994
+ }
1995
+
1996
+ template <typename Element>
1997
+ inline Arena* RepeatedPtrField<Element>::GetArena() {
1998
+ // Note: we make this function non-const to force callers to call the
1999
+ // `mutable_*` accessor on the repeated field before calling `GetArena()`,
2000
+ // which initializes the field if it is split. If this method were const, then
2001
+ // `msg.repeated_ptr_field().GetArena()` would be valid, but for split
2002
+ // repeated fields `repeated_ptr_field()` could point to the default split
2003
+ // instance. This would always return `nullptr`, which is incorrect when using
2004
+ // arenas.
2005
+ return RepeatedPtrFieldBase::GetArena();
2006
+ }
2007
+
2008
+ template <typename Element>
2009
+ inline size_t RepeatedPtrField<Element>::SpaceUsedExcludingSelfLong() const {
2010
+ // `google::protobuf::Message` has a virtual method `SpaceUsedLong`, hence we can
2011
+ // instantiate just one function for all protobuf messages.
2012
+ // Note: std::is_base_of requires that `Element` is a concrete class.
2013
+ using H = typename std::conditional<std::is_base_of<Message, Element>::value,
2014
+ internal::GenericTypeHandler<Message>,
2015
+ TypeHandler>::type;
2016
+ return RepeatedPtrFieldBase::SpaceUsedExcludingSelfLong<H>();
2017
+ }
2018
+
2019
+ template <typename Element>
2020
+ inline void RepeatedPtrField<Element>::AddAllocated(Element* value) {
2021
+ AddAllocatedWithArena(GetArena(), value);
2022
+ }
2023
+
2024
+ template <typename Element>
2025
+ inline void RepeatedPtrField<Element>::AddAllocatedWithArena(Arena* arena,
2026
+ Element* value) {
2027
+ ABSL_DCHECK_EQ(arena, GetArena());
2028
+ RepeatedPtrFieldBase::AddAllocated<TypeHandler>(arena, value);
2029
+ }
2030
+
2031
+ template <typename Element>
2032
+ inline void RepeatedPtrField<Element>::UnsafeArenaAddAllocated(Element* value) {
2033
+ UnsafeArenaAddAllocatedWithArena(GetArena(), value);
2034
+ }
2035
+
2036
+ template <typename Element>
2037
+ inline void RepeatedPtrField<Element>::UnsafeArenaAddAllocatedWithArena(
2038
+ Arena* arena, Element* value) {
2039
+ ABSL_DCHECK_EQ(arena, GetArena());
2040
+ RepeatedPtrFieldBase::UnsafeArenaAddAllocated<TypeHandler>(arena, value);
2041
+ }
2042
+
2043
+ template <typename Element>
2044
+ inline Element* RepeatedPtrField<Element>::ReleaseLast() {
2045
+ return ReleaseLastWithArena(GetArena());
2046
+ }
2047
+ template <typename Element>
2048
+ inline Element* RepeatedPtrField<Element>::ReleaseLastWithArena(Arena* arena) {
2049
+ ABSL_DCHECK_EQ(arena, GetArena());
2050
+ return RepeatedPtrFieldBase::ReleaseLast<TypeHandler>(arena);
2051
+ }
2052
+
2053
+ template <typename Element>
2054
+ inline Element* RepeatedPtrField<Element>::UnsafeArenaReleaseLast() {
2055
+ return RepeatedPtrFieldBase::UnsafeArenaReleaseLast<TypeHandler>();
2056
+ }
2057
+
2058
+ template <typename Element>
2059
+ inline void RepeatedPtrField<Element>::Reserve(int new_size) {
2060
+ return RepeatedPtrFieldBase::ReserveWithArena(GetArena(), new_size);
2061
+ }
2062
+
2063
+ template <typename Element>
2064
+ inline int RepeatedPtrField<Element>::Capacity() const {
2065
+ return RepeatedPtrFieldBase::Capacity();
2066
+ }
2067
+
2068
+ // -------------------------------------------------------------------
2069
+
2070
+ namespace internal {
2071
+
2072
+ // A container that holds a RepeatedPtrField<Element> and an arena pointer. This
2073
+ // is used for both directly arena-allocated RepeatedPtrField's and split
2074
+ // RepeatedPtrField's. Both cases need to be able to allocate memory in case a
2075
+ // user calls mutating methods on the RepeatedPtrField pointer.
2076
+ template <typename Element>
2077
+ using RepeatedPtrFieldWithArena = FieldWithArena<RepeatedPtrField<Element>>;
2078
+
2079
+ template <typename Element>
2080
+ struct FieldArenaRep<RepeatedPtrField<Element>> {
2081
+ using Type = RepeatedPtrFieldWithArena<Element>;
2082
+
2083
+ static inline RepeatedPtrField<Element>* Get(
2084
+ RepeatedPtrFieldWithArena<Element>* arena_rep) {
2085
+ return &arena_rep->field();
2086
+ }
2087
+ };
2088
+
2089
+ template <typename Element>
2090
+ struct FieldArenaRep<const RepeatedPtrField<Element>> {
2091
+ using Type = const RepeatedPtrFieldWithArena<Element>;
2092
+
2093
+ static inline const RepeatedPtrField<Element>* Get(
2094
+ const RepeatedPtrFieldWithArena<Element>* arena_rep) {
2095
+ return &arena_rep->field();
2096
+ }
2097
+ };
2098
+
2099
+ // This class gives the Rust implementation access to some protected methods on
2100
+ // RepeatedPtrFieldBase. These methods allow us to operate solely on the
2101
+ // MessageLite interface so that we do not need to generate code for each
2102
+ // concrete message type.
2103
+ class RustRepeatedMessageHelper {
2104
+ public:
2105
+ static RepeatedPtrFieldBase* New() { return new RepeatedPtrFieldBase; }
2106
+
2107
+ static void Delete(RepeatedPtrFieldBase* field) {
2108
+ if (field->NeedsDestroy()) {
2109
+ field->DestroyProtos();
2110
+ }
2111
+ delete field;
2112
+ }
2113
+
2114
+ static size_t Size(const RepeatedPtrFieldBase& field) {
2115
+ return static_cast<size_t>(field.size());
2116
+ }
2117
+
2118
+ static auto Add(RepeatedPtrFieldBase& field, const MessageLite* prototype) {
2119
+ return field.AddFromPrototype<GenericTypeHandler<MessageLite>>(
2120
+ field.GetArena(), prototype);
2121
+ }
2122
+
2123
+ static void CopyFrom(const RepeatedPtrFieldBase& src,
2124
+ RepeatedPtrFieldBase& dst) {
2125
+ dst.Clear<GenericTypeHandler<google::protobuf::MessageLite>>();
2126
+ dst.MergeFrom<google::protobuf::MessageLite>(src, dst.GetArena());
2127
+ }
2128
+
2129
+ static void Reserve(RepeatedPtrFieldBase& field, size_t additional) {
2130
+ field.ReserveWithArena(field.GetArena(), field.size() + additional);
2131
+ }
2132
+
2133
+ static const MessageLite& At(const RepeatedPtrFieldBase& field,
2134
+ size_t index) {
2135
+ return field.at<GenericTypeHandler<MessageLite>>(index);
2136
+ }
2137
+
2138
+ static MessageLite& At(RepeatedPtrFieldBase& field, size_t index) {
2139
+ return field.at<GenericTypeHandler<MessageLite>>(index);
2140
+ }
2141
+ };
2142
+
2143
+ // STL-like iterator implementation for RepeatedPtrField. You should not
2144
+ // refer to this class directly; use RepeatedPtrField<T>::iterator instead.
2145
+ //
2146
+ // The iterator for RepeatedPtrField<T>, RepeatedPtrIterator<T>, is
2147
+ // very similar to iterator_ptr<T**> in util/gtl/iterator_adaptors.h,
2148
+ // but adds random-access operators and is modified to wrap a void** base
2149
+ // iterator (since RepeatedPtrField stores its array as a void* array and
2150
+ // casting void** to T** would violate C++ aliasing rules).
2151
+ //
2152
+ // This code based on net/proto/proto-array-internal.h by Jeffrey Yasskin
2153
+ // (jyasskin@google.com).
2154
+ template <typename Element>
2155
+ class ABSL_ATTRIBUTE_VIEW RepeatedPtrIterator {
2156
+ public:
2157
+ using iterator = RepeatedPtrIterator<Element>;
2158
+ using iterator_category = std::random_access_iterator_tag;
2159
+ using value_type = typename std::remove_const<Element>::type;
2160
+ using difference_type = std::ptrdiff_t;
2161
+ using pointer = Element*;
2162
+ using reference = Element&;
2163
+
2164
+ RepeatedPtrIterator() : it_(nullptr) {}
2165
+ explicit RepeatedPtrIterator(void* const* it) : it_(it) {}
2166
+
2167
+ // Allows "upcasting" from RepeatedPtrIterator<T**> to
2168
+ // RepeatedPtrIterator<const T*const*>.
2169
+ template <typename OtherElement,
2170
+ typename =
2171
+ std::enable_if_t<std::is_convertible_v<OtherElement*, pointer>>>
2172
+ RepeatedPtrIterator(const RepeatedPtrIterator<OtherElement>& other)
2173
+ : it_(other.it_) {}
2174
+
2175
+ // dereferenceable
2176
+ PROTOBUF_FUTURE_ADD_NODISCARD reference operator*() const {
2177
+ return *reinterpret_cast<Element*>(*it_);
2178
+ }
2179
+ PROTOBUF_FUTURE_ADD_NODISCARD pointer operator->() const {
2180
+ return &(operator*());
2181
+ }
2182
+
2183
+ // {inc,dec}rementable
2184
+ iterator& operator++() {
2185
+ ++it_;
2186
+ return *this;
2187
+ }
2188
+ iterator operator++(int) { return iterator(it_++); }
2189
+ iterator& operator--() {
2190
+ --it_;
2191
+ return *this;
2192
+ }
2193
+ iterator operator--(int) { return iterator(it_--); }
2194
+
2195
+ // equality_comparable
2196
+ friend bool operator==(const iterator& x, const iterator& y) {
2197
+ return x.it_ == y.it_;
2198
+ }
2199
+ friend bool operator!=(const iterator& x, const iterator& y) {
2200
+ return x.it_ != y.it_;
2201
+ }
2202
+
2203
+ // less_than_comparable
2204
+ friend bool operator<(const iterator& x, const iterator& y) {
2205
+ return x.it_ < y.it_;
2206
+ }
2207
+ friend bool operator<=(const iterator& x, const iterator& y) {
2208
+ return x.it_ <= y.it_;
2209
+ }
2210
+ friend bool operator>(const iterator& x, const iterator& y) {
2211
+ return x.it_ > y.it_;
2212
+ }
2213
+ friend bool operator>=(const iterator& x, const iterator& y) {
2214
+ return x.it_ >= y.it_;
2215
+ }
2216
+
2217
+ // addable, subtractable
2218
+ iterator& operator+=(difference_type d) {
2219
+ it_ += d;
2220
+ return *this;
2221
+ }
2222
+ friend iterator operator+(iterator it, const difference_type d) {
2223
+ it += d;
2224
+ return it;
2225
+ }
2226
+ friend iterator operator+(const difference_type d, iterator it) {
2227
+ it += d;
2228
+ return it;
2229
+ }
2230
+ iterator& operator-=(difference_type d) {
2231
+ it_ -= d;
2232
+ return *this;
2233
+ }
2234
+ friend iterator operator-(iterator it, difference_type d) {
2235
+ it -= d;
2236
+ return it;
2237
+ }
2238
+
2239
+ // indexable
2240
+ PROTOBUF_FUTURE_ADD_NODISCARD reference operator[](difference_type d) const {
2241
+ return *(*this + d);
2242
+ }
2243
+
2244
+ // random access iterator
2245
+ friend difference_type operator-(iterator it1, iterator it2) {
2246
+ return it1.it_ - it2.it_;
2247
+ }
2248
+
2249
+ private:
2250
+ template <typename OtherElement>
2251
+ friend class RepeatedPtrIterator;
2252
+
2253
+ template <typename E>
2254
+ friend auto internal::ConvertToPtrIterator(RepeatedPtrIterator<E> it);
2255
+
2256
+ // The internal iterator.
2257
+ void* const* it_;
2258
+ };
2259
+
2260
+ template <typename Traits, typename = void>
2261
+ struct IteratorConceptSupport {
2262
+ using tag = typename Traits::iterator_category;
2263
+ };
2264
+
2265
+ template <typename Traits>
2266
+ struct IteratorConceptSupport<Traits,
2267
+ std::void_t<typename Traits::iterator_concept>> {
2268
+ using tag = typename Traits::iterator_concept;
2269
+ };
2270
+
2271
+ // Provides an iterator that operates on pointers to the underlying objects
2272
+ // rather than the objects themselves as RepeatedPtrIterator does.
2273
+ // Consider using this when working with stl algorithms that change
2274
+ // the array.
2275
+ // The VoidPtr template parameter holds the type-agnostic pointer value
2276
+ // referenced by the iterator. It should either be "void *" for a mutable
2277
+ // iterator, or "const void* const" for a constant iterator.
2278
+ template <typename Element>
2279
+ class RepeatedPtrOverPtrsIterator {
2280
+ private:
2281
+ using traits = std::iterator_traits<Element**>;
2282
+
2283
+ using ElementPtr =
2284
+ std::conditional_t<std::is_const_v<Element>, Element* const, Element*>;
2285
+ using VoidPtr =
2286
+ std::conditional_t<std::is_const_v<Element>, const void* const, void*>;
2287
+
2288
+ public:
2289
+ using value_type = typename traits::value_type;
2290
+ using difference_type = typename traits::difference_type;
2291
+ using pointer = ElementPtr*;
2292
+ using reference = ElementPtr&;
2293
+ using iterator_category = typename traits::iterator_category;
2294
+ using iterator_concept = typename IteratorConceptSupport<traits>::tag;
2295
+
2296
+ using iterator = RepeatedPtrOverPtrsIterator<Element>;
2297
+
2298
+ RepeatedPtrOverPtrsIterator() : it_(nullptr) {}
2299
+ explicit RepeatedPtrOverPtrsIterator(VoidPtr* it) : it_(it) {}
2300
+
2301
+ // Allow "upcasting" from RepeatedPtrOverPtrsIterator<T> to
2302
+ // RepeatedPtrOverPtrsIterator<const T>.
2303
+ template <typename E = Element,
2304
+ typename = std::enable_if_t<std::is_const_v<E>>>
2305
+ RepeatedPtrOverPtrsIterator(
2306
+ const RepeatedPtrOverPtrsIterator<std::remove_const_t<Element>>& other)
2307
+ : it_(other.it_) {}
2308
+
2309
+ // dereferenceable
2310
+ PROTOBUF_FUTURE_ADD_NODISCARD reference operator*() const {
2311
+ return *reinterpret_cast<pointer>(it_);
2312
+ }
2313
+ PROTOBUF_FUTURE_ADD_NODISCARD pointer operator->() const {
2314
+ return reinterpret_cast<pointer>(it_);
2315
+ }
2316
+
2317
+ // {inc,dec}rementable
2318
+ iterator& operator++() {
2319
+ ++it_;
2320
+ return *this;
2321
+ }
2322
+ iterator operator++(int) { return iterator(it_++); }
2323
+ iterator& operator--() {
2324
+ --it_;
2325
+ return *this;
2326
+ }
2327
+ iterator operator--(int) { return iterator(it_--); }
2328
+
2329
+ // equality_comparable
2330
+ friend bool operator==(const iterator& x, const iterator& y) {
2331
+ return x.it_ == y.it_;
2332
+ }
2333
+ friend bool operator!=(const iterator& x, const iterator& y) {
2334
+ return x.it_ != y.it_;
2335
+ }
2336
+
2337
+ // less_than_comparable
2338
+ friend bool operator<(const iterator& x, const iterator& y) {
2339
+ return x.it_ < y.it_;
2340
+ }
2341
+ friend bool operator<=(const iterator& x, const iterator& y) {
2342
+ return x.it_ <= y.it_;
2343
+ }
2344
+ friend bool operator>(const iterator& x, const iterator& y) {
2345
+ return x.it_ > y.it_;
2346
+ }
2347
+ friend bool operator>=(const iterator& x, const iterator& y) {
2348
+ return x.it_ >= y.it_;
2349
+ }
2350
+
2351
+ // addable, subtractable
2352
+ iterator& operator+=(difference_type d) {
2353
+ it_ += d;
2354
+ return *this;
2355
+ }
2356
+ friend iterator operator+(iterator it, difference_type d) {
2357
+ it += d;
2358
+ return it;
2359
+ }
2360
+ friend iterator operator+(difference_type d, iterator it) {
2361
+ it += d;
2362
+ return it;
2363
+ }
2364
+ iterator& operator-=(difference_type d) {
2365
+ it_ -= d;
2366
+ return *this;
2367
+ }
2368
+ friend iterator operator-(iterator it, difference_type d) {
2369
+ it -= d;
2370
+ return it;
2371
+ }
2372
+
2373
+ // indexable
2374
+ PROTOBUF_FUTURE_ADD_NODISCARD reference operator[](difference_type d) const {
2375
+ return *(*this + d);
2376
+ }
2377
+
2378
+ // random access iterator
2379
+ friend difference_type operator-(iterator it1, iterator it2) {
2380
+ return it1.it_ - it2.it_;
2381
+ }
2382
+
2383
+ private:
2384
+ template <typename OtherElement>
2385
+ friend class RepeatedPtrOverPtrsIterator;
2386
+
2387
+ // The internal iterator.
2388
+ VoidPtr* it_;
2389
+ };
2390
+
2391
+ template <typename Element>
2392
+ inline auto ConvertToPtrIterator(RepeatedPtrIterator<Element> it) {
2393
+ return RepeatedPtrOverPtrsIterator<Element>(const_cast<void**>(it.it_));
2394
+ }
2395
+
2396
+ } // namespace internal
2397
+
2398
+ template <typename Element>
2399
+ inline typename RepeatedPtrField<Element>::iterator
2400
+ RepeatedPtrField<Element>::begin() ABSL_ATTRIBUTE_LIFETIME_BOUND {
2401
+ return iterator(raw_data());
2402
+ }
2403
+ template <typename Element>
2404
+ inline typename RepeatedPtrField<Element>::const_iterator
2405
+ RepeatedPtrField<Element>::begin() const ABSL_ATTRIBUTE_LIFETIME_BOUND {
2406
+ return iterator(raw_data());
2407
+ }
2408
+ template <typename Element>
2409
+ inline typename RepeatedPtrField<Element>::const_iterator
2410
+ RepeatedPtrField<Element>::cbegin() const ABSL_ATTRIBUTE_LIFETIME_BOUND {
2411
+ return begin();
2412
+ }
2413
+ template <typename Element>
2414
+ inline typename RepeatedPtrField<Element>::iterator
2415
+ RepeatedPtrField<Element>::end() ABSL_ATTRIBUTE_LIFETIME_BOUND {
2416
+ return iterator(raw_data() + size());
2417
+ }
2418
+ template <typename Element>
2419
+ inline typename RepeatedPtrField<Element>::const_iterator
2420
+ RepeatedPtrField<Element>::end() const ABSL_ATTRIBUTE_LIFETIME_BOUND {
2421
+ return iterator(raw_data() + size());
2422
+ }
2423
+ template <typename Element>
2424
+ inline typename RepeatedPtrField<Element>::const_iterator
2425
+ RepeatedPtrField<Element>::cend() const ABSL_ATTRIBUTE_LIFETIME_BOUND {
2426
+ return end();
2427
+ }
2428
+
2429
+ template <typename Element>
2430
+ inline typename RepeatedPtrField<Element>::pointer_iterator
2431
+ RepeatedPtrField<Element>::pointer_begin() ABSL_ATTRIBUTE_LIFETIME_BOUND {
2432
+ return pointer_iterator(raw_mutable_data());
2433
+ }
2434
+ template <typename Element>
2435
+ inline typename RepeatedPtrField<Element>::const_pointer_iterator
2436
+ RepeatedPtrField<Element>::pointer_begin() const ABSL_ATTRIBUTE_LIFETIME_BOUND {
2437
+ return const_pointer_iterator(const_cast<const void* const*>(raw_data()));
2438
+ }
2439
+ template <typename Element>
2440
+ inline typename RepeatedPtrField<Element>::pointer_iterator
2441
+ RepeatedPtrField<Element>::pointer_end() ABSL_ATTRIBUTE_LIFETIME_BOUND {
2442
+ return pointer_iterator(raw_mutable_data() + size());
2443
+ }
2444
+ template <typename Element>
2445
+ inline typename RepeatedPtrField<Element>::const_pointer_iterator
2446
+ RepeatedPtrField<Element>::pointer_end() const ABSL_ATTRIBUTE_LIFETIME_BOUND {
2447
+ return const_pointer_iterator(
2448
+ const_cast<const void* const*>(raw_data() + size()));
2449
+ }
2450
+
2451
+ // Like C++20's std::erase_if, for RepeatedPtrField
2452
+ // For string containers, the predicate is called with an `absl::string_view`.
2453
+ // Otherwise, it is called with a `const T&`.
2454
+ template <typename T, typename Pred>
2455
+ size_t erase_if(RepeatedPtrField<T>& cont, Pred pred) {
2456
+ // We use `partition` instead of `remove` to keep all the erased elements at
2457
+ // the end for cleanup.
2458
+ auto it = std::stable_partition(
2459
+ cont.pointer_begin(), cont.pointer_end(), [&](const auto* elem) {
2460
+ return !pred(internal::GenericTypeHandler<T>::ForElementCallback(elem));
2461
+ });
2462
+ const size_t removed = cont.pointer_end() - it;
2463
+ cont.DeleteSubrange(it - cont.pointer_begin(), removed);
2464
+ return removed;
2465
+ }
2466
+
2467
+ // Like C++20's std::erase, for RepeatedPtrField
2468
+ template <typename T, typename U>
2469
+ size_t erase(RepeatedPtrField<T>& cont, const U& value) {
2470
+ static_assert(!std::is_base_of_v<Message, T>, "Not supported. Use erase_if.");
2471
+ return google::protobuf::erase_if(cont,
2472
+ [&](const auto& elem) { return elem == value; });
2473
+ }
2474
+
2475
+ // These functions mimic their std counterpart, but potentially more efficient
2476
+ // for Protobuf containers.
2477
+ template <int&..., typename T, typename Compare>
2478
+ void sort(internal::RepeatedPtrIterator<T> begin,
2479
+ internal::RepeatedPtrIterator<T> end, Compare cmp) {
2480
+ using H = internal::GenericTypeHandler<T>;
2481
+ std::sort(internal::ConvertToPtrIterator(begin),
2482
+ internal::ConvertToPtrIterator(end),
2483
+ [&](const auto* lhs, const auto* rhs) {
2484
+ return cmp(H::ForElementCallback(lhs),
2485
+ H::ForElementCallback(rhs));
2486
+ });
2487
+ }
2488
+ template <int&..., typename T>
2489
+ void sort(internal::RepeatedPtrIterator<T> begin,
2490
+ internal::RepeatedPtrIterator<T> end) {
2491
+ google::protobuf::sort(begin, end, std::less<>{});
2492
+ }
2493
+ template <int&..., typename T, typename Compare>
2494
+ void stable_sort(internal::RepeatedPtrIterator<T> begin,
2495
+ internal::RepeatedPtrIterator<T> end, Compare cmp) {
2496
+ using H = internal::GenericTypeHandler<T>;
2497
+ std::stable_sort(internal::ConvertToPtrIterator(begin),
2498
+ internal::ConvertToPtrIterator(end),
2499
+ [&](const auto* lhs, const auto* rhs) {
2500
+ return cmp(H::ForElementCallback(lhs),
2501
+ H::ForElementCallback(rhs));
2502
+ });
2503
+ }
2504
+ template <int&..., typename T>
2505
+ void stable_sort(internal::RepeatedPtrIterator<T> begin,
2506
+ internal::RepeatedPtrIterator<T> end) {
2507
+ google::protobuf::stable_sort(begin, end, std::less<>{});
2508
+ }
2509
+
2510
+ // These functions mimic their absl counterpart, but they are more efficient for
2511
+ // Protobuf containers.
2512
+ template <int&..., typename T, typename Compare>
2513
+ void c_sort(RepeatedPtrField<T>& cont, Compare cmp) {
2514
+ google::protobuf::sort(cont.begin(), cont.end(), cmp);
2515
+ }
2516
+ template <int&..., typename T>
2517
+ void c_sort(RepeatedPtrField<T>& cont) {
2518
+ google::protobuf::c_sort(cont, std::less<>{});
2519
+ }
2520
+ template <int&..., typename T, typename Compare>
2521
+ void c_stable_sort(RepeatedPtrField<T>& cont, Compare cmp) {
2522
+ google::protobuf::stable_sort(cont.begin(), cont.end(), cmp);
2523
+ }
2524
+ template <int&..., typename T>
2525
+ void c_stable_sort(RepeatedPtrField<T>& cont) {
2526
+ google::protobuf::c_stable_sort(cont, std::less<>{});
2527
+ }
2528
+
2529
+ // Iterators and helper functions that follow the spirit of the STL
2530
+ // std::back_insert_iterator and std::back_inserter but are tailor-made
2531
+ // for RepeatedField and RepeatedPtrField. Typical usage would be:
2532
+ //
2533
+ // std::copy(some_sequence.begin(), some_sequence.end(),
2534
+ // RepeatedFieldBackInserter(proto.mutable_sequence()));
2535
+ //
2536
+ // Ported by johannes from util/gtl/proto-array-iterators.h
2537
+
2538
+ namespace internal {
2539
+
2540
+ // A back inserter for RepeatedPtrField objects.
2541
+ template <typename T>
2542
+ class RepeatedPtrFieldBackInsertIterator {
2543
+ public:
2544
+ using iterator_category = std::output_iterator_tag;
2545
+ using value_type = T;
2546
+ using pointer = void;
2547
+ using reference = void;
2548
+ using difference_type = std::ptrdiff_t;
2549
+
2550
+ RepeatedPtrFieldBackInsertIterator(RepeatedPtrField<T>* const mutable_field)
2551
+ : field_(mutable_field), arena_(mutable_field->GetArena()) {}
2552
+ RepeatedPtrFieldBackInsertIterator<T>& operator=(const T& value) {
2553
+ *field_->AddWithArena(arena_) = value;
2554
+ return *this;
2555
+ }
2556
+ RepeatedPtrFieldBackInsertIterator<T>& operator=(
2557
+ const T* const ptr_to_value) {
2558
+ *field_->AddWithArena(arena_) = *ptr_to_value;
2559
+ return *this;
2560
+ }
2561
+ RepeatedPtrFieldBackInsertIterator<T>& operator=(T&& value) {
2562
+ *field_->AddWithArena(arena_) = std::move(value);
2563
+ return *this;
2564
+ }
2565
+ RepeatedPtrFieldBackInsertIterator<T>& operator*() { return *this; }
2566
+ RepeatedPtrFieldBackInsertIterator<T>& operator++() { return *this; }
2567
+ RepeatedPtrFieldBackInsertIterator<T>& operator++(int /* unused */) {
2568
+ return *this;
2569
+ }
2570
+
2571
+ private:
2572
+ RepeatedPtrField<T>* field_;
2573
+ Arena* arena_;
2574
+ };
2575
+
2576
+ // A back inserter for RepeatedPtrFields that inserts by transferring ownership
2577
+ // of a pointer.
2578
+ template <typename T>
2579
+ class AllocatedRepeatedPtrFieldBackInsertIterator {
2580
+ public:
2581
+ using iterator_category = std::output_iterator_tag;
2582
+ using value_type = T;
2583
+ using pointer = void;
2584
+ using reference = void;
2585
+ using difference_type = std::ptrdiff_t;
2586
+
2587
+ explicit AllocatedRepeatedPtrFieldBackInsertIterator(
2588
+ RepeatedPtrField<T>* const mutable_field)
2589
+ : field_(mutable_field), arena_(mutable_field->GetArena()) {}
2590
+ AllocatedRepeatedPtrFieldBackInsertIterator<T>& operator=(
2591
+ T* const ptr_to_value) {
2592
+ // Directly call AddAllocated with the cached arena pointer. This avoids
2593
+ // the cost of calling `GetArena()` on `RepeatedPtrField`, which is
2594
+ // expensive.
2595
+ field_->RepeatedPtrFieldBase::template AddAllocated<
2596
+ typename RepeatedPtrField<T>::TypeHandler>(arena_, ptr_to_value);
2597
+ return *this;
2598
+ }
2599
+ AllocatedRepeatedPtrFieldBackInsertIterator<T>& operator*() { return *this; }
2600
+ AllocatedRepeatedPtrFieldBackInsertIterator<T>& operator++() { return *this; }
2601
+ AllocatedRepeatedPtrFieldBackInsertIterator<T>& operator++(int /* unused */) {
2602
+ return *this;
2603
+ }
2604
+
2605
+ private:
2606
+ RepeatedPtrField<T>* field_;
2607
+ Arena* arena_;
2608
+ };
2609
+
2610
+ // Almost identical to AllocatedRepeatedPtrFieldBackInsertIterator. This one
2611
+ // uses the UnsafeArenaAddAllocated instead.
2612
+ template <typename T>
2613
+ class UnsafeArenaAllocatedRepeatedPtrFieldBackInsertIterator {
2614
+ public:
2615
+ using iterator_category = std::output_iterator_tag;
2616
+ using value_type = T;
2617
+ using pointer = void;
2618
+ using reference = void;
2619
+ using difference_type = std::ptrdiff_t;
2620
+
2621
+ explicit UnsafeArenaAllocatedRepeatedPtrFieldBackInsertIterator(
2622
+ RepeatedPtrField<T>* const mutable_field)
2623
+ : field_(mutable_field) {}
2624
+ UnsafeArenaAllocatedRepeatedPtrFieldBackInsertIterator<T>& operator=(
2625
+ T const* const ptr_to_value) {
2626
+ field_->UnsafeArenaAddAllocated(const_cast<T*>(ptr_to_value));
2627
+ return *this;
2628
+ }
2629
+ UnsafeArenaAllocatedRepeatedPtrFieldBackInsertIterator<T>& operator*() {
2630
+ return *this;
2631
+ }
2632
+ UnsafeArenaAllocatedRepeatedPtrFieldBackInsertIterator<T>& operator++() {
2633
+ return *this;
2634
+ }
2635
+ UnsafeArenaAllocatedRepeatedPtrFieldBackInsertIterator<T>& operator++(
2636
+ int /* unused */) {
2637
+ return *this;
2638
+ }
2639
+
2640
+ private:
2641
+ RepeatedPtrField<T>* field_;
2642
+ };
2643
+ } // namespace internal
2644
+
2645
+ // Provides a back insert iterator for RepeatedPtrField instances,
2646
+ // similar to std::back_inserter().
2647
+ template <typename T>
2648
+ internal::RepeatedPtrFieldBackInsertIterator<T> RepeatedPtrFieldBackInserter(
2649
+ RepeatedPtrField<T>* const mutable_field) {
2650
+ return internal::RepeatedPtrFieldBackInsertIterator<T>(mutable_field);
2651
+ }
2652
+
2653
+ // Special back insert iterator for RepeatedPtrField instances, just in
2654
+ // case someone wants to write generic template code that can access both
2655
+ // RepeatedFields and RepeatedPtrFields using a common name.
2656
+ template <typename T>
2657
+ internal::RepeatedPtrFieldBackInsertIterator<T> RepeatedFieldBackInserter(
2658
+ RepeatedPtrField<T>* const mutable_field) {
2659
+ return internal::RepeatedPtrFieldBackInsertIterator<T>(mutable_field);
2660
+ }
2661
+
2662
+ // Provides a back insert iterator for RepeatedPtrField instances
2663
+ // similar to std::back_inserter() which transfers the ownership while
2664
+ // copying elements.
2665
+ template <typename T>
2666
+ internal::AllocatedRepeatedPtrFieldBackInsertIterator<T>
2667
+ AllocatedRepeatedPtrFieldBackInserter(
2668
+ RepeatedPtrField<T>* const mutable_field) {
2669
+ return internal::AllocatedRepeatedPtrFieldBackInsertIterator<T>(
2670
+ mutable_field);
2671
+ }
2672
+
2673
+ // Similar to AllocatedRepeatedPtrFieldBackInserter, using
2674
+ // UnsafeArenaAddAllocated instead of AddAllocated.
2675
+ // This is slightly faster if that matters. It is also useful in legacy code
2676
+ // that uses temporary ownership to avoid copies. Example:
2677
+ // RepeatedPtrField<T> temp_field;
2678
+ // temp_field.UnsafeArenaAddAllocated(new T);
2679
+ // ... // Do something with temp_field
2680
+ // temp_field.UnsafeArenaExtractSubrange(0, temp_field.size(), nullptr);
2681
+ // Putting temp_field on the arena fails because the ownership transfers to the
2682
+ // arena at the "AddAllocated" call and is not released anymore causing a
2683
+ // double delete. This function uses UnsafeArenaAddAllocated to prevent this.
2684
+ template <typename T>
2685
+ internal::UnsafeArenaAllocatedRepeatedPtrFieldBackInsertIterator<T>
2686
+ UnsafeArenaAllocatedRepeatedPtrFieldBackInserter(
2687
+ RepeatedPtrField<T>* const mutable_field) {
2688
+ return internal::UnsafeArenaAllocatedRepeatedPtrFieldBackInsertIterator<T>(
2689
+ mutable_field);
2690
+ }
2691
+
2692
+
2693
+ namespace internal {
2694
+ // Size optimization for `memswap<N>` - supplied below N is used by every
2695
+ // `RepeatedPtrField<T>`.
2696
+ extern template PROTOBUF_EXPORT_TEMPLATE_DECLARE void
2697
+ memswap<InternalMetadataResolverOffsetHelper<RepeatedPtrFieldBase>::value>(
2698
+ char* PROTOBUF_RESTRICT, char* PROTOBUF_RESTRICT);
2699
+ } // namespace internal
2700
+
2701
+ } // namespace protobuf
2702
+ } // namespace google
2703
+
2704
+ #include "google/protobuf/port_undef.inc"
2705
+
2706
+ #endif // GOOGLE_PROTOBUF_REPEATED_PTR_FIELD_H__