| 27 | } |
| 28 | |
| 29 | absl::Status Activation::InsertFunction(std::unique_ptr<CelFunction> function) { |
| 30 | auto& overloads = function_map_[function->descriptor().name()]; |
| 31 | for (const auto& overload : overloads) { |
| 32 | if (overload->descriptor().ShapeMatches(function->descriptor())) { |
| 33 | return absl::InvalidArgumentError( |
| 34 | "Function with same shape already defined in activation"); |
| 35 | } |
| 36 | } |
| 37 | overloads.emplace_back(std::move(function)); |
| 38 | return absl::OkStatus(); |
| 39 | } |
| 40 | |
| 41 | std::vector<const CelFunction*> Activation::FindFunctionOverloads( |
| 42 | absl::string_view name) const { |