Commits


sgilmore10 authored and GitHub committed 9fe23dac685
GH-36853: [MATLAB] Add utility to create proxies from existing `arrow::DataType` objects (#36873) ### Rationale for this change There will be many places in the MATLAB interface code base in which we will have to wrap an `arrow::DataType` object within a subclass of `arrow::matlab::type::proxy::Type`. To avoid code duplicaiton, we should add a utility function called `wrap` that accepts a pointer to an `arrow::DataType` object and returns a pointer to a `arrow::matlab::type::proxy::Type` object. ### What changes are included in this PR? 1. Added a new function with the following signature: ```cpp arrow::Result<std::shared_ptr<arrow::matlab::type::proxy::Type>> wrap(const std::shared_ptr<arrow::DataType>& datatype); ``` 2. Updated the `type` methods of `arrow::matlab::type::proxy::Field` and `arrow::matlab::array::proxy::Array` to use `wrap`. ### Are these changes tested? No new tests needed. ### Are there any user-facing changes? No * Closes: #36853 Lead-authored-by: Sarah Gilmore <sgilmore@mathworks.com> Co-authored-by: sgilmore10 <74676073+sgilmore10@users.noreply.github.com> Co-authored-by: Sutou Kouhei <kou@cozmixng.org> Signed-off-by: Kevin Gurney <kgurney@mathworks.com>