| 1276 | : Converter(chunked_array) {} |
| 1277 | |
| 1278 | SEXP Allocate(R_xlen_t n) const { |
| 1279 | auto extension_type = |
| 1280 | dynamic_cast<const RExtensionType*>(chunked_array_->type().get()); |
| 1281 | if (extension_type == nullptr) { |
| 1282 | Rf_error("Converter_Extension can't be used with a non-R extension type"); |
| 1283 | } |
| 1284 | |
| 1285 | return extension_type->Convert(chunked_array_); |
| 1286 | } |
| 1287 | |
| 1288 | // The conversion happens in Allocate() over the whole chunked array, so a slice |
| 1289 | // can't reuse it: convert an empty slice / the slice itself on its own instead. |