Provide accessors for friend-visibility internal runtime details. CEL supported runtime extensions need implementation specific details to work correctly. We restrict access to prevent external usages since we don't guarantee stability on the implementation details.
| 27 | // correctly. We restrict access to prevent external usages since we don't |
| 28 | // guarantee stability on the implementation details. |
| 29 | class RuntimeFriendAccess { |
| 30 | public: |
| 31 | // Access underlying runtime instance. |
| 32 | static Runtime& GetMutableRuntime(RuntimeBuilder& builder) { |
| 33 | return builder.runtime(); |
| 34 | } |
| 35 | |
| 36 | // Return the internal type_id for the runtime instance for checked down |
| 37 | // casting. |
| 38 | static NativeTypeId RuntimeTypeId(Runtime& runtime) { |
| 39 | return runtime.GetNativeTypeId(); |
| 40 | } |
| 41 | }; |
| 42 | |
| 43 | } // namespace cel::runtime_internal |
| 44 |