| 197 | } |
| 198 | |
| 199 | absl::node_hash_map<std::string, std::vector<const cel::FunctionDescriptor*>> |
| 200 | FunctionRegistry::ListFunctions() const { |
| 201 | absl::node_hash_map<std::string, std::vector<const cel::FunctionDescriptor*>> |
| 202 | descriptor_map; |
| 203 | |
| 204 | for (const auto& entry : functions_) { |
| 205 | std::vector<const cel::FunctionDescriptor*> descriptors; |
| 206 | const RegistryEntry& function_entry = entry.second; |
| 207 | descriptors.reserve(function_entry.static_overloads.size() + |
| 208 | function_entry.lazy_overloads.size()); |
| 209 | for (const auto& entry : function_entry.static_overloads) { |
| 210 | descriptors.push_back(entry.descriptor.get()); |
| 211 | } |
| 212 | for (const auto& entry : function_entry.lazy_overloads) { |
| 213 | descriptors.push_back(entry.descriptor.get()); |
| 214 | } |
| 215 | descriptor_map[entry.first] = std::move(descriptors); |
| 216 | } |
| 217 | |
| 218 | return descriptor_map; |
| 219 | } |
| 220 | |
| 221 | bool FunctionRegistry::DescriptorRegistered( |
| 222 | const cel::FunctionDescriptor& descriptor) const { |