MCPcopy Create free account
hub / github.com/apache/arrow / wrap

Function wrap

matlab/src/cpp/arrow/matlab/proxy/wrap.cc:137–183  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

135
136template <typename Wrapper>
137arrow::Result<std::shared_ptr<typename Wrapper::OutputType>> wrap(
138 const std::shared_ptr<typename Wrapper::InputType>& input, const Wrapper& wrapper) {
139 using ID = arrow::Type::type;
140 switch (get_type_id(input)) {
141 case ID::BOOL:
142 return wrapper.template wrap<arrow::BooleanType>(input);
143 case ID::UINT8:
144 return wrapper.template wrap<arrow::UInt8Type>(input);
145 case ID::UINT16:
146 return wrapper.template wrap<arrow::UInt16Type>(input);
147 case ID::UINT32:
148 return wrapper.template wrap<arrow::UInt32Type>(input);
149 case ID::UINT64:
150 return wrapper.template wrap<arrow::UInt64Type>(input);
151 case ID::INT8:
152 return wrapper.template wrap<arrow::Int8Type>(input);
153 case ID::INT16:
154 return wrapper.template wrap<arrow::Int16Type>(input);
155 case ID::INT32:
156 return wrapper.template wrap<arrow::Int32Type>(input);
157 case ID::INT64:
158 return wrapper.template wrap<arrow::Int64Type>(input);
159 case ID::FLOAT:
160 return wrapper.template wrap<arrow::FloatType>(input);
161 case ID::DOUBLE:
162 return wrapper.template wrap<arrow::DoubleType>(input);
163 case ID::TIMESTAMP:
164 return wrapper.template wrap<arrow::TimestampType>(input);
165 case ID::TIME32:
166 return wrapper.template wrap<arrow::Time32Type>(input);
167 case ID::TIME64:
168 return wrapper.template wrap<arrow::Time64Type>(input);
169 case ID::DATE32:
170 return wrapper.template wrap<arrow::Date32Type>(input);
171 case ID::DATE64:
172 return wrapper.template wrap<arrow::Date64Type>(input);
173 case ID::STRING:
174 return wrapper.template wrap<arrow::StringType>(input);
175 case ID::LIST:
176 return wrapper.template wrap<arrow::ListType>(input);
177 case ID::STRUCT:
178 return wrapper.template wrap<arrow::StructType>(input);
179 default:
180 return arrow::Status::NotImplemented("Unsupported DataType: " +
181 get_type_string(input));
182 }
183}
184
185::matlab::data::StructArray manage_proxy(
186 const std::shared_ptr<libmexclass::proxy::Proxy>& proxy,

Callers

nothing calls this directly

Calls 3

get_type_idFunction · 0.85
get_type_stringFunction · 0.85
NotImplementedFunction · 0.50

Tested by

no test coverage detected