| 29 | } |
| 30 | |
| 31 | void TimeType::getTimeUnit(libmexclass::proxy::method::Context& context) { |
| 32 | namespace mda = ::matlab::data; |
| 33 | mda::ArrayFactory factory; |
| 34 | |
| 35 | auto time_type = std::static_pointer_cast<arrow::TimeType>(data_type); |
| 36 | const auto time_unit = time_type->unit(); |
| 37 | // Cast to uint8_t since there are only four supported TimeUnit enumeration values: |
| 38 | // Nanosecond, Microsecond, Millisecond, Second |
| 39 | auto timeunit_mda = factory.createScalar(static_cast<uint8_t>(time_unit)); |
| 40 | context.outputs[0] = timeunit_mda; |
| 41 | } |
| 42 | |
| 43 | template <typename ArrowType> |
| 44 | libmexclass::proxy::MakeResult make_time_type( |