| 162 | } |
| 163 | |
| 164 | absl::StatusOr<bool> Next2( |
| 165 | const google::protobuf::DescriptorPool* absl_nonnull descriptor_pool, |
| 166 | google::protobuf::MessageFactory* absl_nonnull message_factory, |
| 167 | google::protobuf::Arena* absl_nonnull arena, Value* absl_nonnull key, |
| 168 | Value* absl_nullable value) override { |
| 169 | ABSL_DCHECK(descriptor_pool != nullptr); |
| 170 | ABSL_DCHECK(message_factory != nullptr); |
| 171 | ABSL_DCHECK(arena != nullptr); |
| 172 | ABSL_DCHECK(key != nullptr); |
| 173 | |
| 174 | if (index_ >= elements_.size()) { |
| 175 | return false; |
| 176 | } |
| 177 | if (value != nullptr) { |
| 178 | *value = elements_[index_]; |
| 179 | } |
| 180 | *key = IntValue(index_++); |
| 181 | return true; |
| 182 | } |
| 183 | |
| 184 | private: |
| 185 | const absl::Span<const Value> elements_; |