From f4b97c55ba1e6bb95cb45e9347b6ec922491a2a5 Mon Sep 17 00:00:00 2001 From: Sarah Gilmore Date: Tue, 14 May 2024 15:38:22 -0400 Subject: [PATCH] lint cpp code --- matlab/src/cpp/arrow/matlab/c/proxy/array.cc | 51 ++++++++++---------- matlab/src/cpp/arrow/matlab/c/proxy/array.h | 24 +++++---- 2 files changed, 37 insertions(+), 38 deletions(-) diff --git a/matlab/src/cpp/arrow/matlab/c/proxy/array.cc b/matlab/src/cpp/arrow/matlab/c/proxy/array.cc index 2253f64b175c5..4baa9b46241a6 100644 --- a/matlab/src/cpp/arrow/matlab/c/proxy/array.cc +++ b/matlab/src/cpp/arrow/matlab/c/proxy/array.cc @@ -23,35 +23,36 @@ namespace arrow::matlab::c::proxy { - struct ArrowArrayDeleter { - void operator()(ArrowArray* array) const { - if (array) { - free(array); - } +struct ArrowArrayDeleter { + void operator()(ArrowArray* array) const { + if (array) { + free(array); } - }; - - Array::Array() : arrowArray{ArrowArrayPtr(new ArrowArray(), ArrowArrayDeleter())} { - REGISTER_METHOD(Array, getAddress); } +}; - Array::~Array() { - if (arrowArray && arrowArray->release != nullptr) { - arrowArray->release(arrowArray.get()); - arrowArray->release = nullptr; - } - } +Array::Array() : arrowArray{ArrowArrayPtr(new ArrowArray(), ArrowArrayDeleter())} { + REGISTER_METHOD(Array, getAddress); +} - libmexclass::proxy::MakeResult Array::make(const libmexclass::proxy::FunctionArguments& constructor_arguments) { - return std::make_shared(); +Array::~Array() { + if (arrowArray && arrowArray->release != nullptr) { + arrowArray->release(arrowArray.get()); + arrowArray->release = nullptr; } +} - void Array::getAddress(libmexclass::proxy::method::Context& context) { - namespace mda = ::matlab::data; - - mda::ArrayFactory factory; - auto address = reinterpret_cast(arrowArray.get()); - context.outputs[0] = factory.createScalar(address); - } +libmexclass::proxy::MakeResult Array::make( + const libmexclass::proxy::FunctionArguments& constructor_arguments) { + return std::make_shared(); +} + +void Array::getAddress(libmexclass::proxy::method::Context& context) { + namespace mda = ::matlab::data; + + mda::ArrayFactory factory; + auto address = reinterpret_cast(arrowArray.get()); + context.outputs[0] = factory.createScalar(address); +} -} // namespace arrow::matlab::c::proxy \ No newline at end of file +} // namespace arrow::matlab::c::proxy \ No newline at end of file diff --git a/matlab/src/cpp/arrow/matlab/c/proxy/array.h b/matlab/src/cpp/arrow/matlab/c/proxy/array.h index 8f47be4426b75..13f71693a8dbc 100644 --- a/matlab/src/cpp/arrow/matlab/c/proxy/array.h +++ b/matlab/src/cpp/arrow/matlab/c/proxy/array.h @@ -23,23 +23,21 @@ namespace arrow::matlab::c::proxy { - using ArrowArrayPtr = std::shared_ptr; +using ArrowArrayPtr = std::shared_ptr; +class Array : public libmexclass::proxy::Proxy { + public: + Array(); - class Array : public libmexclass::proxy::Proxy { - public: - Array(); + ~Array(); - ~Array(); - - static libmexclass::proxy::MakeResult make( + static libmexclass::proxy::MakeResult make( const libmexclass::proxy::FunctionArguments& constructor_arguments); - protected: - void getAddress(libmexclass::proxy::method::Context& context); - - ArrowArrayPtr arrowArray; + protected: + void getAddress(libmexclass::proxy::method::Context& context); - }; + ArrowArrayPtr arrowArray; +}; -} // namespace arrow::matlab::c::proxy \ No newline at end of file +} // namespace arrow::matlab::c::proxy \ No newline at end of file