| 37 | namespace cel { |
| 38 | |
| 39 | absl::StatusOr<bool> Activation::FindVariable( |
| 40 | absl::string_view name, |
| 41 | const google::protobuf::DescriptorPool* absl_nonnull descriptor_pool, |
| 42 | google::protobuf::MessageFactory* absl_nonnull message_factory, |
| 43 | google::protobuf::Arena* absl_nonnull arena, Value* absl_nonnull result) const { |
| 44 | ABSL_DCHECK(descriptor_pool != nullptr); |
| 45 | ABSL_DCHECK(message_factory != nullptr); |
| 46 | ABSL_DCHECK(result != nullptr); |
| 47 | |
| 48 | auto iter = values_.find(name); |
| 49 | if (iter == values_.end()) { |
| 50 | return false; |
| 51 | } |
| 52 | |
| 53 | const ValueEntry& entry = iter->second; |
| 54 | if (entry.provider.has_value()) { |
| 55 | return ProvideValue(name, descriptor_pool, message_factory, arena, result); |
| 56 | } |
| 57 | if (entry.value.has_value()) { |
| 58 | *result = *entry.value; |
| 59 | return true; |
| 60 | } |
| 61 | return false; |
| 62 | } |
| 63 | |
| 64 | absl::StatusOr<bool> Activation::ProvideValue( |
| 65 | absl::string_view name, |