| 77 | explicit OptionsWrapper(OptionsType options) : options(std::move(options)) {} |
| 78 | |
| 79 | static Result<std::unique_ptr<KernelState>> Init(KernelContext* ctx, |
| 80 | const KernelInitArgs& args) { |
| 81 | if (auto options = static_cast<const OptionsType*>(args.options)) { |
| 82 | return std::make_unique<OptionsWrapper>(*options); |
| 83 | } |
| 84 | |
| 85 | return Status::Invalid( |
| 86 | "Attempted to initialize KernelState from null FunctionOptions"); |
| 87 | } |
| 88 | |
| 89 | static const OptionsType& Get(const KernelState& state) { |
| 90 | return ::arrow::internal::checked_cast<const OptionsWrapper&>(state).options; |